• Advertisement
Sign in to follow this  

Looking for a Flash ActionScript-esque drawing library for C++ , C#, or Java

This topic is 3894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I really like the drawing libraries included with Flash 9 / ActionScript 3. The drawing model and level of complexity involved is just right for my needs. (Here's a look at the drawing package: http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/package-detail.html ) However, I've hit the graphics performance wall in the Flash VM - the full-screen stuff I'd like to do just isn't fitting through Flash's graphics pipeline. So, I'm looking for something much faster to execute more complicated projects for the desktop. I have some experience with C#, and am just getting started with C++. I'm looking for what amounts to a Flash-like 2D drawing library with graphics hardware support - something that takes care of the hassles of drawing basic primitives, blending, rotation, scaling, depth management, filling primitives with bitmaps, nesting sprites inside other sprites, etc, preferably while keeping things quick with OpenGL. I've experimented with C++ and SDL, and while this is nice the drawing routines are rather low-level for my taste. I could go through and (poorly) re-implement a flash-like drawing library in C++ and SDL and OpenGL, but this sounds painful and time-consuming. Does anything like this already exist? I'd prefer to use garbage-collected language like C# or Java, but if the performance gains are significant then I'm willing to continue with C++. Any ideas? Any libraries out there that would do the trick? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Hey there Obrigado,

Uh, I'm a beginner, who's just past GDI, looking for something neat for graphics, and I came across the CImg (Cool Image) library just recently - it's an open source cross-platform C++ Image Processing Template library. It might be not completely what you're after, but have a look.

info:
http://cimg.sourceforge.net/

a demonstration:
http://www.codeproject.com/useritems/CImgBreakout.asp

Share this post


Link to post
Share on other sites
Javas 2D standard library can do all of the things you mention, and they implemented acceleration through opengl and directx some years ago. It's unlikely to be the fastest combination you can find out there, but it's likely an order of magnitude faster than flash, and pretty easy once you get started.

In case you want to try it out, there's a tutorial here:
http://www.javalobby.org/forums/thread.jspa?threadID=16867&tstart=0
The bottom MyGame class is the interesting part. It just sets up a few boilerplate things so you can start drawing etc.
Images can be loaded through ImageIO.read("myfile.png"), which returns a BufferedImage that can be drawn directly at an acceptable speed.
I recommend downloading the newest JDK bundled with the NetBeans IDE.


EDIT: If you use it, be sure to move
frame.setVisible(true);
up so it's just under
frame.setSize(500, 300);
or you may get an error.
Oh, and you should run the java VM with the -Dsun.java2d.opengl=true to enable acceleration. In NetBeans, you right click on your project, select properties, go to the 'run' tab and paste it into the 'Java VM arguments' field.

A benefit of using java2d is that it's a standard library, and thus you can use it in applets and java web start without asking the user for permission.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement