1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice

GLESGAE

Discussion in 'General Discussions' started by Stuckie, Feb 9, 2012.

  1. Stuckie

    Stuckie Member

    Joined:
    Apr 7, 2004
    Messages:
    492
    Location:
    Tired, and sleeping in the basement...
    I suppose I should start shunting stuff over here, so I'll go with what I'm actively working on just now.


    Original gubbins here: http://www.gp32x.de.../59428-glesgae/


    GLESGAE ( GL ES Game Application Engine ) is an engine I started last year to help further my own graphics programming, and thought that it might be beneficial to write down tutorials along the way - as a way to help the community, and ensure I do in fact know what I'm doing :D


    It stalled for a bit, but it's now back on track!


    The name derives from the fact it works pretty well for what it describes, and it's a Scottish colloquialism for Glasgow, and me being Scottish, thought it was amusing!


    There are two repositories on the go for this, one which is linked to the tutorials up on the Wiki, and another which is "bleedin' edge" and is likely to break from time to time, especially when I go about doing vicious wide-ranging rewrites of things.


    Stable Repository: http://svn.xp-dev.co.../glesgae/trunk/


    Wiki Link: http://pandorawiki.org/GLESGAE


    Bleedin' Edge: https://github.com/stuckie/glesgae


    The path outline changes as I need to do things, so neither the original post, or the current TOC on the wiki really give an outline of what's coming up... or at least, the ordering of it.


    What I will be doing, is focusing on implementing Scripting via JavaScript over the next couple of months.


    Oh yes... I has a plan for entering something into the Rebirth competition thingie... and you get GLESGAE for free.


    In terms of the tutorial line - I've just finished writing up about Resources, although the code has not yet been fully tested and committed back to the stable repository as yet.


    I have an overview chapter on the Graphics System to write up - with what mess I made of it in the unstable repository, and why, then I have a few utilities to write up on ( HashString, Logger and File... finally! ) before pushing over the JavaScript stuff into the stable repository.


    This will mark the two of them as more or less in-line with one another, before ploughing ahead with binding stuff out to JavaScript.


    There is method in my madness, but you'll just have to wait and see what comes out of it ;)
     
    Last edited by a moderator: Jan 2, 2016
  2. Wrath Of Khan

    Wrath Of Khan Soul soother...

    Joined:
    Dec 29, 2009
    Messages:
    4,959
    Location:
    Ireland
    Just had a quick look.So ostensibly it's a game engine with included tutorials for making games for the pandora.Though im sure there's more to it but im no programmer/techie guy.Sounds good though. :)
     
  3. pmprog

    pmprog Advanced Member

    Joined:
    Apr 25, 2011
    Messages:
    3,152
    I was pointed to your tutes when I started looking at coding Hot Pursuit. Unfortunately a number of things IRL have prevented me from doing much on HP - or even my competition entry. I'm glad you're carrying on with it though, and I'll be sure to pop back in when I'm back on the case.
     
  4. Stuckie

    Stuckie Member

    Joined:
    Apr 7, 2004
    Messages:
    492
    Location:
    Tired, and sleeping in the basement...
    Yea, everything on GLESGAE stalled due to things that went a bit mad for me too, so real life can be a right pest at times ;)


    As I said though, I'll be needing this for my own competition entry.. whether I'll be able to keep up to speed with the tutorials at the same rate ( organising your thoughts into words, and explaining things takes much longer than actually coding and debugging the damn thing, generally! ) I'm not sure, but hopefully no-one will hold it against me too much!


    Also, if anything's unclear, feel free to let me know, and I'll go update it.. I'm not your standard programmer in any sense of the word, and I do tend to jump around a lot, and it wouldn't be the first time I've glossed over something critical that I shouldn't have! ( or explained something wrong, but have it right in the code... that happens too *cough* )
     
  5. Stuckie

    Stuckie Member

    Joined:
    Apr 7, 2004
    Messages:
    492
    Location:
    Tired, and sleeping in the basement...
    I'm currently compiling webkit - mainly to pinch the javascriptcore library from it.


    As such, here are my findings for anyone else wanting to go near it to use webkit for the use of building a browser, for instance.


    The joys of cross-compiling a large scale library with many many dependencies!


    I'm using the yactfeau toolchain, in my own custom VM ( which has NFS mounts to my dev drives on my main box.. but that shouldn't matter much to you, you'll just need PLENTY of space for this in your VM )


    I'm compiling webkit from SVN as well, so it's relatively recent ( mine might be a few commits out now, but it's verified working. )


    Anyway, create a project folder (mine shall be called glesgae, and checkout ( or link to ) recent versions of webkit, glib, libsoup, cairo, pixman, glib-networking, gnutls, libnettle, gstreamer, gstreamer-plugins-base


    Specifically, I'm using webkit revision 105733, glib 2.31.12, cairo 1.10.0, pixman 0.18.4, libsoup 2.37.1, glib-networking 2.31.6, gnutls 2.12.12, libnettle 2.1, gstreamer 0.10.30, gst-plugins-base 0.10.30


    First up, glib.


    If your system's version of glib is lower than the one we're compiling, you'll need to build this version for the host.


    If you're using Ubuntu, you have additional fun in that you have to clean up Ubuntu's mess... you'll need to delete the old glib libraries in /usr/lib and the one in /lib for your newly compiled version to be found and used correctly.


    If your glib is fine (you'll find out if you get weird errors in the configure stage for the Pandora) we'll move on to the Pandora compile.


    Create a pandora.cache file with the following in it:



    Code:
    
    ac_cv_func_posix_getpwuid_r=yes
    
    ac_cv_func_posix_getgrgid_r=yes
    
    glib_cv_uscore=no
    
    glib_cv_stack_grows=no
    
    
    Then run configure as follows:



    Code:
    LIBFFI_CFLAGS=/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/arm-angstrom-linux-gnueabi pndconfigure --cache-file=pandora.cache
    Then

    Code:
    make


    If you're really lucky, it'll compile without issue.

    If you end up with the cryptic error of:



    Code:
    
      GEN    stamp-testmarshal.h
    
    You should give exactly one directory name
    
    
    You'll need to do the following:



    Code:
    
    cd tests/gobject
    
    glib-genmarshal --prefix=test_marshal testmarshal.list --header >> xgen-gmh
    
    (cmp -s xgen-gmh testmarshal.h 2>/dev/null || cp xgen-gmh testmarshal.h;)
    
    rm -f xgen-gmh xgen-gmh
    
    glib-genmarshal --prefix=test_marshal testmarshal.list --body >> xgen-gmc
    
    cp xgen-gmc testmarshal.c
    
    rm -f xgen-gmc xgen-gmc~
    
    cd ../..
    
    make
    
    
    The Makefile is supposed to do this, but seems to get confused, for some reason.. either way, it should continue afterwards.



    Once it's done,

    Code:
    make install
    as usual for it to dump itself into your project's end structure - /mnt/utmp/glesgae



    Next, pixman.

    This one's straightforward enough, it's just

    Code:
    pndconfigure && make && make install


    Next, cairo.

    This also requires a pandora.cache file, this time containing:



    Code:
    
    ax_cv_c_float_words_bigendian=no
    
    
    Then it's just:



    Code:
    pndconfigure --cache-file=pandora.cache && make && make install


    Next, libnettle.



    Code:
    pndconfigure && make && make install
    I got errors during install while building tests, but it seemed happy enough to copy the includes and libs over, which is what we needed anyway.



    Next, gnutls.



    Code:
    pndconfigure --without-p11-kit && make && make install


    For the host, I needed glib-networking to be built here, if I was building for host as well.



    Now for libsoup.

    Again, it's just:

    Code:
    pndconfigure && make 
    I got errors during making the tests.. I brazenly ignored them and issued



    Code:
    make install
    To which I got the same errors, but it had already built the libs and headers, and copied them into place.



    On to gstreamer.

    I had to specify the lib folder of where all the glesgae is being dumped...



    Code:
    LDFLAGS=-L/mnt/utmp/glesgae/lib/pndconfigure && make && make install
    Other than that, a nice and easy library to compile...



    Now gstreamer-plugins-base.

    I again had to specify the lib folder of where all the glesgae is being dumped...



    Code:
    LDFLAGS=-L/mnt/utmp/glesgae/lib/ pndconfigure


    Code:
    make
    I got an error during the compile about something including a part of glib directly.

    It was an easy fix, though.. I just had to edit gst/typefind/gsttypefindfunctions.c and change the line to #include <glib.h>



    Code:
    make install


    Now the big bugger, webkit:



    Code:
    LIBSOUP_CFLAGS="-pthread -I/mnt/utmp/glesgae/include -I/mnt/utmp/glesgae/include/glib-2.0 -I/mnt/utmp/glesgae/lib/glib-2.0/include -I/mnt/utmp/glesgae/include/libsoup-2.4 -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/libxml2" LIBSOUP_LIBS=-L/mnt/utmp/glesgae/lib pndconfigure --with-gtk=2.0 --with-unicode-backend=glib
    Unless you feel like compiling GTK 3.0? No? ;)

    The LIBSOUP stuff is required as it doesn't seem to have updated pkg-config correctly - probably due to the errors in the tests.

    Again, it points to where glesgae is all going out to.



    Code:
    make jsc
    It'll give up building the interpreter, but we don't need that... we just need the library and the include files.


    Specifically, these are hiding in .libs, and the header files in Source/JavaScriptCore/API


    I couldn't get the full webkit to build ( just issuing "make" ) due to glib-genmarshal errors again.. but I now have JavaScriptCore compiled and ready.


    .... after three days on and off of attempting to compile the bugger, hence this post.
     
    Last edited by a moderator: Feb 10, 2012
  6. slaeshjag

    slaeshjag Advanced Member

    Joined:
    Apr 8, 2010
    Messages:
    2,526
    Location:
    ~Stockholm, Sweden
    You could've asked, this is stuff I've been doing for my Midori port ;)
     
  7. Stuckie

    Stuckie Member

    Joined:
    Apr 7, 2004
    Messages:
    492
    Location:
    Tired, and sleeping in the basement...
    I need to be able to build it for other platforms as well, and ensure I'm using the same versions across the board ;) so wasn't a complete waste of time!


    Certainly not something I want to go through again, hehe


    I only needed the JSC part of it too, so it was a bit of a long-way around when I could've just pinched one little library from you which is ( effectively ) self-dependent ( well, depending on whether you compiled glib unicode support, or went with icu which is a dependency. ) But yea, the need to ensure everything's compiled at the same level is a bit important at the moment, so wasn't a waste.


    Oh and my Javascript test in the bleedin' edge GLESGAE repository works on Pandora now as well.


    Onwards to the fun stuff!
     
    Last edited by a moderator: Feb 10, 2012
  8. pmprog

    pmprog Advanced Member

    Joined:
    Apr 25, 2011
    Messages:
    3,152
    Out of curiousity, why are you adding Javascript to GLESGAE? If it's for some form of in-game scripting, damn, you could have chosen a better language ;)
     
  9. PokeParadox

    PokeParadox Founder of Pirate Games - Penjin Coder Staff Member

    Joined:
    Dec 8, 2005
    Messages:
    6,429
    Location:
    UK
    Maybe to port some HTML5 games to not require a browser? :S
     
  10. Stuckie

    Stuckie Member

    Joined:
    Apr 7, 2004
    Messages:
    492
    Location:
    Tired, and sleeping in the basement...
    PokeParadox is right..


    Effectively, having looked around myself at things like appMobi, appcelerator, et al.. they all do pretty much the same thing - a big engine thing that wraps up a JavaScript interpreter and binds out enough bits for Canvas and friends to work, and a huge bunch of other junk that generally isn't really needed for games.


    They still tend to work faster, as instead of going through the browser framework - which is meant to be standards compliant, after all - it can potentially be banging the hardware directly, in whatever manner it feels like... so this is what I'm going to be doing with GLESGAE for the Rebirth compo; have it in a state that JavaScript games can just be thrown over, and take advantage of the hardware if needed. That's the freebie at least, as I'll be doing a game alongside it to act as an example, and ensure everything works. ( well, that's the plan at least ... )


    If I was just going to bind out a proper scripting language, it'd be Lua, as I've a huge amount of experience with doing exactly that ;)
     
    Last edited by a moderator: Feb 11, 2012
  11. milkshake

    milkshake Advanced Member

    Joined:
    May 18, 2009
    Messages:
    3,719
    Location:
    Rotherham, UK
    I don't see why you don't like javascript as a scripting language, did you know the wolfire team use is for scripting in their overgrowth game?
     
  12. gruso

    gruso thunderbox

    Joined:
    Feb 28, 2008
    Messages:
    7,461
    Location:
    Sydney, Australia
    Interesting :)

    (Well, the whole project is of course, but that bit grabbed me. It might also grab Craig.)
     
    Last edited by a moderator: Feb 12, 2012
  13. pmprog

    pmprog Advanced Member

    Joined:
    Apr 25, 2011
    Messages:
    3,152
    It's not "as a scripting language", more of just "as a language" :D Mainly because it is an untyped language - okay, I know most scripting languages are, and I don't really like any of them. Also, this article makes me cringe - there should not be three different ways of defining classes.


    I know, I'll probably have to embrace it at some point, just a shame they couldn't have picked a better language to standardise on.


    Back on topic:


    It is an interesting idea though. Could be pretty useful, because things like Microsoft's Desktop Widgets are XML/HTML/Javascript. So might be interesting see other things get "interfaced".


    Are you thinking of covering WebGL too?
     
  14. Stuckie

    Stuckie Member

    Joined:
    Apr 7, 2004
    Messages:
    492
    Location:
    Tired, and sleeping in the basement...
    I'll certainly have a look at WebGL... I'd need to fix my ES2 backend first as I sortof mangled it a bit when I split up the graphics system, but that probably won't be for a while yet.


    Just for basic HTML5/JS support, I need to sort out Canvas, Image and Audio primarily, so I've my hands full yet!


    GLESGAE itself doesn't have any real File I/O implementation ( working on that now ) nor Audio implementation ( likely going to be OpenAL ) so those will be needing done as well.


    Tutorial-wise, I think I might have to hold off for the next couple of weeks to get everything done, as looking at how much free time I can guarantee to have, I have 18 hours over the next two weeks, and getting the basics marked down and my compo entry done will be exceedingly tight!
     
  15. crow_riot

    crow_riot Well-Known Member

    Joined:
    Sep 21, 2009
    Messages:
    1,763
    Location:
    .at
    you're now doing a project i also was keen on getting to work - but didn't pick it up due to time constraints (as usual ;) )


    hope this turns out to be great, i really see a lot of potential in such a project!
     
  16. ibisum

    ibisum Well-Known Member

    Joined:
    May 6, 2009
    Messages:
    1,135
    Use LUA! Its Better! Want proof? The go see maratis3d.org and getmoai.com right now ..
     
  17. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    15,989
    I second LUA for scripting. Unlike JavaScript, LUA actually had the time to be designed properly, and it shows. Specifically it was designed with scripting and external hooks in mind.
     
  18. milkshake

    milkshake Advanced Member

    Joined:
    May 18, 2009
    Messages:
    3,719
    Location:
    Rotherham, UK
    yes but I think the main goal is getting html5 games to run without a browser so lua wont help with that.
     
  19. WizardStan

    WizardStan Mega GP Mania

    Joined:
    May 24, 2008
    Messages:
    15,989
    Oh, right.
     
  20. Stuckie

    Stuckie Member

    Joined:
    Apr 7, 2004
    Messages:
    492
    Location:
    Tired, and sleeping in the basement...
    Yea, the goal is more to get HTML5/JS games running in a native application, as browser support for Canvas and Audio et al can still be a bit spotty at best - especially in the mobile space.


    I have my reasons for implementing this first anyway, but I'll be implementing Lua as well at some point as well - especially as I have several years experience of using Lua in such situations.


    Anyway, a little progress report.


    I've written up a nice and simple File implementation thing.


    I've pulled in SOIL to use for loading in images, as it's nice and self contained and without a mental license.


    I'll also be pulling in OpenAL and Ogg Vorbis.. I won't be supporting MP3 files, as I don't want to go anywhere near that patent encumbered mess, as this engine is going to be rather important to me soon, so rather not deal with mad licenses ;)


    And I'm about to start binding out stuff for Canvas and Image, to get things on screen.


    As for the Rebirth project that'll be coming out of this, most of the design was written up last night, with some concept bits and pieces drawn. I'll start another topic for this closer to the time.
     

Share This Page