Results 1 to 5 of 5

Thread: Can oxygen "alias" TB-Functions from other modules?

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174

    Can oxygen "alias" TB-Functions from other modules?

    To explain this it needs a little information:
    Some may remember I made some 3d-editor to draw 3d-stuff. This stuff has to be saved somehow in a format so it can be loaded as fast as even possible - so save can take its time but loading has to be fast.
    Now the TBGL-Entities don't have native methods except loading m15 to get filled with data from file. m15-format does not support materials so I won't stick to them.
    The creating of a display-list in TBGL works through passing single values in a certain order and not just through a pointer to the loaded binary data. It looks similar to this:
    TBGL_NewList xyz
      TBGL_BeginPoly %GL_TRIANGLES
        TBGL_Color  255, 255, 255
        TBGL_TexCoord2D 0.000000, 0.000000
        TBGL_Normal 0.000000, 1.000000, 0.000000
        TBGL_Vertex -4.250000, 4.250000, -0.200000
    '...
        TBGL_TexCoord2D 1.000000, 0.000000
      TBGL_EndPoly
    TBGL_EndList
    
    so its always a keyword (tbgl-function) followed by comma delimited numbers, how to deal with the variable xyz we know already

    My idea was to save the (3d-)data in the way it can be processed as fastest as possible from file - or string- without any further converting numbers nor looping through a bunch of data to sort them in - straightforward as one would type it in. And since oxygen can process stuff from string on the fly I wonder if there were a possibility that oxygen can call TB(GL)-Keywords and -functions - even if it means to save the keywords in the data prefixed in every line with somewhat like "send_to" or to list/declare all needed/used functions in advance before processing the data to install "the right connections"

    I could imagine that would work only on non-core-functions - so maybe just on modules that are included through "uses". In doubt O2 should surely use its own functions if names are identical - or there could be a switch... So would be possible to use "Console_PrintL" or "File_Load" through oxygen-functions - and even TBGL_...

    But in reality looks more like one had to declare all those needed functions from within oxygen at the current TB-pointer of the function inside TBGL-module for example...and since I have not found any method yet to get the function-pointers of a by tB loaded .dll I have no idea if it makes sense to think further into this direction.

    So the final question: Could oxygen - i think in tB it's within the same process - use the functions of another currently loaded tB-module and how
    - anyone ideas to this?
    I think there are missing some Forum-sections as beta-testing and support

  2. #2
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    Its not about this user-defined functions but those within some currently present .dll. Maybe call them methods or procedures or whatever - but if oxygen would know where they are to find it could call them - couldn't it? It just had to identify them once but thinCore.dll only delivers user-defined-script-functions but none of other loaded modules, I fear. And above those script-functions I have no idea what's going on nor how it works.
    I think there are missing some Forum-sections as beta-testing and support

  3. #3
    Hi Rene,

    I know of no method of calling another module's functions directly. However, it is possible to perform Opengl functions directly from Oxygen, cooperatively with TBGL. One such example can be found in the new thinBasicOxygen zip: examples/graphical/psva10.o2bas

    The flame particles are rendered directly from an Oxygen function, while TBGL provides the particle data.And conversely, the bellows is rendered by TBGL while the bellows geometry is dynamically controlled by Oxygen, sharing a vertex array buffer.

    Oxygen can also share the opengl header files with TBGL.

    Charles

  4. #4
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    55
    Posts
    1,554
    Rep Power
    174
    I thought there might be some way similar to Declare Set Address/At or a way to retrieve where tB has put these functions. But I am to new to oxygen to start it with this kind of stuff
    I think there are missing some Forum-sections as beta-testing and support

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736
    This could be the way - TBGL_NewList/TBGL_EndList called on TBGL side, and between these two call glBeginPoly, glColor, glVertex from compiled Oxy file.
    Keep the high level goodies of TBGL, such as entity system not found in original OpenGL and the geodef with Oxygen. Why not


    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

Similar Threads

  1. Idea about "pseudo-variable" target functions
    By Robert Hodge in forum Suggestions/Ideas discussions
    Replies: 11
    Last Post: 19-07-2013, 16:45
  2. Forum: added "Auto Youtube Link-Converter" plugin
    By ErosOlmi in forum Web and Forum
    Replies: 0
    Last Post: 07-05-2011, 12:47
  3. Replies: 17
    Last Post: 21-02-2010, 07:45
  4. Uses "File", "Crypto" ... ???
    By marcuslee in forum thinBasic General
    Replies: 3
    Last Post: 01-12-2009, 19:38

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
  •