4

Question: Is there anyway at all to get an OpenGL context from GLUT?


Info: I've been working on learning openGL and openCL. I'm almost done with my first program that makes use of them together, everything would work wonderfully if I could only create create my openCL context, but to do that and get the sharing working I need to get an openGL context. I could go through the process of dealing with X, but I was hoping to keep this as platform-independent as possible with the fewest possible libraries. I'll just have to figure out something else if there is isn't. but I figured I should at least ask before I give up. Is there anyway, anyway at all, to get an OpenGL context from GLUT?

genpfault
52.3k12 gold badges93 silver badges153 bronze badges
asked Dec 30, 2011 at 22:00

1 Answer 1

3

You can't get the context from GLUT, but you can get it from Windows: wglGetCurrentContext. Similarly, on X-Windows systems, you may use glXGetCurrentContext.

answered Dec 30, 2011 at 22:21
Sign up to request clarification or add additional context in comments.

2 Comments

@Narcolapser: Why is that something to be "afraid of"? The context types are different for the different APIs anyway, so whatever any GLUT function returned would have to be #defined or otherwise #ifdefd around.
right. and i was afraid of that because this means I have to rework parts of my program that I thought I was done with. its just a hassle is all. More time. I was hoping to be done with this yesterday. oh well, life goes on.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.