-
2 Attachment(s)
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
Attachment 195797
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).
https://youtu.be/mQIrVVEYHgM
Have a nice day.
-
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.
-
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.
-
Re: Open Gl Example
Final code for the class as I use it in M2000 Interpretrer. See the video for the program:
https://youtu.be/ilX8E9CvXnE
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