Loading ...
Sorry, an error occurred while loading the content.

OpenGL ES wrapper for wince

Expand Messages
  • smartmobili
    Hi, I wrote a small openGL ES wrapper for pocket pc platform but I have some issues. For instance I would like to make some actions in the OnIdle method().
    Message 1 of 5 , Apr 5, 2009
    • 0 Attachment
      Hi,

      I wrote a small openGL ES wrapper for pocket pc platform but I have some issues.
      For instance I would like to make some actions in the OnIdle method().
      First I tried to use CMessageFilter and CIdleHandler as shown below

      class CMainFrame :
      public CFrameWindowImpl<CMainFrame>,
      public COpenGLES<CMainFrame>,
      public CUpdateUI<CMainFrame>,
      public CMessageFilter, public CIdleHandler,
      public CAppWindow<CMainFrame>
      {
      public:
      ...
      virtual BOOL OnIdle()
      {
      RedrawWindow();
      return FALSE;
      }
      };

      The problem is OnIdle is almost never called, so I choose to call SetTimer in the OnCreate method as shown below :

      LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
      {
      AtlCreateEmptyMenuBar(m_hWnd);

      // register object for message filtering and idle updates
      CMessageLoop* pLoop = _Module.GetMessageLoop();
      ATLASSERT(pLoop != NULL);
      pLoop->AddMessageFilter(this);
      pLoop->AddIdleHandler(this);

      UINT nIDEvent = ::SetTimer(m_hWnd, 1, 40, NULL);
      ATLTRACE(_T("nIDEvent = %d\r\n"), nIDEvent);

      return bHandled = FALSE;
      }

      The problem is I NEVER receive the WM_TIMER message and of course I have declared it in the message map.
      In the files group I will upload my sample code (TestOgles.zip)

      If you have any idea please let me know.
    • smartmobili
      ... Actually I think I found, it seems I receive lots of WM_PAINT messages and since WM_TIMER is not a prioritary one I suppose this is the reason OnTimer is
      Message 2 of 5 , Apr 5, 2009
      • 0 Attachment
        --- In wtl@yahoogroups.com, "smartmobili" <smartmobili@...> wrote:
        >
        > Hi,
        >
        > I wrote a small openGL ES wrapper for pocket pc platform but I have some issues.
        > For instance I would like to make some actions in the OnIdle method().
        > First I tried to use CMessageFilter and CIdleHandler as shown below
        >
        > class CMainFrame :
        > public CFrameWindowImpl<CMainFrame>,
        > public COpenGLES<CMainFrame>,
        > public CUpdateUI<CMainFrame>,
        > public CMessageFilter, public CIdleHandler,
        > public CAppWindow<CMainFrame>
        > {
        > public:
        > ...
        > virtual BOOL OnIdle()
        > {
        > RedrawWindow();
        > return FALSE;
        > }
        > };
        >
        > The problem is OnIdle is almost never called, so I choose to call SetTimer in the OnCreate method as shown below :
        >
        > LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
        > {
        > AtlCreateEmptyMenuBar(m_hWnd);
        >
        > // register object for message filtering and idle updates
        > CMessageLoop* pLoop = _Module.GetMessageLoop();
        > ATLASSERT(pLoop != NULL);
        > pLoop->AddMessageFilter(this);
        > pLoop->AddIdleHandler(this);
        >
        > UINT nIDEvent = ::SetTimer(m_hWnd, 1, 40, NULL);
        > ATLTRACE(_T("nIDEvent = %d\r\n"), nIDEvent);
        >
        > return bHandled = FALSE;
        > }
        >
        > The problem is I NEVER receive the WM_TIMER message and of course I have declared it in the message map.
        > In the files group I will upload my sample code (TestOgles.zip)
        >
        > If you have any idea please let me know.
        >
        Actually I think I found, it seems I receive lots of WM_PAINT messages and since WM_TIMER is not a prioritary one I suppose this is the reason OnTimer is never called...
      • smartmobili
        ... I will rewrite some part of this openGL ES wrapper and upload it here if some people are interested.
        Message 3 of 5 , Apr 5, 2009
        • 0 Attachment
          > Actually I think I found, it seems I receive lots of WM_PAINT messages and since WM_TIMER is not a prioritary one I suppose this is the reason OnTimer is never called...
          >

          I will rewrite some part of this openGL ES wrapper and upload it here if some people are interested.
        • Joel Winarske
          I am interested in your wrapper.
          Message 4 of 5 , Apr 5, 2009
          • 0 Attachment
            I am interested in your wrapper.

            smartmobili wrote:
            >> Actually I think I found, it seems I receive lots of WM_PAINT messages and since WM_TIMER is not a prioritary one I suppose this is the reason OnTimer is never called...
            >>
            >>
            >
            > I will rewrite some part of this openGL ES wrapper and upload it here if some people are interested.
          • timfun@yahoo.cn
            I am interested in your wrapper too.
            Message 5 of 5 , Jun 8, 2009
            • 0 Attachment
              I am interested in your wrapper too.


              --- In wtl@yahoogroups.com, Joel Winarske <joelw@...> wrote:
              >
              > I am interested in your wrapper.
              >
              > smartmobili wrote:
              > >> Actually I think I found, it seems I receive lots of WM_PAINT messages and since WM_TIMER is not a prioritary one I suppose this is the reason OnTimer is never called...
              > >>
              > >>
              > >
              > > I will rewrite some part of this openGL ES wrapper and upload it here if some people are interested.
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.