Recent

Author Topic: SDL2 Components  (Read 5807 times)

Imants

  • Full Member
  • ***
  • Posts: 198
SDL2 Components
« on: February 10, 2016, 12:43:41 pm »
I extended my SDL2 dynamically loading library with component support for easier use :).

I created these components:
 
  • TSDLLibraryProvider - binds SDL2 library to components
  • TSDLOpenGLExtensions - loads OpenGL extensions to use in project
  • TSDLRenderer - renders OpenGL scene in SDL window
  • TSDLCamera - sets rendering scene view
  • TSDLThread - Replacement for TThread works pretty good in windows not so good in Linux + LCL application (without forms in serwers works good)
  • TSDLWokerControl- For now use for loading OpenGL textures in background
  • TSDLAtomicLock - Sync object use with SDL threads
  • TSDLMutex - Sync object use with SDL threads 
  • TSDLSemaphore - Sync object use with SDL threads 


Some of these components like threads work bugy in form projects in Linux.
There are examples in example folder to easier understand how all works.

Direct download:
http://files.inbox.lv/ticket/e6ca16eb701a29493d4c1e371ecfb2d86e2bdcb4/sdl2-1.2.0.zip
http://files.inbox.lv/ticket/6f763941a0cd47336d35e7742755e4d21e0618c8/sdl2-1.2.0.tgz

Source:
https://xp-dev.com/svn/sdl2.lib/branches/sdl2-1.2

SDL library you can download here
SDL2.dll - https://www.libsdl.org/download-2.0.php
SDL_Image.dll - https://www.libsdl.org/projects/SDL_image

All libraries must be present at run-time or there will be errors in example code. Example compiles executable file in bin folder and that is place where all dll-s should be located in windows
« Last Edit: February 10, 2016, 12:51:18 pm by Imants »

Handoko

  • Hero Member
  • *****
  • Posts: 5544
  • My goal: build my own game engine using Lazarus
Re: SDL2 Components
« Reply #1 on: July 20, 2016, 05:58:56 am »
It's great. SDL is a good graphics library, I wonder why it is not appear on Lazarus' component list in the default installation.

You mention 'dynamically loading', is it possible to make it static linking? I hear we are allowed to statically link SDL library except version 1.2 or below. I'm looking for SDL static link components.

Sorry to bring up this old thread.

Mathias

  • Full Member
  • ***
  • Posts: 101
Re: SDL2 Components
« Reply #2 on: December 13, 2023, 08:56:21 am »

cpicanco

  • Hero Member
  • *****
  • Posts: 674
  • Behavioral Scientist and Programmer
    • Portfolio
Re: SDL2 Components
« Reply #3 on: December 15, 2023, 12:47:51 am »
I am working with SDL2 too (https://github.com/cpicanco/stimulus-control-sdl2/). I am strugling to find a was to record the screen in real time. The best I could do was to write some code for screenshots. I also failed to implement it with av/ffmpeg (I could not find complete bindings for real time recording). May I ask if your work could help me?
Be mindful and excellent with each other.
https://github.com/cpicanco/

 

TinyPortal © 2005-2018