Results 1 to 8 of 8

Thread: Testers wanted: TBGL_MouseGetPos* with RenderMatrix2D support

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,089
    Blog Entries
    5
    Rep Power
    726

    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

  2. #2
    Quote Originally Posted by Petr Schreiber View Post
    Just copy the DLL from the attachement to the Lib directory & try different scenarios.


    Thank you for your help,
    Petr
    Hi, Petr,

    I can't see the attachment...
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,089
    Blog Entries
    5
    Rep Power
    726
    Hi Sebastian,

    I re-uploaded the attachment - it got rejected as DLL, but once ZIPped, it can be attached nicely


    Petr
    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

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    54
    Posts
    8,636
    Blog Entries
    2
    Rep Power
    10
    Your attached TBGL works fine here
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,089
    Blog Entries
    5
    Rep Power
    726
    Thank you Eros,

    works okay here as well, integrated & documented & will be present in next thinBasic release


    Petr
    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

  6. #6
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    48
    Posts
    919
    Rep Power
    105
    good morning, the mouse example doesn't work here properly, the rectangle window frame appears however when I am drag mouse over little window frame I have got an error something with 2d-matrix etcpp... I am using windows 10 with 64 bit, and have downloaded last thinbasic and tbgl package, regards, frank
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  7. #7
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    48
    Posts
    919
    Rep Power
    105
    picture see below I have forgotten to send, thanks :-)
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	test-mouse-tbgl-error.jpg 
Views:	62 
Size:	80.0 KB 
ID:	9932  
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  8. #8
    Quote Originally Posted by Lionheart008 View Post
    picture see below I have forgotten to send, thanks :-)
    Hi Lionheart008,
    on your screenshot there are 3 parenthesis at the end of the line 34 ,
    there should be 2.
    Last edited by DirectuX; 10-02-2019 at 11:04.
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

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

Posting Permissions

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