Jump to content
Sign in to follow this  
matwachich

[..] Multithreading with GLFW

Recommended Posts

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!!! :oops:

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

Thanks for answering!

Share this post


Link to post
Share on other sites
ProgAndy

You can get the functions to work but if you use them with a DLLCallback, AutoIt will crash since the interpreter is not threadsafe. The limitations are the same when using the Windows Thread API directly. GLFW only introduces another level of abstraction for OS independence (same function for Win, Linux, ...)


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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

    • UEZ
      By UEZ
      Here some graphical examples written completely in FreeBasic just for fun.  
      3D Starfield Rotating Flight 3D Starfield Scrolling v1 Booster 3D Starfield Scrolling v3 Booster CreateWindowEx (hGUI) Example FB File2Bas Code Generator (AutoIt script) FB GFX Examples Fire Particles FMOD Examples 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+ Space Flight GDI - GDI+ Tunnel Flight - WipeOut Style GDI Classic Raytraced Tunnel GDI Elastic Twister Effect GDI Exploding Pixels GDI Infinite Image Zoom Flight GDI Liquid Pixels GDI Particle Repulsion Grid GDI Particles Mouse Attraction GDI Starfield GDI The Nautilus Raymarcher GDI Worm Tunnel Flight GDI+ Impossible Possible GDI+ Kaleidoscope GDI+ Performance Test - Au3 vs FB GDI+ Polar Clock GDI+ Rotating Earth GDI+ Star Wars Scroller GDI+ Streamer GDI+ Swiss Railway Clock Ini Read - Write Mandelbrot Plasma Puristic Clock Rutt_Etra_Izer_Booster Tunnel Flight uFMOD _WinAPI_SetWindowTitleIcon  
      Download: FreeBasic Examples build 2018-07-10.rar
       
      I will add new examples from time to time.
       
      FreeBasic source codes are also included.
       
    • 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.
    • 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 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
×