Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choosing an appropriate drawing backend for SDL #2

Open
Axure opened this issue Sep 9, 2016 · 1 comment
Open

Choosing an appropriate drawing backend for SDL #2

Axure opened this issue Sep 9, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@Axure
Copy link
Member

Axure commented Sep 9, 2016

I am having a hard time choosing the method of drawing/painting in the SDL version. Unlike GDI or QPaint, SDL does not have native methods for drawing ellipses or more complex objects. The only available shapes are points, lines and rectangles.

Now I have two choices, write them myself or using an existing library. The most tested library seems "SDL2_gfx", and I am now using it on the master branch. Unfortunately, the original repo is in SVN, so I have to migrate it from SourceForge to GitHub myself (Axure/SDL2_gfx). Moreover, the names of some functions (fortunately, private, undocumented ones) clashes with some thoses of some API functions in ACLlib, so I have to modify the names. The good news is that these are all done, and I have got a simple example working, to some extent.

But SDL can actually have OpenGL exclusively as its backend, allowing you to use pure OpenGL to draw, as demonstrated in the "sdl_opengl" branch. It seems, from the documentation however, that if you use SDL's API, the library will use OpenGL if available, and will fallback to software rendering if necessary. The reference is here:

if possible, it will use OpenGL or Direct3D behind the scenes, which means you'll get faster blits, a working Steam Overlay, and scaling for free.

This possibly makes using just SDL a better choice, instead of manually specifying OpenGL.

What makes me further entangled is the existence of sdl-gpu. The library claims to be a more efficient rendering backend of the official sdl backend.

So, what are your advices?

@Axure Axure added this to the SDL milestone Sep 9, 2016
@Axure Axure added the question label Sep 9, 2016
@zurl
Copy link
Member

zurl commented Sep 10, 2016

why not implement it by yourself?that sounds like a interesting challenge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants