Memory manager and OpenGL errors

Started by
1 comment, last by Mihail121 21 years, 1 month ago
Hi guys! I just want to ask you something.One of the programmers in my team has written a memory manager and this allow us to allocate all the needed memory at the start of the program and them don''t do error checks since there always will be memory avaidable.Can you please tell me if it''s better to use this manager or use the hard and slow "malloc" operations and check for each one. The second question is about OpenGL error handling: Is it better to do this: glGenTextures(1,&id); if(!id) ; or this: if(glGetError() != GL_NO_ERROR) ; The same is for the display lists and for all other cases when glGetError is not the only way to get errors! 10x The PAIN is coming...this summer!!!In cinemas everywhere.
Advertisement
#1
Since you really shouldn''t do memory allocations in speed critical parts of the code unless you really have to, the speed of the allocation is really not that important. And since your memory manager never runs out of memory (sounds like the holy grail, or did I miss simething), I see no reason not to use it.

#2
You''re comparing apples and bananas, they don''t do the same thing. The first will see if a proper texture ID was returned, the other will see if there are any errors. glGenTextures will not generate an error if a proper ID was not returned. So if glGenTextures fails, the first if will catch this, but the second won''t.
10x

Anyone else wants to say something about the memory manager???

The PAIN is coming...this summer!!!In cinemas everywhere.

This topic is closed to new replies.

Advertisement