PDA

View Full Version : OpenGL Clear Buffer Crash



intenseza
04-18-2013, 02:02 PM
Hey all

This is probably a noob mistake I'm making, but I'm running glut in VS,

What I'm trying to do is run a timer, which makes a change to certain particles, clear the screen, redraw (doing this using a timer)

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

This is when I call

Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
DISPLAYGRAPH();
Gl.glLoadIdentity();

Please help a newbie :)

intenseza
04-18-2013, 02:34 PM
Sorted it out, but I still have a problem with flickering... I'm not sure where to place the GlutSwapbuffers... or will this even eliminate the flickering?
I know double buffering must be implemented, but this command isn't working...

carsten neumann
04-18-2013, 03:25 PM
Generally you swap buffers after being done drawing a frame, i.e. everything that you want to be visible. There is not enough information (and/or code) to guess what the problem might be. Also, please use the [ code]/[ /code] (no space after '[') tags around source snippets and review the Forum Posting Guidelines (http://www.opengl.org/discussion_boards/showthread.php/176139-Forum-Posting-Guidelines) for suggestions how to best ask questions.

intenseza
04-18-2013, 04:56 PM
I managed to come right, simply changed the setting from SINGLE to DOUBLE buffering. Reading and searching through forums is always a good thing I suppose :D
Thanks for the response, much appreciated.