PDA

View Full Version : NEED HELP: Creating xscreensaver Polar Clock in c++/sdl/gl



kthakore
March 19th, 2008, 09:30 PM
I am trying to make a port of http://blog.pixelbreaker.com/polarclock/ for the xscreensaver in ubuntu. Although this is my first SDL/GL application I have been able to get it running. However I am stuck at a few things

TODO:

- Found some stupid mem leaks with valgrind but can't seem to get rid of them
- the MainView class is too messy!!!
- Anti alias the rings
- Smoother animation
- Draw the texts in a circle at the end of each ring
- and the major one making it work with xscreensaver and gnome-screensaver.

Here is the source with both debug an release mode.

http://kthakore.homelinux.com/PolarClock/PolarClock.tar.gz

I used eclipse but u can still build them with make. You need SDL SDL ttf and GL libraries.

Here is what it looks like now:

http://kthakore.homelinux.com/PolarClock/polar.png



Any help is appreciated. Also can u please post you solutions here so I can learn too!!!

andrewkk
August 8th, 2008, 03:35 PM
I'm excited for this. Though sadly I know nothing about graphics or memory management. :(

It seems like a simple enough project that I bet that all you'd need to to is hype it up a little more and someone out there would be able to throw something together in no time.

Perhaps the pixelbreaker blog owner would be willing to put up a message asking for interested coders to port PolarClock?

lunarcloud
September 12th, 2008, 04:31 AM
where do i put it to make it a screensaver?

rnodal
September 12th, 2008, 05:21 PM
- Found some stupid mem leaks with valgrind but can't seem to get rid of them


Are you sure those memory leaks come from your application? Sometimes the memory leaks come from the library being used. Also do you have any code after SDL_Quit()? SDL_Quit calls exit and not return() so any code after SDL_Quit will not get executed so any destructor or memory freeing code will not get executed.



- the MainView class is too messy!!!


Finish the application THEN clean the code.



- Anti alias the rings


Look into enabling multi-sampling with SDL. Or you can try OpenGL smooth curves, lines. I'm at work right now so I can't help much now on this.



- Smoother animation


Are you taking into account the delta time between frames? How are you doing your animation?



- Draw the texts in a circle at the end of each ring


I have not really given any thoughts to the problem so I can't offer any solutions.



- and the major one making it work with xscreensaver and gnome-screensaver.


The site of each project should offer information on this.

Other than that congratulations and keep up the good work!

-r

nulall
September 13th, 2008, 08:21 PM
this looks awesome! i can't wait to see it. please give us an update of how it's coming along

Hasteur
March 3rd, 2009, 10:06 PM
Any chance that someone has the original source of this? I'd be extremeley interested in reviving/supporting this if anybody had the source.

Delever
March 3rd, 2009, 10:58 PM
- Draw the texts in a circle at the end of each ring


I recently made my text drawing code available here: http://code.google.com/p/glstext/

Just a warning, right now it compiles and installs both library AND example (i need to change that), so use

./configure --prefix ~/test
make
make install
./bin/testglst
to check out example. Or don't run 'make install'. Anyway, you will need "FreeSerif.ttf" font to be in 'bin' for example to work.

You can create class similar to GLST_Text (it is simple), and change render method to draw text in a way you need (each symbol is simply textured quad).

EDIT: I think you can drop those glstext classes in eclipse and it will work, no need for "library".

Delever
March 3rd, 2009, 11:12 PM
Sorry, I haven't looked at the date of original post!

rugbert
March 11th, 2009, 03:36 AM
bump! any update on this? i love this screesaver!

BRY
March 25th, 2009, 01:37 PM
bump! any update on this? i love this screesaver!

ditto!

travnewmatic
May 12th, 2009, 07:52 AM
bumpity bump, make it happen

Psyphre
June 21st, 2009, 08:50 PM
bumpity bompity boop.

me too!

hackerseraph
June 29th, 2010, 04:27 AM
Shameless BUMP

danger89
August 6th, 2010, 06:09 PM
So does it work?

UnicornForest
October 20th, 2010, 01:08 AM
zibbidy bob hibbidy hop shim sham allakhazam!
And another spell from the great wizard of unicorn forest is made.


http://www.unicornforeststudios.com/spells/rainbow.jpg

Sorry guys I was trying to make a clone of that thing you wanted but looks like I just turned it into a rainbow. This spell was written in C and uses SDL for windowing and Cario for rendering. It should be enough of a seed that one of the other technomancers around here should be able to grow it into that thing you guys were wanting.

Here is a link to a video:
http://www.youtube.com/watch?v=lhTp-aBR2cU

And a link to the source:
http://www.unicornforeststudios.com/spells/rainbowclock.tar.gz
(just untar and make)

Brejcha
January 11th, 2011, 05:44 AM
Any more news on this. Anyone have a full linux conversion?