OpenGL in my HWND
Right now, I'm trying to port a Direct3D renderer from my engine. I'm and OpenGL begginer so i dont have much knowlegde about OpenGL, as now i can create windows and do my render via glut, but i can't use glut for my project, because the HWND is created in my code and then sent to the renderer DLL
// Where pWindow is already a valid HWND target of the renderer
//(Currently Direct3D9 and Direct3D10
pRenderer = pCreateGraphics(800, 600, false, pWindow);
My question is: Is there library similar to GLUT that has a similar behaviour as GLUT, but allowing my to开发者_开发百科 use my own window handle?
Note: I prefer using a lib instead of reinventing the wheel, but i will do if there is not a library that can help me
Well you can have a look at GLFW's source code or NeHe tutorials and grab the OpenGL init code.
SDL lets you get the window handle. I don't know if the used pixel format can be assumed to be DirectX compatible though.
精彩评论