How does Max2D work?

Archives Forums/MacOS X Discussion/How does Max2D work?

ImaginaryHuman(Posted 2004) [#1]
I am just curious mainly. ... I was playing with Max2D commands last night getting objects to bounce and rotate and zoom and tint and all the rest of it ...

Does Max2D render through OpenGL?

I know BlitzMax has the bglCreateContext (or whatever) and all the OpenGL commands, but can I take that the Max2D routines are basically a higher-level layer on top of OpenGL to easily draw objects - albeit limited to 2D at the moment?

Max2D isn't some custom-coded graphics library is it, with blit routines and so on like on the Amiga for example?


skn3(Posted 2004) [#2]
It is openGL


marksibly(Posted 2004) [#3]
Hi,

Yep, Max2D is a module written in BlitzMax that uses OpenGL.

Have a look at the source code in mod/brl.mod/max2d.mod and mod/brl.mod/glmax2d.mod to see how it all works.


ImaginaryHuman(Posted 2004) [#4]
Interesting! I wonder if on some systems it would be faster to do what Max2D does with the CPU directly (old school?)? ie when the gfx card is kinda slow.


marksibly(Posted 2004) [#5]
Hi,

Yeah, probably, but I'm really aiming for more modern systems.

Back in the early days, I did a bit of messing around with the 'gworld' (ie: 'old school') stuff on a G3 400Mhz iMac, which I felt was a reasonable choice for a 'low end' system. It turned out to be *way* slower than OpenGL so I pretty much gave up on it.

The Mac has awesome GL integration, and it's only gonna get better in future.


Kanati(Posted 2004) [#6]
Actually I think he was referring to like a fast cpu but a craptastic video card. Much like the PCs we have at work. 2ghz p4s, but the video is system shared ram 32 meg intel graphics. Pretty crappy and barely able to do 3D at all...

Could it be possible that the cpu could do some of those transforms, rotations, etc faster than the video card?

Not that I *care* when it comes to macs and all... But just to maybe clarify for Mister AngelDaniel. :)

Kanati

AND WHEN FOR THE PC!?!?!?!


RexRhino(Posted 2004) [#7]
Yeah, or people on laptops... with a smoking CPU, gigs of memory, but not a fancy graphics card (Intel shared RAM).

Please remember that people will use BlitzMax for other reasons than games (music software, generating graphics, etc.), so it isn't reasonable to assume they have an impressive graphics card. I would also assume that if you add GUI commands, people will use BlitzMax for apps, seeing as there isn't a multiplatform app development tool for under $2000 that actually works.


ImaginaryHuman(Posted 2004) [#8]
Yah my humble ibook has an ATI Mobility gfx card which I guess isn't all that greatly capable given modern standards now. It was purchased back in 1999 or so, so that makes it at least 5 years old technology. I would think a G3 300Mhz CPU is a reasonable amount of horespower to do some nice things - judging by some other applications I've seen running, but the OpenGL isn't very quick.

For example, last night I downloaded Pocket Tanks (not sure if that's the full name) to play (old Scorched tanks fan ont he Amiga), and it seemed to be throwing around numerous objects at full frame rate albeit probably in 256 colors, faster than the OpenGL is capable on that machine by far. But oh well. Technology marches on. I gotta get me a decent new computer one of these days I guess.

Funny how a quality software product (like BlitzMax can drive hardware decisions). The whole reason I ever bought an Amiga was to run Deluxe Paint ;-D


podperson(Posted 2004) [#9]
I think you'll be surprised at how well even a pretty old or lame video card can do compared to a pretty decent CPU.

E.g. I am using a 2.4GHz P4 with an onboard intel shared memory video at work -- and that video can run Filax's latest dancing robot demo at perfectly good framerates.

The Wallstreet powerbooks, which are over five years old and sported 233MHz G3s (I think) originally, already had 16MB ATI Rage Mobility video cards (think Voodoo 1-2 level performance). Apple has been putting decent (not necessarily awesome) 3D accelerators into everything they sell for quite some time.