Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Not exactly a bug, but a little thing when creating an image from a memblock of only zeroes

Author
Message
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 8th Nov 2016 11:03
These 3 lines will cause an error with the text "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT", and no information about what line this happened at. This happens when I create (BY ACCIDENT!!!) a memblock with only zeroes, like not setting the first 12 bytes with image width, image height and image color depth.

13/0
damothegreat
User Banned
Posted: 8th Nov 2016 13:00
I think you may have to

CreateRenderImage () first


Example



Hope this helps

Damo
Using Tier 1 AppGameKit V2
Started coding with AMOS
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Nov 2016 16:29
It looks like the question is about memblocks not render images.

I would put this in the same category as dividing by zero or accessing an array out of bounds. AppGameKit protects you from a lot of things, but there is still plenty of opportunity to break the system with mistakes.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 8th Nov 2016 18:08
zeropixel bug
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 10th Nov 2016 08:32
Okay I just wanted to let you AppGameKit guys know, in case it ought to come up with a normal AGK2 error message
13/0
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Nov 2016 08:44
i wrote a feature request for it
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 10th Nov 2016 16:02
Is the issue that you're trying to create an image from a memblock that doesn't contain image data? I think a crash is acceptable in that circumstance. It's like trying to open an excel spreadsheet with a toaster. It is never going to work (I'd love to see someone prove me wrong! haha), and an error would be fairly meaningless. You either need to put bread in the toaster, or open the spreadsheet in a suitable spreadsheet reader.

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 10th Nov 2016 20:45 Edited at: 10th Nov 2016 20:51
the problem was an error message without line number.
i think add a test inside CreateImageFromMemblock if width and height >0 is not a big deal.

@CJB
without width / height / depth it is an empty image, not really wrong, the open gl should handle this.
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
damothegreat
User Banned
Posted: 10th Nov 2016 22:41 Edited at: 10th Nov 2016 22:46
Its like an Header information on any type of file.

Word/Excel/PNG/JPEG - all has to had an header in built to be able to read the <data> for the purpose of the file.

So having zilch data in the header to begin with and running an image loading like creatememblock loadmemblockfromimage etc etc - it will require the header bits of information (atleast)
to process the rest otherwise it will go

What do I do???

It cannot decide what to do, give me some more detail or boooom a silly error occurs.

Just populate the first 12 bytes with info and by all means can leave the rest as zero bytes... But the commands require a width/height/depth
otherwise whats the real putpose of wanting to use these commands if not want to achieve anything (zero bytes)

D
Using Tier 1 AppGameKit V2
Started coding with AMOS
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Nov 2016 09:14 Edited at: 11th Nov 2016 09:16
What's the issue?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Attachments

Login to view attachments
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Nov 2016 09:38
a toaster also work without a toast = means 0 bytes of toast nothing in nothing out
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 11th Nov 2016 13:56
Lol @ Batvink!

Zero bites of toast = hungry developer.

I think the moral of the story is, if you're going to create an image out of a memblock, make sure the memblock contains image data, otherwise expect toasters.

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
damothegreat
User Banned
Posted: 11th Nov 2016 14:07
Don't forget the butter for the <header info> and then the tasty marmalade representing the <data>

Crunch and enjoy!

hope you @Cybermind have solved the mystery of the error and resolved it

D

Using Tier 1 AppGameKit V2
Started coding with AMOS
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Nov 2016 10:15
as workaround if you will goto into this trap again,
you can wrap it to your own function CreateImageFromMemblockEx and there make a message if width,height,depth is missing.
its also hugely useful for other commands because you can insert debug print there etc.
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 12th Nov 2016 17:53 Edited at: 12th Nov 2016 17:54
The zeros are not the problem, the dimensions of the image are the problem. It's the same, when you trying to play a sound file with the memblock-functions which don't have a propper header. So how the hight and the width or wour image? How could CreateImageFromMemblock ( ) work right? The error has do be in the second line.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 13th Nov 2016 09:20
@f4ktor
that required validation of input parameters, means a definition of min/max for width,height,depth and a test inside CreateImageFromMemblock.
else me would expect out of memory or a image.
AGK (Steam) V2.0.21 : Windows 10 Pro 64 Bit : AMD (16.6) Radeon R7 265 : Mac mini OS Sierra (10.12)
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 18th Nov 2016 20:34
I know where the error is, I already knew when I posted this topic, but I did not know where the error was when it occured within thousands of lines of code. I started hunting, and found the little bug. These few lines I posted here was just to demonstrate the error message without a line number. It is no problem with three lines of code to find the error, which is why I reduced this "bug" to a small example.
13/0

Login to post a reply

Server time is: 2024-11-24 22:46:05
Your offset time is: 2024-11-24 22:46:05