Re: Still having OpenGL problems

new topic     » goto parent     » topic index » view thread      » older message » newer message

I made an opengl demo for win32lib, go look at it, it might help.

Daniel Kluss
----- Original Message ----- 
From: <1evan at sbcglobal.net>
To: "EUforum" <EUforum at topica.com>
Subject: Still having OpenGL problems


>
>
> I have two code snippets here, the first in Euphoria the second in C++.
The Euphoria code fails to unregister the window class, the C++ works.  Can
anybody spot my error in the Euphoria code?
>
> --Euphoria procedure--
> procedure KillGLWindow()
>
>     if fullscreen then
>         if c_func(ChangeDisplaySettingsA,{NULL,0}) then end if
>         if c_func(ShowCursor,{TRUE}) then end if
>     end if
>
>     if hRC then
>         if c_func(wglMakeCurrent,{NULL,NULL}) then end if
>         if c_func(wglDeleteContext,{hRC}) then end if
>         hRC = NULL
>     end if
>
>     if hRC and not c_func(ReleaseDC,{hWnd,hDC}) then
>         hDC = NULL
>     end if
>
>     if hWnd and not c_func(DestroyWindow,{hWnd}) then
>         hWnd = NULL
>     end if
>
>     if not c_func(UnregisterClassA,{ClassName,hInstance}) then
>         hInstance = NULL
>     end if
>
> end procedure
>
> //C++ function
> GLvoid KillGLWindow(GLvoid)
> {
> if (fullscreen)
> {
> ChangeDisplaySettings(NULL,0);
> ShowCursor(TRUE);
> }
>
> if (hRC)
> {
> if (wglMakeCurrent(NULL,NULL))
> if (wglDeleteContext(hRC))
> hRC = NULL;
> }
>
> if (hDC && !ReleaseDC(hWnd,hDC))
>      hDC = NULL;
>
> if (hWnd && !DestroyWindow(hWnd))
>      hWnd = NULL;
>
> if (!UnregisterClass("OpenGL",hInstance))
>      hInstance = NULL;
> }
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu