sparrow3D - multi platform game engine


You are right. ^^ I will implement it soon.
 
Nice to hear from you, Poképaradox, altough we are now nemesis. :p


But serious: I implemented your feature request, pmprog. It's quite handy, I think, I will use it for my games, too.


Setting the origin now works for blited surfaces, blited surface parts (tiling), rectangles, rectangle borders, rotozoom surfaces and rotozoom surface parts.


I thought about implementing it for ellipses, too. But I think, that doesn't make much sense, because ellipses are always defined around one center point. ;-)


greetings, Ziz
 
But serious: I implemented your feature request, pmprog. It's quite handy, I think, I will use it for my games, too.
Wow, look at the service on that ;)


Just wish I could see YouTube at work... bah


Edit: Watched now - Fantastic good job :)
 
Last edited by a moderator:
Don't have taking screenshots set up on my pandora so took a photo :p see attachment ;)

Scrooge.JPG
 
Hm, ok...


I just don't know, what went wrong...

i_just_don__t_know_what_went_wrong_by_404compliant-d4n6nuf.png



If you want, you can send me the obj file and the texture, that I can take a look. ^^


greetings, Ziz
 
Oh, I know now, what went wrong. Dragons_slayer sent me the obj file - it was my failure. I read the v-part of the uv-texture-coordinates mirrored.


There is still something wrong (e.g. with the hands), but it's much better now:Bildschirmfoto am 2012-03-02 00:29:36.png


The fix is uploaded to github.
 
The feet look "joined". Looks good though.


Have you tried compiling/running on Windows or Linux (desktop)?
 
Of course. I develop and test with Linux first before I compile it for my gp2x. Windows should work, but I didn't try it for a long time. I think, I will do so later.


If you have Linux:


git clone git://github.com/theZiz/sparrow3d.git


cd sparrow3d


make


./testsparrow.sh


You need the dev-packages of SDL, SDL-Image, SDL-ttf.


That's all. ;-)
 
Yes, the texture looks good now :)


It seems as if the vertex coordinates aren't accurate.


Maybe something like this: one vertex is at Xposition 1.4092, another one is at 1.4934. But for some reason he makes both 1.4...


Could be something completely different too :p
 
Ziz, I've sent you a couple of PM's, I'm struggling to compile a windows DLL.


Firstly, meshloader.h refers to 3dengine.h, which isn't included in the git.


If I remove meshloader, I'm errors on functions such as "spSetFrustumf2" that are declared "inline", and also bizarrely "int i;" in sparrowCore.c on line 58, despite it being used without problem on line 37!?


I'm obviously doing something wrong, but I have no idea what
 
Oh, that's easy: meshloader.c is old and not used anymore. I remove it from the git repository. :)


Have a look to the Makefile to know the needed files. A good rule is: Use everything starting with "sparrow" and ending with ".c" or ".h". These files are needed to build the library.


everything starting with "test" and ending with ".c" is a test-application, which uses the sparrow3d-library.


I hope this is helpful.


greetings, Ziz
 
Damn, I just lost my post. I had to make a ton of changes. Let's see if I can remember them

  1. Changed filenames from .c to .cpp to get past the "require variable declarations first"
  2. Changed all "inline" statements to "__inline"
  3. A couple of functions were missing return statements (in sparrowSprite.c)
  4. Added sparrowRenderer.h and sparrowPrimitives.h as includes into sparrowSprite.h
  5. sparrowRenderer.c, the "root" code uses keyword "try", had to change to "tryx"
  6. sparrowMesh.c, I needed to add casts into the parameters of pow (too many supported overloads)



But it's compiled now... so now it's time to try and compile a test app with it to see if it works, and I didn't break anything with my changes ;)


Edit: Build the test app, and it all works fine! Excellent! Prototype coming up
 
Last edited by a moderator:
Good morning, folk.


After a long time I have done some little and bigger updates.


First of all I got some little improvements from pmprog (better handling of resizeable windows and an event feedback function as optional parameter for the main loop function) and from foxblock (some bugfixes and general improvements especially for compiling with Codeblocks in Windows™).


Furthermore I did some bug fixes and speed optimizations too and implemented

  • functions for creating and deleting sparrow3D compatible surfaces
  • some new math functions (arcsine, arccosine, tangens)
  • locking and unlocking of the rendertarget (in fact just an enclosure of SDL_LockSurface and SDL_UnlockSurface with returning the surfaces raw pixel data)
  • the functions for drawing text now support line breaks - just add '\n' anywhere in your C-String
  • Because of people using C++ I made the 'char*' in the font part to 'const char*' (std::string::c_str() returns a const char*). Other used C-Strings will follow later (mostly if someone needs it in C++ without bad casting...)
  • a new example for handling different render targets
  • sometime I improved the light: fewer flickering. Dunno, whether I ever mentioned it :)



And here is a new video especially of the last two parts in the list. It shows the four demo applications shipped with sparrow3D. Enjoy.

https://www.youtube.com/embed/fuSZn-_ACqc?feature=oembed

