Results 1 to 2 of 2

Thread: OpenGL CreateWindowEx Query

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2002
    Posts
    2

    OpenGL CreateWindowEx Query

    Hi,

    I have set up a basic OpenGL application using WinAPI calls for Window Management (i.e. CreateWindowEx, SetPixelFormat, MakeCurrentDC way). The Window's Handler code checks for a WM_CHAR, WM_CREATE, WM_DESTROY events and everything works fine.
    The WM-CHAR checks for escape key, if pressed it shuts down everything.

    I just rendered a basic triangle on screen and this shows correctly. My problem is when I attempt to rotate the triangle, rotation does not work independantly until I hold down a key on the keyboard. My events message subroutine acts like this :-

    Code :
        PeekMessage lpMsg, NULL, 0, 0, %PM_NOREMOVE
        IF GetMessage(lpMsg, NULL, 0, 0) THEN
            TranslateMessage lpMsg
            DispatchMessage lpMsg
        ELSE
            EXIT
        END IF
    If I comment out the GetMessage code, the triangle does rotate independently but I lose the ability to check for escape key event. How can I intercept win events and rotate the triangle asynchronously? Hope you guys understand what I mean.

    - Rav.

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2002
    Posts
    2

    Re: OpenGL CreateWindowEx Query

    Ok, ignore that I figured it out, code should infact be :-

    Code :
        IF PeekMessage (lpMsg, NULL, 0, 0, %PM_NOREMOVE) THEN
            IF GetMessage(lpMsg, NULL, 0, 0) THEN
                TranslateMessage lpMsg
                DispatchMessage lpMsg
    	ELSE
    	    EXIT
            END IF
        END IF
    Doh!

Similar Threads

  1. opengl matrix query
    By jyoti in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-09-2009, 04:58 AM
  2. OpenGL 3.0 and extensions query
    By imported_execom_rt in forum OpenGL: Windows
    Replies: 1
    Last Post: 04-02-2009, 07:58 PM
  3. OpenGL beginner query
    By stevoMayo in forum OpenGL: General
    Replies: 2
    Last Post: 11-25-2005, 03:09 AM
  4. Query OpenGL Support
    By Tombernick in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 03-03-2004, 08:08 AM
  5. OpenGL query
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-11-2003, 08:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean