Jump to content
Sign in to follow this  
matwachich

[UDF] OpenGL, GLFW and SOIL

Recommended Posts

matwachich

Hi everybody!

Today, is for me the culmination of a long quest: to be able to load and display an OpenGL texture

And I'ts finally done! (PS: Thanks to my recent learning of the Python language, and the fact that I came back to C/C++)

In the archive:

- A wrapper for OpenGL and GLU (almost all basic functions are written and tested)

- A wrapper for GLFW (All functions that are needed are written, and the others (timer,threading, image loading) we don't really need them, either because they are implemented natively in AutoIt (Timers), or because they are more effective in: SOIL)

- A wrapper for SOIL (Simple OpenGL Image Library): Most functions are translated (for the others, I will wait my skils to grow a little!) This is the library that allowed me to achieve my quest (loading textures)!

- And some examples!

I hope you enjoy it!

PS: the functions used in the examples work fine, others were not tested, if you find bugs, you know where to find me!

PS: it is necessary to know at least the basics of OpenGL to understand what happens in the examples!

PS: I included the documentation of GLFW (pdf)

Important: In order to the examples to work, you must place the dlls (soil.dll, glfw.dll) in the examples folder, or in c:WindowsSystem32

Important 2: The dlls are x86, don't expect them to work on x64

DOWNLOAD

Edited by matwachich

Share this post


Link to post
Share on other sites
Kealper

Hmm... I was unable to get it to work properly :oops:

It would start and exit instantly, printing some debug info in the console about frame rate and such, so I assume it was failing to start up OpenGL stuff. I'm using Windows 7 x64, but I tried running the examples as both x86 and x64, same result.


Share this post


Link to post
Share on other sites
FireFox

Same for me :/

Running with Windows XP SP3

Times (in ms):
Average _glClear time: 0
Average Draws time: 0
Average _glfwSwapBuffers time: 0
Average FPS: 0

Br, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
matwachich

Did you placed the dlls in the example folder??? or in the System32 folder?

And, about x64, the dlls are x86, so x64 wont work.

Ciao

Share this post


Link to post
Share on other sites
Kealper

Ahh, didn't see the DLLs when I was just quickly giving it a try, after moving the two DLLs into the examples folder and running the examples as x86 it worked great!

Nice job, the examples are very responsive!


Share this post


Link to post
Share on other sites
FireFox

Did you placed the dlls in the example folder??? or in the System32 folder?

Was I supposed to know it?

Btw, it works. Nice Job.

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • seangriffin
      By seangriffin
      Here's the beginnings of SFML (the Simple and Fast Multimedia Library) for AutoIT. 
      This library provides a wealth of features for developing games and multimedia applications.  You can read up more about SFML here -> http://www.sfml-dev.org.  It uses OpenGL as the renderer for 2D graphics such as sprites, so it's performance is quite good.
      Currently my interest is in 2D sprite engines, so my focus is on the sprite and window APIs.  This is the precursor to another separate UDF I'm working on and will release soon.  If there's any interest I'll flesh out more of this API for the community.
      CSFML is the "C" binding / API for SFML, and it's this API that I'm building this UDF against.
      REQUIREMENTS:
      AutoIt3 3.2 or higher LIST OF FUNCTIONS (so far):
      _CSFML_Startup _CSFML_Shutdown _CSFML_sfClock_create _CSFML_sfClock_getElapsedTime _CSFML_sfClock_restart _CSFML_sfVector2f_Constructor _CSFML_sfVector2f_Update _CSFML_sfVector2f_Move _CSFML_sfColor_Constructor _CSFML_sfColor_fromRGB _CSFML_sfSizeEvent_Constructor _CSFML_sfEvent_Constructor _CSFML_sfVideoMode_Constructor _CSFML_sfRenderWindow_create _CSFML_sfRenderWindow_setVerticalSyncEnabled _CSFML_sfRenderWindow_isOpen _CSFML_sfRenderWindow_pollEvent _CSFML_sfRenderWindow_clear _CSFML_sfRenderWindow_drawText _CSFML_sfRenderWindow_drawSprite _CSFML_sfRenderWindow_display _CSFML_sfRenderWindow_close _CSFML_sfTexture_createFromFile _CSFML_sfSprite_create _CSFML_sfSprite_destroy _CSFML_sfSprite_setTexture _CSFML_sfSprite_setPosition _CSFML_sfSprite_setRotation _CSFML_sfSprite_rotate _CSFML_sfSprite_setOrigin _CSFML_sfFont_createFromFile _CSFML_sfText_create _CSFML_sfText_setString _CSFML_sfText_setFont _CSFML_sfText_setCharacterSize _CSFML_sfText_setFillColor EXAMPLE:
      Currently I only have one example, which is the "Short example" described in the CSFML API documentation, plus some extra features.  Essentially a window (GUI) allowing you to move a sprite around with the keyboard (including rotation).
      DOWNLOAD:
      You can download this UDF, including the example and associated files, from the following GitHub page:
      https://github.com/seanhaydongriffin/CSFML-UDF
      Cheers,
      Sean.
    • UEZ
      By UEZ
      Here some graphical examples written completely in FreeBasic just for fun.  
      3D Starfield Scrolling v1 Booster 3D Starfield Scrolling v3 Booster GDI - GDI+ 3D Sinus Wave GDI - GDI+ Animated Pythagoras Tree GDI - GDI+ Particles - Repulsive Force Sim v2.0 GDI - GDI+ Plasma v5 Booster GDI - GDI+ Random Pattern GDI - GDI+ Tunnel Flight - WipeOut Style GDI Classic Raytraced Tunnel GDI Elastic Twister Effect GDI Exploding Pixels GDI Liquid Pixels GDI Particle Repulsion Grid GDI Particles Mouse Attraction GDI Starfield GDI The Nautilus Raymarcher GDI+ Performance Test - Au3 vs FB Mandelbrot Rutt_Etra_Izer_Booster  
      Download: FreeBasic Examples build 2017-01-22.7z
      I will add new examples from time to time.
       
      FreeBasic source codes are also included.
       
    • WesleyThomas
      By WesleyThomas
      Since struggling with writing some OpenGL stuff in autoit due to the fact of me being newish to the whole programming game and the fact that I really don't have a clue on how to write or use plugins, I thought I would share some of my code I have made that demonstrates using OpenGL with purely autoit and dll calls directly with opengl32 and glu32. I have made a start writing a GLConstants.au3 and GLFunctions.au3 files that I think should be a standard library by now in the Autoit Include folder. Any feedback would be nice

      Right clicking on the GUI moves the Camera around (while holding), w and s moves forward/backward and a and d spins left and right. Enjoy
      GLConstants.au3
      GLFunctions.au3
      3D Viewport.au3
    • Beomagi
      By Beomagi
      Minecraft is a game, where the objective is to mine blocks of a voxel based landscape and place them as you wish to construct what you wish within the confines of said voxel based patterns.
      Minor enemies come out at night, but there's no big boss, no real drive other than mining or building.

      So what happens if you're constructing something geometrically complex?

      There's an online flash based tool for this purpose (not by me) - http://www.plotz.co.uk/plotz.php


      Now, I liked this tool and wanted to make enhancements for my own purposes - what if I wanted intersecting spheres? what if I want spheres to act as erasers to voxels placed by another?

      Of course the sky is the limit with ideas like this, so I decided to start putting it into action instead of just wondering. Using libraries made by trancexx

      Same as attached (mirror)
      http://beomagi.dyndns.org/picture_net/techzamples/voxelEQ.zip

      The idea is I want to specify multiple spheres, some are inclusion "brushes" some are erasers, and eventually add parameters for skew, compression etc. perhaps other shapes too.

      Modify the entries in voxelEQ.txt to specify where to draw spheres and how large using simple coordinate system.

      ;s draw a sphere ;i include voxels from sphere ;e exclude these voxels ;s,i/e, x, y, z, radius s,i,0,0,-4,10 s,i,0,0,4,10 s,i,0,0,0,10 s,i,0,0,-8,8 s,i,0,0,8,8 s,e,0,2,-4,9 s,e,0,2,4,9 s,e,0,2,0,9 s,e,0,2,-8,6.5 s,e,0,2,8,6.5 s,e,0,20,0,23
      Run VoxelEQ.exe/au3. This brings up the primary plotting tool, which shows how to build the shape in minecraft from bottom up. Either click plot ot start changing the "Y" level in the up-down box to start plotting.



      click on the 3d opengl button and it will simple open voxelEQ_GL.exe.

      Mouse button 1 - rotate about x/y axis
      Mouse button 2 - rotate about x/z axis
      Mouse button 1+2 - reset orientation

      Possible enhancements -
      Editor for the voxelEQ.txt File selector for data file Color option for voxelEQ.txt Other shapes.. voxelEQ.zip
    • matwachich
      By matwachich
      Hi every body!

      I have a small questions to the C pros befor I go making something long and boring:

      I am creating a wrapper to GLFW, all OpenGL related stuff works well (creating a window, loading textures...), so it's good for this (PS: i'm gonna post it when i'm done)

      But, GLFW has some multithreading functions (see the doc) and i just wanna know il AutoIt will be capable of getting these functions to work? I mean, introducing Multithreading to AutoIt!!!

      I wanna know this befor making the wrappers, and find my self lost precious time!

      Thanks for answering!
×