Results 1 to 8 of 8

Thread: Testers wanted: TBGL_MouseGetPos* with RenderMatrix2D support

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Thumbs up Testers wanted: TBGL_MouseGetPos* with RenderMatrix2D support

    Hi,

    as DirectuX suggested, it might be handy to have TBGL_MouseGetPosX & TBGL_MouseGetPosY aware of the RenderMatrix2D coordinates.

    I attach version which should achieve the following:
    - preserve backward compatibility for TBGL_MouseGetPosX & TBGL_MouseGetPosY
    - add ability to specify %TBGL_2D or %TBGL_CLIENTAREA as parameters for these functions, controling their behaviour
    - add TBGL_MouseInClient function to check whether mouse is in window client area

    Just copy the DLL from the attachement to the Lib directory & try different scenarios.

    Example:
    
    uses "tbgl"
    
    
    function tbmain()
     
      dword hWin = tbgl_createWindowEx ("201x201 - ESC to quit", 201, 201, 32, %TBGL_WS_WINDOWED or %TBGL_WS_DONTSIZE)
      tbgl_showWindow
      
      tbgl_useDepth false
    
    
      tbgl_resetKeyState()
      
      
      while tbgl_isWindow(hWin)
        
        tbgl_clearFrame
    
    
          tbgl_renderMatrix2D(-100, 100, 100, -100, %TBGL_PIXEL_PERFECT_2D)
          
          tbgl_polygonlook %GL_LINE
          tbgl_color 255, 0, 0
          tbgl_rect(-100, -100, 100, 100)
    
    
        tbgl_drawFrame
        
        if tbgl_getWindowKeyState(hWin, %VK_ESCAPE) then
          exit while
        end if
       
        if tbgl_mouseInClient then
          tbgl_setwindowtitle(hWin, tbgl_mousegetposx(%TBGL_2D) + " " + tbgl_mousegetposy(%TBGL_2D))
        else
          tbgl_setwindowtitle(hWin, "Mouse is out of the client area")
        end if
      wend
    
    
      tbgl_destroyWindow
     
    end function
    

    Thank you for your help,
    Petr
    Attached Files Attached Files
    Last edited by Petr Schreiber; 12-01-2019 at 23:48.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. ScriptBasic Help Wanted
    By John Spikowski in forum Development
    Replies: 1
    Last Post: 02-08-2008, 15:20
  2. Just wanted to say sorry
    By kryton9 in forum Shout Box Area
    Replies: 2
    Last Post: 15-09-2007, 05:45
  3. TBGL Support
    By Petr Schreiber in forum TBGL General
    Replies: 9
    Last Post: 21-06-2007, 05:49
  4. RichEdit - RTF. We need some testers
    By ErosOlmi in forum Announcements
    Replies: 2
    Last Post: 19-09-2006, 00:23

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •