Results 1 to 5 of 5

Thread: Super Demos!

  1. #1

    Super Demos!

    Psch,

    Nice work!

    I've got an strange problem running the SimpleChart3 script. Could this be a problem with my hardware? I am playing around with the background color settings using the function tbgl_BackColor r, g, b, and whenever I set the combined color values of rgb greater then 6553599 {eg. RGB(255, 255, 99)} thinBasic crashes and my gl driver file sisgl.dll is flagged. Any idea what is happening?

    Regards,
    John

  2. #2

    Super Demos!

    Ok, got it working.

    I didn't have enough shared video memory. My AAS (AGP Apeture Size) in BIOS was set to 64 MB; doubling it works, so I tripled it for good measure. I guess OpenGL can use up video RAM pretty quickly.
    Is there a way to predict the amount of RAM you are about to consume, or any ideas on how to trap the error when you're short?

    Regards,

    John

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Super Demos!

    Hi John,

    I'm glad you like the chart.

    Thank you a lot for information about troubles with your graphic card.


    I'm testing my scripts on older GeForce 2 MX 64 MB on Win98, and newer Radeon 9600 128 MB on WinME. No problems found yet with these cards, although GeForce has "only" 64 MB of memory. I will test here also the latest chart example and let you know.


    I presume your SiS card is onboard one. I'm quite surprised by the
    unsuffciency of 64 MB for graphics .

    The sisgl.dll is some OpenGL wrapper for these cards - Super VGA OpenGL ICD.
    It means I can hardly predict the behaviour and level of this implementation of OpenGL on your system. But don't worry .


    The possible reasons, why it takes so much memory could be caused by various facts:


    The ICD driver way of emulation, I will try to google out how it works.


    I force 32bit colors for rendering in windowed mode ( in fullscreen it's selectable - 16, 24 or 32 ).

    I should allow you to setup bit depth in windowed mode too


    Second important thing is the size of viewport ( ~= rendered window area ). Bigger resolutions takes more memory.


    Next factor is the handling of textures. The filter specified when loading them is key feature. The best one - TBGL_TEX_MIPMAP results in perfect
    quality of displayed textures, but it can take a far more memory comparing to the others, because it internally creates sets of variations of one texture for better quality.


    The last factor is the use of display lists ( I use them a lot ). They can save
    a lot of speed problems by "precaching" the model in memory of card, but I'm not sure now, how much they take.


    In next releases of TBGL I will implement some info functions, which should return the name of 3D card, vendor, version of drivers, maximum resolution of textures, ... and even the
    free memory space.


    Thanks again for your information,
    Psch
    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
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Super Demos!

    Hi John,

    I think I found at least temporary solution to general detection of memory "problems".

    To introduce simple memory troubles checker just follow this 2 steps.

    Declare this at the beginning of the program:
    %GL_OUT_OF_MEMORY = &H0505
    DECLARE FUNCTION glGetError LIB "opengl32.dll" ALIAS "glGetError" () AS DWORD
    Insert this in the main loop of the program, but OUTSIDE any possible tbgl_BeginPoly / tbgl_EndPoly :
    IF glGetError = %GL_OUT_OF_MEMORY THEN
    MSGBOX hWnd, "Not Enough Graphic Memory", %MB_OK or %MB_ICONERROR, "TBGL Error"
    EXIT WHILE
    END IF
    It should generate error message when the memory will be overfilled


    Regards,
    Psch
    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

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Super Demos!

    Hi,

    don't know if still interested, but I have found even more convenient sollution to catch and analyze errors. It is based on some info from "OpenGL Programming Guide"

    DECLARE FUNCTION gluErrorString   LIB "glu32.dll" ALIAS "gluErrorString"     (BYVAL errCode AS DWORD) AS LONG
    DECLARE FUNCTION glGetError     LIB "opengl32.dll" ALIAS "glGetError"        () AS DWORD
    
    function CheckForGLError() as long
    
     dim errorCode as long
     dim errorDescription as long
     
     errorCode = glGetError()
     
     IF errorCode <> %GL_NO_ERROR THEN
      errorDescription = gluErrorString(errorCode)
       MSGBOX hWnd, "Error description: "+peek$(errorDescription, 255), %MB_OK or %MB_ICONERROR, "TBGL Error"
       function = 1
     else
       function = 0  
     eND IF
     
    end function
    
    ... just call this function to detect if some problem occured, now it also returns full error description.


    Petr

    P.S. It is quite funny that this function returns in case of error for example "operazione non valida" although I have Czech OpenGL drivers and localized operating system !
    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. HTML 5 Demos
    By kryton9 in forum Shout Box Area
    Replies: 3
    Last Post: 29-05-2009, 02:04

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
  •