using SDL as graphics lib
category: code [glöplog]
Is this a good thing to make demos with?
uses opengl doesn't it?
i'm using opengl for my own reasons, but whether its 'good' is a subjective to your needs.
i'm using opengl for my own reasons, but whether its 'good' is a subjective to your needs.
IMHO, unless you are aimimng for cross-platform, it doesn't really give anything of extreme importance to making demos...
... then again, everything goes for demos: whatever makes you feel comfortable and have fun while making demos, will be just fine :-)
... then again, everything goes for demos: whatever makes you feel comfortable and have fun while making demos, will be just fine :-)
It's good for what it is.
The good: easy to use, cross-platform. The bad: yet another extra lib. Personally, I tend to do multi-platform stuff, so I've been quite happy with it - things such as opening a fullscreen window or setting the resolution properly are tricky to get right without a lot of uninteresting digging into technical documentation. It's not a silver bullet, though, since implementations for less common devices are often slow or somehow broken.
it is quite nice for 4k intros on linux, as you can expect it to be already installed.
well... are there any recommendations for drawing libraries ?
DirectX. OpenGL, if you're going with SDL.
And, if you're going with SDL, OpenGL makes more sense than DirectX.
Just for the cross-platform factor.
Just for the cross-platform factor.
What are your needs, what language do you use, and what platform are you on? You have given very little to go on.
For example, like Jcl said (and my reason) for using OpenGL is to aid portability.
I know if I were doing specific things i'd be better off (implementation time wise) with other APIs or libraries. For example, many years ago I used DirectDraw as it gave framebuffer type access under Windows. If I were to code the same stuff again today it'd still be faster to do it with that, but as I'm using many other features of OpenGL and want cross platform then i'm accepting that 'hit' and using OpenGLs frame buffer objects.
From what I've heard, DirectX has better documentation, and less pitfalls (outside being tied to M$).
For example, like Jcl said (and my reason) for using OpenGL is to aid portability.
I know if I were doing specific things i'd be better off (implementation time wise) with other APIs or libraries. For example, many years ago I used DirectDraw as it gave framebuffer type access under Windows. If I were to code the same stuff again today it'd still be faster to do it with that, but as I'm using many other features of OpenGL and want cross platform then i'm accepting that 'hit' and using OpenGLs frame buffer objects.
From what I've heard, DirectX has better documentation, and less pitfalls (outside being tied to M$).
@canopy : i can do C/C++. I think SDL can be static library too.
OpenGL can work with SDL, and yes, i'd rather go for OGL.
OpenGL can work with SDL, and yes, i'd rather go for OGL.
Also, take in count that some SDL implementations, as Mark pointed before, are buggy and quite slow.
If you really wanna use SDL for demos, try to use it only as a framework.
If you really wanna use SDL for demos, try to use it only as a framework.
Quote:
I think SDL can be static library too.
Yes, it can be. However, it's bloated with lot of stuff (unless you modify the library) and maybe subject (except SDL 2.0, IIRC) to a GPL-license that could affect your code if you link statically.
By the way, never use the mikmod library (mod player included in SDL) cause is not very good.
ok, @ham, by "framework" do you mean using it as an interface between prog and hardware? like getting a handle to buffer and manually blitting bits?
Yes.
that's totally not the definition of a framework
Definitely not the definition of a framework, but definitely the way to use SDL for making demos...
SDL is useful only to easily create a window and have a framebuffer or an OpenGL context regardless of running on Windows, Linux or whatever.
SDL is useful only to easily create a window and have a framebuffer or an OpenGL context regardless of running on Windows, Linux or whatever.
whatever makes you feel comfortable and makes you have fun while programming that's the way to go ;)
I like it maybe since I've used it for years and don't know much alternatives. Easy to open window, software rendering buffer and keyboard controls and more. There is also the OpenGL window, sometimes I done with this, sometimes I use glut. Also if you code for open handhelds, like gamepark, dingoo and the new coming gcw0, SDL is always there and very easy to port stuff.
Slightly OT..
^ which makes me wonder.. outside the frame buffer stuff... GLUT used to provide the rest.. (windowing stuff)
The OpenGL people are going this way with their EGL cross platform windowing stuff aren't they. I've seen rumours that it'll be supported for desktop GL in future too.
Personally i'm a sadist and am rolling my own windowing etc, but I guess I'm old school and used to programming at Win32 (& Driver) level as thats a huge chunk of my day job.
^ which makes me wonder.. outside the frame buffer stuff... GLUT used to provide the rest.. (windowing stuff)
The OpenGL people are going this way with their EGL cross platform windowing stuff aren't they. I've seen rumours that it'll be supported for desktop GL in future too.
Personally i'm a sadist and am rolling my own windowing etc, but I guess I'm old school and used to programming at Win32 (& Driver) level as thats a huge chunk of my day job.
(just to maintain a sense of context - my original reply was intended to be to flure.. so i wasn't repeating what "bugo the cat" said)
You can also try GLFW.
Looks more convenient for demoscene stuff.
Looks more convenient for demoscene stuff.
If you write a demo for SDL/OpenGL and release the sources, you'll probably find it end up ported to AmigaOS, MorphOS, Syllable, and all kinds of weird platforms. Which is nice.
GLUT is the worse piece of shit in the universe. I'd rather roll my own windowing and menu system than using that contraption...
SDL is better and available on many system, some even have it preinstalled.
SDL is better and available on many system, some even have it preinstalled.
and also,I have some concerns as to how SDL will work at high resolutions like 1080x1920, since when I was using DIB sections to make demos, anything above 1024x768 would be jerky since the cpu wouldn't be able to keep up... so hopefully SDL has 2d acceleration and that wont happen?