• Advertisement
Sign in to follow this  

[.net] seting up an opengl window in c++.net

This topic is 3561 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have been working on a level editor,I used win32 libraries and cplusplus, however using native win32 library is making development very hard. So i decided to move to c++.net I spend about 2 days on research and I found out C#.net has a library named CSGL it is working fine and I can use it for my project. But I prefer using c++.net in my project. Than I found an article about creating opengl view in windows form and it was realy useful.Here its link http://www.codeproject.com/KB/miscctrl/OpenGLViewWinForms.aspx but when I make a project and run it, 1) m_hglrc = wglCreateContext(hdc); this line return a null 2) public ref class COpenGL: public System::Windows::Forms::NativeWindow instead of NativeWindow, Can I use Form I used form but same error occurred(wglCreateContext return null) soryy for my English, I hope that I can explain myself properly

Share this post

Link to post
Share on other sites
I checked the last error

here is my format(actually it was working without problem)

sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored

moreover Im using ChoosePixelFormat to set the pixel format.

any idea ?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement