Results 1 to 4 of 4

Thread: tbgl_createWindowEx vs USES "tbgl"

  1. #1

    Question tbgl_createWindowEx vs USES "tbgl"

    keywords like tbgl_UseTexturing and tbgl_UseAlphaTest are not effective right after USES "tbgl".
    They began to be taken into account only after tbgl_createWindowEx.
    • Is there a reason why we could not 'prepare' settings , then create the view ?
    • Suppose we destroy the window and recreate one another, are all settings lost ?
    ThinBasic ALPHA - Windows 8.1 x64

  2. #2
    Hi DirectuX, this reminds me of the Petr advice "you must perform the Declare Set Address once you have active OpenGL context, that is, after TBGL_CreateWindowEx"
    whatever the OpenGL context means , it seems specific to opengl. in contrast the constant Pi is ready when we say Uses "Math" but not opengl.
    if you don't have there is a collection of nice programs here to test opengl:
    just remove the zzz so not to make a hot linking
    a nice alpha test is in example TGA_masking inside the first BonusPack

  3. #3
    Hi Primo,

    thanks for the answer. Thanks for the bonus packs, I knew them already from this website's upper menu
    I would understand your answer about opengl if we where dealing directly with opengl, but since we use a wrapper, and a fortiori here, since we have only one opengl instance/context, I thought it could handle settings internally then apply them when needed; like we can do when programming udt way. Note that tbgl_UseTexturing and tbgl_UseAlphaTest are just switches, they do not perform any action. In that, they could be set at any time.
    ThinBasic ALPHA - Windows 8.1 x64

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Brno - Czech Republic
    Blog Entries
    Rep Power
    Hi Sebastian,

    all the states modified by TBGL_Use* function are bound to underlying active OpenGL context.

    This is why they are valid only between window creation and destruction.

    I kind of prefer the fact TBGL_CreateWindowEx gets you to some standard state.

    State management is one of my most disliked aspects of OpenGL, this is why I came up with TBGL_PushState/TBGL_PopState as first reaction to it, but I would like to think about something even better, as even this alternative approach is not very good. No ETA, as I am currently overloaded at work.

    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. Replies: 9
    Last Post: 12-03-2016, 04:32
  2. questions "shoot example" (tbgl)
    By Lionheart008 in forum TBGL module by Petr Schreiber
    Replies: 4
    Last Post: 16-06-2012, 11:20
  3. Forum: added "Auto Youtube Link-Converter" plugin
    By ErosOlmi in forum Web and Forum
    Replies: 0
    Last Post: 07-05-2011, 12:47
  4. Uses "File", "Crypto" ... ???
    By marcuslee in forum thinBasic General
    Replies: 3
    Last Post: 01-12-2009, 19:38

Tags for this Thread

Posting Permissions

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