Welcome to Dream.In.Code
Become an Expert!

Join 150,129 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,095 people online right now. Registration is fast and FREE... Join Now!




Wireframe using SDL or OpenGL ?

 
Reply to this topicStart new topic

Wireframe using SDL or OpenGL ?, what aproach would you take

Trogdor
19 Jun, 2008 - 01:51 PM
Post #1

D.I.C Addict
Group Icon

Joined: 6 Oct, 2006
Posts: 549



Thanked: 4 times
Dream Kudos: 125
My Contributions
I am writing a solving program for a abstract 3d puzzle (think tetris but then much more complex)
For the visualisation i was thinking to pick up on SDL programming again (stopped halfway in a SDL project a year ago due to lack of time)
I was thinking to either draw the result
- in a wireframe
- using surfaces with a high transparancy so you can see the different pieces through eachother
- or a combination of the above

and then use some form of controls to rotate the result, i am not sure about that yet.

Some things i remember/found out:
In SDL there are no neat drawing functions for lines etc, especialy if i want to make a wireframe with nice anti aliased stuff i will have to do a lot of pixeplotting madness.
OpenGL requires a lot of code to get simple things working, though one that is done the amount of work should be ok. Also it has a very steep learning curve.

Now as for my question: what aproach would you guys take / think would work, and what programming angle would you follow. (pure SDL? OpenGL through SDL? What libraries?)

This post has been edited by Trogdor: 19 Jun, 2008 - 01:52 PM
User is offlineProfile CardPM
+Quote Post

Tom9729
RE: Wireframe Using SDL Or OpenGL ?
19 Jun, 2008 - 03:04 PM
Post #2

Debian guru
Group Icon

Joined: 30 Dec, 2007
Posts: 1,592



Thanked: 12 times
Dream Kudos: 325
My Contributions
OpenGL with GLUT is very portable and not too bad to get going.

Enabling wireframe rendering in OpenGL is pretty easy, not sure how it compares to SDL (though I'm pretty sure in SDL you can just call OpenGL code, I've never used it though).

An example from my engine.
CODE

if (wireframe_enabled)
{
    glPolygonMode(GL_FRONT, GL_LINE);
    glPolygonMode(GL_BACK, GL_LINE);
}


Edit: I'm pretty sure there's some OpenGL function for "smooth lines", aka antialiasing.

This post has been edited by Tom9729: 19 Jun, 2008 - 03:05 PM
User is offlineProfile CardPM
+Quote Post

stayscrisp
RE: Wireframe Using SDL Or OpenGL ?
20 Jun, 2008 - 09:03 AM
Post #3

D.I.C Regular
***

Joined: 14 Feb, 2008
Posts: 284



Thanked: 11 times
My Contributions
QUOTE(Tom9729 @ 19 Jun, 2008 - 04:04 PM) *

OpenGL with GLUT is very portable and not too bad to get going.

Enabling wireframe rendering in OpenGL is pretty easy, not sure how it compares to SDL (though I'm pretty sure in SDL you can just call OpenGL code, I've never used it though).

An example from my engine.
CODE

if (wireframe_enabled)
{
    glPolygonMode(GL_FRONT, GL_LINE);
    glPolygonMode(GL_BACK, GL_LINE);
}


Edit: I'm pretty sure there's some OpenGL function for "smooth lines", aka antialiasing.


Yeah i think its something like
CODE


glEnable(GL_LINE_SMOOTH);



smile.gif
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 01:42AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month