Wireframe using SDL or OpenGL ?

what aproach would you take

Page 1 of 1

2 Replies - 4244 Views - Last Post: 20 June 2008 - 10:03 AM Rate Topic: -----

#1 Trogdor  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 15
  • View blog
  • Posts: 627
  • Joined: 06-October 06

Wireframe using SDL or OpenGL ?

Posted 19 June 2008 - 02:51 PM

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 June 2008 - 02:52 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Wireframe using SDL or OpenGL ?

#2 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

Re: Wireframe using SDL or OpenGL ?

Posted 19 June 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.
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 June 2008 - 04:05 PM

Was This Post Helpful? 1

#3 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 1009
  • View blog
  • Posts: 4,197
  • Joined: 14-February 08

Re: Wireframe using SDL or OpenGL ?

Posted 20 June 2008 - 10:03 AM

View PostTom9729, on 19 Jun, 2008 - 04:04 PM, said:

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.
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

glEnable(GL_LINE_SMOOTH);




:)
Was This Post Helpful? 1

Page 1 of 1