multiple windows

Started by
0 comments, last by godmodder 18 years, 1 month ago
hello, i must create a simple flight simulation and i reached a point were don't know haow to go on. I created a openGl window and painted the airplane, but when i try creating a second OpenGl window at runtime i get an acces violation error. I create each openGL window using theh following function:(i use Borland Builder 5) void __fastcall TFormMain::FormCreate(TObject *Sender) { hdc = GetDC(Handle); SetPixelFormatDescriptor(); vad=true; corectat=true; hrc = wglCreateContext(hdc); if(hrc == NULL) ShowMessage(":-)~ hrc == NULL"); if(wglMakeCurrent(hdc, hrc) == false) ShowMessage("Could not MakeCurrent"); w = ClientWidth; h = ClientHeight; glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); If u have any ideea how to solve this problem please help me.
Advertisement
You should be sure not to use any duplicate device contexts or something. Check that for a minute and ask further info then...

This topic is closed to new replies.

Advertisement