pouët.net

Go to bottom

using SDL as graphics lib

category: code [glöplog]
Is this a good thing to make demos with?
added on the 2013-06-06 10:27:41 by zorke zorke
uses opengl doesn't it?

i'm using opengl for my own reasons, but whether its 'good' is a subjective to your needs.
added on the 2013-06-06 10:30:44 by Canopy Canopy
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 :-)
added on the 2013-06-06 10:34:20 by Jcl Jcl
It's good for what it is.
added on the 2013-06-06 10:34:51 by Preacher Preacher
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.
added on the 2013-06-06 11:24:27 by Marq Marq
it is quite nice for 4k intros on linux, as you can expect it to be already installed.
added on the 2013-06-06 11:25:47 by provod provod
well... are there any recommendations for drawing libraries ?
added on the 2013-06-06 12:58:22 by zorke zorke
DirectX. OpenGL, if you're going with SDL.
added on the 2013-06-06 13:00:20 by Preacher Preacher
And, if you're going with SDL, OpenGL makes more sense than DirectX.
Just for the cross-platform factor.
added on the 2013-06-06 13:05:45 by ham ham
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$).
added on the 2013-06-06 13:05:49 by Canopy Canopy
@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.
added on the 2013-06-06 13:08:05 by zorke zorke
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.
added on the 2013-06-06 13:16:20 by ham ham
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.
added on the 2013-06-06 13:23:42 by ham ham
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?

added on the 2013-06-06 13:28:31 by zorke zorke
Yes.
added on the 2013-06-06 14:05:56 by ham ham
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.
added on the 2013-06-06 15:15:00 by flure flure
whatever makes you feel comfortable and makes you have fun while programming that's the way to go ;)
added on the 2013-06-06 16:18:38 by Defiance Defiance
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.
added on the 2013-06-06 16:37:15 by Optimus Optimus
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.
added on the 2013-06-06 16:39:06 by Canopy Canopy
(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)
added on the 2013-06-06 16:40:36 by Canopy Canopy
You can also try GLFW.
Looks more convenient for demoscene stuff.
added on the 2013-06-06 17:06:31 by ham ham
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.
added on the 2013-06-06 17:57:38 by xeron xeron
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.
added on the 2013-06-07 12:17:45 by raer raer
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?
added on the 2013-06-13 02:49:05 by zorke zorke

login

Go to top