greetings,


Ziz
 
I just checked this out on my Ubuntu 12.04 machine (amd64, 4cores, 16gig RAM) with multi-head'd nvidia displays, current mfr drivers, and got these results:



Code:
w1x@w1x0-dev:~/hak/gl/sparrow3d$ gdb testsparrow

GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04

Copyright (C) 2012 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.  Type "show copying"

and "show warranty" for details.

This GDB was configured as "x86_64-linux-gnu".

For bug reporting instructions, please see:

<http://bugs.launchpad.net/gdb-linaro/>...

Reading symbols from /home/w1x/hak/gl/sparrow3d/testsparrow...done.

(gdb) run

Starting program: /home/w1x/hak/gl/sparrow3d/testsparrow 

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

[New Thread 0x7fffee284700 (LWP 8847)]

[Thread 0x7fffee284700 (LWP 8847) exited]

Found 1 Joysticks

  Opened Joystick 0 (Mega World USB Game Controllers)

Reading "./data/testmeshuv_tri.obj" with

  1344 Triangles without uv

  1152 Triangles with uv

  0 Quads without uv

  0 Quads with uv

  2160 Edges

  1872 uv Edges


Program received signal SIGSEGV, Segmentation fault.

spFontDraw (x=0, y=2, z=-1, text=0x4054b0 "Previous (q)", font=0x665060) at sparrowFont.c:291

291 pos += letter->width >> 1;

(gdb) quit

A debugging session is active.


Inferior 1 [process 8844] will be killed.


Quit anyway? (y or n) y  

w1x@w1x0-dev:~/hak/gl/sparrow3d$ file testsp

testsparrow           testsparrow_debug.sh  testsprite            testsprite_debug.sh   

testsparrow.c         testsparrow.sh        testsprite.c          testsprite.sh         

w1x@w1x0-dev:~/hak/gl/sparrow3d$ file testsparrow

testsparrow: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x2c11052e362e1519147dae28add071d503d404c7, not stripped

w1x@w1x0-dev:~/hak/gl/sparrow3d$ ldd !$

ldd testsparrow

linux-vdso.so.1 =>  (0x00007fff415ff000)

./libsparrow3d.so (0x00007fdf40db0000)

libSDL-1.2.so.0 => /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0 (0x00007fdf40af3000)

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdf40735000)

libSDL_ttf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0 (0x00007fdf4052f000)

libSDL_image-1.2.so.0 => /usr/lib/x86_64-linux-gnu/libSDL_image-1.2.so.0 (0x00007fdf40312000)

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fdf40017000)

libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007fdf3fd2a000)

libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdf3fb26000)

libpulse-simple.so.0 => /usr/local/lib/libpulse-simple.so.0 (0x00007fdf3f921000)

libpulse.so.0 => /usr/local/lib/libpulse.so.0 (0x00007fdf3f6e2000)

libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fdf3f3ae000)

libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fdf3f19c000)

libcaca.so.0 => /usr/lib/x86_64-linux-gnu/libcaca.so.0 (0x00007fdf3eed1000)

libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdf3ecb4000)

/lib64/ld-linux-x86-64.so.2 (0x00007fdf41189000)

libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fdf3ea17000)

libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007fdf3e7ef000)

libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007fdf3e5a0000)

libtiff.so.4 => /usr/lib/x86_64-linux-gnu/libtiff.so.4 (0x00007fdf3e33c000)

librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fdf3e134000)

libpulsecommon-0.9.19.so => /usr/local/lib/libpulsecommon-0.9.19.so (0x00007fdf3dee6000)

libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007fdf3dc7e000)

libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fdf3da3a000)

libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fdf3d81c000)

libslang.so.2 => /lib/x86_64-linux-gnu/libslang.so.2 (0x00007fdf3d4aa000)

libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5 (0x00007fdf3d27d000)

libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fdf3d056000)

libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fdf3ce3e000)

libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007fdf3cbf4000)

libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007fdf3c724000)

libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007fdf3c4f8000)

libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007fdf3c2f1000)

libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fdf3c0ed000)

libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fdf3bee7000)



... I'm thinking, assumptions about word size should be reviewed along with a general >>-usage inspection for similar issues ..
 
Oh, I never tried it with a 64 bit system.


I will start a 64 bit VM in the evening and test (and hopefully fix) it myself.


Thanks for the bug report!


greetings,


Ziz
 
I plan to update my Windows build this weekend. I'm running Windows 7 64bit. I'll let you know any problems on that side.
 
pmprog found some very ugly bugs and we fixed them.


Unfortunately does a 64 Bit VM of ubuntu crash my system. I have no idea, why. The installation and first start work fine, but now: Kernel panic or restart every time I start the 64 Bit Ubuntu VM. :-\


So I cannot test a 64 bit linux compilation here, sorry. But maybe the bugs pmprog found, made your build crush, torpor?


greetings,


Ziz
 
Back
Top