[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
Chipmunk Physics • View topic - Load images

Load images

Official forum for the .

Load images

Postby onizuka-21 » Sat Feb 09, 2008 5:04 pm

Hi
I am aware this is not the best place for such a question, please forgive my noobness...
I have seen some of you loading images into their Chipmunk application, and I'd like to know if there is an easy way to do so. I've been looking for GLUT or OpenGL libraries that load external images files, but none seemed to suit my simple needs, they use complex texturing stuff that would make no sense in a simple 2D program.
So what code do you generally use to simply place an image on the scene?

Cheers
onizuka-21
 
Posts: 2
Joined: Sat Feb 09, 2008 4:55 pm

Re: Load images

Postby maximile » Sun Feb 10, 2008 12:06 am

Lots of the Chipmunk demos you see are drawn with OpenGL, because it's fast and lots of people know it. If you want to use OpenGL to draw images, even in 2D, you'll need to use "complex texturing stuff". It's not actually that complex, but it can be a bit tricky, so I don't blame you for wanting to stay away from it.

I'm sure others here will be able to advise you on alternatives if you don't want to use OpenGL. If you're on a Mac, Quartz is fast enough for lots of things and easy to use. Or you might want to have a look at the options Python or Ruby give you, but I've never used them.
maximile
 
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK

Re: Load images

Postby onizuka-21 » Sun Feb 10, 2008 5:57 am

Thank you for the fast reply :)

Yes it is definitely OpenGL I want to use, but I'm pretty new to that... As I have seen flat images in other projects on this forum, I just would like to know what code they use to load these images in 2D!

Cheers
onizuka-21
 
Posts: 2
Joined: Sat Feb 09, 2008 4:55 pm

Re: Load images

Postby Kingdom Of Fish » Sun Feb 10, 2008 12:06 pm

I would recommend you to use SFML, its really easy to use and works well with chipmunk.
Kingdom Of Fish
 
Posts: 21
Joined: Sun Jan 27, 2008 10:56 am

Re: Load images

Postby lucas » Mon Feb 11, 2008 1:29 am

I use DevIL to load my images, as it integrates well with OpenGL.
Don't make the same mistake I did and use SDL, you need a hardware based API like OpenGL (constant rotation is slow as anything in SDL)
Tangame - a tangram puzzle game with physics.
http://code.google.com/p/tangame/
lucas
 
Posts: 54
Joined: Wed Sep 26, 2007 2:34 am

Re: Load images

Postby slembcke » Mon Feb 11, 2008 12:05 pm

I'll put in a plug for SOIL here. Very very simple and lightweight. You can load textures in a single line of code.

The only feature it's missing IMO is premultiplying the alpha.

http://www.lonesock.net/soil.html
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Load images

Postby Blue Prawn » Wed Feb 13, 2008 12:23 pm

Here is a simple tutorial on how to use openGL for 2D game rendering:
http://www.meandmark.com/tilingpart1.html
Blue Prawn
 
Posts: 22
Joined: Thu Jan 03, 2008 1:36 pm


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: No registered users and 1 guest

cron