Recent

Author Topic: Trying my hand at a 2d game  (Read 1555 times)

flowCRANE

  • Hero Member
  • *****
  • Posts: 927
Re: Trying my hand at a 2d game
« Reply #15 on: March 08, 2025, 04:38:32 pm »
And that's why I don't recommend these types of libraries since they lack the functionality required for game development.

So what if this PTC supports OpenGL, if you have to manually use the OpenGL API to be able to render with hardware acceleration? This API is large and requires a lot of knowledge about graphics, and it cannot be easily changed to another one if you want to use a different backend (e.g. Direct3D or Vulkan).

This is where multimedia libraries like SDL3, raylib, SFML or Allegro have an advantage.

In the case of SDL3, the renderer constructor can automatically select the backend, but it also gives you the option to specify which one to use (OpenGL, Direct3D, Metal, Vulkan etc.). You write the rendering code once (with functions from the 2D renderer API or GPU device API), and if you want to change the backend to another, you just have to provide a different literal in the function creating the renderer and that's it (and everything is cross-platform). SDL3 even has a universal shader layer to make shaders easier to use (with GPU device API) and which provide unlimited possibilities, e.g. for applying various image filters like this imitating a CRT screen.
Lazarus 4.0 with FPC 3.2.2, Windows 10 — all 64-bit

Working solo on a retro-style action/adventure game (pixel art), programming the engine from scratch, using Free Pascal and SDL3.

Seenkao

  • Hero Member
  • *****
  • Posts: 711
    • New ZenGL.
Re: Trying my hand at a 2d game
« Reply #16 on: March 08, 2025, 07:25:49 pm »
So what if this PTC supports OpenGL, if you have to manually use the OpenGL API to be able to render with hardware acceleration? This API is large and requires a lot of knowledge about graphics, and it cannot be easily changed to another one if you want to use a different backend (e.g. Direct3D or Vulkan).

С небольшим уточнением:
- Это зависит от пользователя, вполне возможно он решил использовать именно API OpenGL.
- Для 2/2.5D графики это не важно, потому что OpenGL - автоматически кроссплатформенен (при правильном подходе).

Ну и так же важна функциональность дополнительная, которая не относится ни к графике, ни к музыке и упрощает разработку программы (работа с ресурсами, загрузка ресурсов, работа с архивами и прочее). Про что-то вы уже писали (например джойсткики).


------------------------------------
Google translate:
With a small clarification:
- It depends on the user, it is quite possible that he decided to use the OpenGL API.
- For 2/2.5D graphics, this is not important, because OpenGL is automatically cross-platform (with the right approach).

And also important is the additional functionality that does not relate to graphics or music and simplifies program development (working with resources, loading resources, working with archives, etc.). You have already written about something (for example, joysticks).
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

 

TinyPortal © 2005-2018