looking for sdl2 template to init off screen buffer and some sprites lazarus / 39-Graphics ---------------------------------------------------------------------- RickD · 2017-08-05 14:29 Hi all, I just downloaded sdl 2 and after some experimenting i got the example (http://www.freepascal-meets-sdl.net/chapter-4-imagestextures/) that loads a bmp and puts it on screen to work (using sdl2.dll and sdl2_image.dll).  So far so good. But now i want to create the basic template setup for a game in sdl2. Which is initialise a full screen windows, create an offline buffer, load a sprite sheet, wipe and blit some sprites to the offline buffer, copy the offline bufffer to the screen buffer (accelerated and synced on the retrace), and the close all. If possible i want to do this with only sdl2.dll (no sdl2_image, etc). Before i reinvent the wheel, does anyone have (or knows where to find) some basic freepascal sample code to do this? Most stuff on the sdl site is in c++, but i'm sure someone already made this work in freepascal. Many thanks for any help on this! Regards, Rick ---------------------------------------------------------------------- Carver413 · 2017-08-05 14:59 Bare game uses sdl2 http://www.baregame.org/ ---------------------------------------------------------------------- Handoko · 2017-08-05 16:30 Bare Game was the game engine I was waiting for. Unfortunately it seems the progress halted because they focus on GetLazarus initiative, which also has no much activities since early 2016. @RickD I do not use SDL, but I wonder why you want to use only sdl2.dll but not sdl2_image. In theory, it is possible but you will lost many advantages sdl2 offers. You will deal with different image file types with various pixel formats, also the code compatibility issues on different platforms. ---------------------------------------------------------------------- RickD · 2017-08-06 08:10 Quote from: Handoko on August 05, 2017, 06:30:24 pmBare Game was the game engine I was waiting for. Unfortunately it seems the progress halted because they focus on GetLazarus initiative, which also has no much activities since early 2016. @RickD I do not use SDL, but I wonder why you want to use only sdl2.dll but not sdl2_image. In theory, it is possible but you will lost many advantages sdl2 offers. You will deal with different image file types with various pixel formats, also the code compatibility issues on different platforms. I try to only use sdl2 to keep the project clean, fast and portable to other platforms. But any ideas on alternatives that may be faster or better then sdl2 are welcome, and i may give them a test run. At this moment i have the basic game framework working in only sdl2. A fullscreen window which shows some sprite animation synced on the vretrace. The next step is to scale the sprites pixelperfect and figure out the alpha channel. Which based on the documentation should not be a big problem. One big obstacle i haven't been able to figure out is how to measure the amount of vretrace time that is used to "draw" the screen. Anybody knows a smart hack to do this? Back in the days with 256 color modes i used to change the background color pallete after drawing the screen to see at which hsync line it ended. Any ideas on this are most welcome! Regards, Rick