New features: - it should detect if your driver supports hardware accelerated collision detection: otherwise, it use a fallback method - Bounding boxes collision detection is also available: just use SprOverlap (Sprite1, Sprite2): you don't need to use SprSetType (as in pixel perfect collisions); the method used check even if the bounding boxes are rotated (it's a simplified SAT algorithm, not just overlapping Cartesian rectangles!) -you can load an image made of "slices", just as you load an animated image, and then you can use slices to build an isometric sprite (demo included)
Oh, yes, a win32 binary is included.
Since the name "Sprite library" is too generic, I called it OpenB2D, because it works, at least in FreeBasic, in the same way of OpenB3D: my goal is to use both libraries, building a mini-framework for game development.
Last Edit: Oct 21, 2012 17:42:00 GMT -5 by angros47
The source of OpenB2D is written in C++, it used parts of OpenB3d (a fork of MiniB3d made by me) and parts of Basic4gl. Since both of them are free and open source softwares, and OpenB2D is free and open source, too, no license is infringed.
The demo has been written in FreeBasic. To compile it, I translated the header file in FreeBasic, using SWIG, and it automatically added the lines you noticed (I forgot to delete them).
OpenB2D is aimed mainly to Freebasic, but it can be used in other languages, too. Oh, you might like to know that the runtime library and the graphic library of FreeBasic are written in C.
Actually, I was informed of a way to do it with the, "OpenGLPlugin" library but it was not listed in the examples or help files so this information might help others seeking the same:
It plots directly to the image.
Here is the program I wrote, classic STATIC:
dim ww,wh sub InitOpenGL() ww=WindowWidth() wh=WindowHeight() glPixelStorei(GL_UNPACK_ALIGNMENT,1) glViewport(0, 0, ww,wh) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0,ww,0,wh) glMatrixMode(GL_MODELVIEW) glLoadIdentity() end sub
dim imge as img=allocimage(512,368),i,j,z
glClear(GL_COLOR_BUFFER_BIT) swapbuffers() glClear(GL_COLOR_BUFFER_BIT) do for i=0 to 367 for j=0 to 511 drawpoint(imge,j,i,rnd()%256,rnd()%256,rnd()%256) next next glRasterPos2i(0,0) glDrawPixels(imge) swapbuffers() loop until inkey$()=" "