2

What I am trying to do is get a couple of textures from my program and render them into one texture and send it back, but I only want it to render them when I tell it to. Is there some way to get rid of opengl's main loop so I can render when I want it to, or can I pause the main loop until I want to render the next texture?

Edit: I'm using Glut and Glew right now.

7
  • 1
    Render will always be called. But what's wrong with if(skipRender) return; ? Commented Oct 31, 2012 at 15:38
  • I've never heard of skipRender, so I don't know how it would work Commented Oct 31, 2012 at 15:44
  • skipRender is not a language or framework feature. It's just a made up boolean. You need to become more comfortable with C++ in general before tackling a beast like OpenGL. Commented Oct 31, 2012 at 15:45
  • It sounds like you're using some third party API with OpenGL that's controlling the main loop for you, like glut. Do you know if that's the case? Commented Oct 31, 2012 at 15:46
  • yup thats it, I always forget that glut isn't part of opengl, guess it looks like that was my main problem Commented Oct 31, 2012 at 15:51

1 Answer 1

7

OpenGL has no main loop. Are you using some kind of framework? What makes you think you cannot control when renders happen? You should have control over when you swap buffers or call glFlush(). It sounds more like you need to simply better understand C++ control structures, but it's hard to know with the severely limited information presented in your question.

Sign up to request clarification or add additional context in comments.

2 Comments

Ahh, yeah, I was using glut which has a main loop, I guess that makes sense now. I thought it would be something simple like this I just could find out what it was.
@ParkerOlson OK. Personally, I recommend learning SDL. You can easily form an OpenGL context and then create (or not create) your own event loop. You can do your render and then stop.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.