Results 1 to 4 of 4

Thread: Open Gl Example

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,309

    Open Gl Example

    I do this project using ChatGPT 4.5

    The task was a rotating cube using OpenGl, using a class wrapper. We can display text (latin and greek). We have to build series of glyphs (this is work of A.I.). Also we put a background image (was bmp, I change it to jpg). My only code is the way we get the array bytes() from the original bytes of picture. The ChatGPT made a loop using point() and divisions to get the RGB values. So that was not good. My goal is to put the class to M2000 Interpreter so i want to use twips from user scope. But I will continue the training of ChatGPT (everything we made with A.I. happen to be training for A.I.)

    Code:
    If BuildFontRange(mLatin, &H20, &H5F, 0.2!) = False Then Exit Function
    If BuildFontRange(mGreek, &H370, &H90, 0.2!) = False Then Exit Function
    Name:  3dcube.jpg
Views: 437
Size:  40.8 KB




    Because there are some Greek letters (for text to display)...please for one time change the language of font used in IDE to Greek.

    This is a preview of using Open GL on M2000 Interpreter (which is written using VB6, so it is a VB6 program - not compiling in TwinBasic yet).



    Have a nice day.
    Attached Files Attached Files
    Last edited by georgekar; Mar 17th, 2026 at 03:55 PM.

  2. #2
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,653

    Re: Open Gl Example

    Zip is missing the Form.

    Funny, AI generated the exact same cube for my demo a while back: https://github.com/fafalone/OpenGLDemos

    Someone called NeHe posted a lot of VB6 OpenGL demos back in the day, and a typelib with basic APIs.

    You might also want to check out VBGL. It's VBA based but easy enough to move to VB6 (though I'm not sure if the hacks for calling by pointer need to be modified). It has extensive declares for OpenGL through 4.6 and ARB/EXT functions, and lots of class wrappers.

    Then of course if you're able to work in twinBASIC my API package has even more complete defs (including vendor-specific APIs for AMD, NVIDIA, and Intel), and uses a special class that automatically initializes every function called by pointer from wglGetProcAddress the first time you call any of them. Though note that unlike most of WinDevLib, the OpenGL section can't be trivially converted to VB6. It uses delegates for calling by pointer, uses aliases to preserve the original types like NeHe's VB6 typelib, and a class marked as AppObject.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,309

    Re: Open Gl Example

    File now updated.
    This example has the background image and the text inside (without flickering). I want this for a long time and A.I. found a solution. I am using A.I. paid from a company.
    I think the A.I. need us to instruct it and we need it to work for us.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,309

    Re: Open Gl Example

    Final code for the class as I use it in M2000 Interpretrer. See the video for the program:




    This is the class in Github
    https://github.com/M2000Interpreter/...in/cOpenGL.cls

    This is the code in M2000 for the example.
    https://georgekarras.blogspot.com/20...2000-form.html

Posting Permissions

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



Click Here to Expand Forum to Full Width