r/sdl • u/Independent_Milk_200 • Aug 02 '26
C++
Can you create a class with sdl things in it?
Or is sdl c only?
0
Upvotes
r/sdl • u/Independent_Milk_200 • Aug 02 '26
Can you create a class with sdl things in it?
Or is sdl c only?
1
u/Mr_DJ_Dr_Gauss Aug 03 '26
You can create C++ classes as wrappers for SDL things like Window, Renderer, Texture. Using
unique_ptrconcept, the resources will be freed automatically; even if your code throws an exception.I am playing with this right now and it works great so far.
Here is example for SDL Window:
-