Changeset 1040


Ignore:
Timestamp:
Oct 31, 2011, 9:19:05 AM (9 years ago)
Author:
sam
Message:

core: write a generic application class.

Location:
trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/deushax/deushax.cpp

    r961 r1040  
    1818
    1919#include "game.h"
    20 #include "platform/sdl/sdlapp.h"
    21 #include "platform/sdl/sdlinput.h"
    2220#include "debugsprite.h"
    2321
     
    3230int main(int argc, char **argv)
    3331{
    34     SdlApp app("Map Test (SDL)", ivec2(640, 480), 30.0f);
     32    Application app("Map Test", ivec2(640, 480), 30.0f);
    3533
    3634#if defined _WIN32
     
    4139
    4240    /* Register an input driver and some debug stuff */
    43     new SdlInput();
    4441    new DebugFps(10, 10);
    4542    new DebugSprite(game);
  • trunk/monsterz/monsterz.cpp

    r961 r1040  
    2424using namespace lol;
    2525
    26 #if defined __CELLOS_LV2__
    27 #   include "platform/ps3/ps3app.h"
    28 #   include "platform/ps3/ps3input.h"
    29 #elif defined HAVE_GLES_2X
    30 #   include "eglapp.h"
    31 #else
    32 #   include "platform/sdl/sdlapp.h"
    33 #   include "platform/sdl/sdlinput.h"
    34 #endif
    3526#include "interface.h"
    3627
     
    4536int main(int argc, char **argv)
    4637{
    47 #if defined __CELLOS_LV2__
    48     Ps3App app("Monsterz", ivec2(640, 480), 60.0f);
    49 #elif defined HAVE_GLES_2X
    50     EglApp app("Monsterz", ivec2(640, 480), 60.0f);
    51 #else
    52     SdlApp app("Monsterz", ivec2(640, 480), 60.0f);
    53 #endif
     38    Application app("Monsterz", ivec2(640, 480), 60.0f);
    5439
    5540#if defined _WIN32
     
    5742#endif
    5843
    59     /* Register an input driver and some debug stuff */
    60 #if defined __CELLOS_LV2__
    61     new Ps3Input();
    62 #elif !defined HAVE_GLES_2X
    63     new SdlInput();
    64 #endif
     44    /* Register some debug stuff */
     45    new DebugFps(20, 20);
     46
    6547    new Interface();
    66     new DebugFps(20, 20);
    6748    //new DebugRecord("monsterz.ogm", FPS);
    6849
  • trunk/src/Makefile.am

    r1036 r1040  
    1616    lol/unit.h \
    1717    \
     18    application/application.cpp application/application.h \
    1819    eglapp.cpp eglapp.h \
    1920    \
  • trunk/src/core.h

    r965 r1040  
    9999#include "shader/shader.h"
    100100#include "image/image.h"
     101#include "application/application.h"
    101102
    102103// Managers
  • trunk/src/platform/ps3/ps3app.cpp

    r865 r1040  
    103103    Video::Setup(res);
    104104    Audio::Setup(2);
     105
     106    /* Autoreleased objects */
     107    new Ps3Input();
    105108#endif
    106109}
  • trunk/src/platform/sdl/sdlapp.cpp

    r865 r1040  
    2020#include "lolgl.h"
    2121#include "platform/sdl/sdlapp.h"
     22#include "platform/sdl/sdlinput.h"
    2223
    2324namespace lol
     
    6869    Video::Setup(ivec2(video->w, video->h));
    6970    Audio::Setup(2);
     71
     72    /* Autoreleased objects */
     73    new SdlInput();
    7074#endif
    7175}
  • trunk/test/debug/quad.cpp

    r961 r1040  
    2020using namespace lol;
    2121
    22 #if defined __CELLOS_LV2__
    23 #   include "platform/ps3/ps3app.h"
    24 #elif defined HAVE_GLES_2X
    25 #   include "eglapp.h"
    26 #else
    27 #   include "platform/sdl/sdlapp.h"
    28 #   include "platform/sdl/sdlinput.h"
    29 #endif
    30 
    3122#if USE_SDL && defined __APPLE__
    3223#   include <SDL_main.h>
     
    3930int main(int argc, char **argv)
    4031{
    41 #if defined __CELLOS_LV2__
    42     Ps3App app("Quad", ivec2(640, 480), 60.0f);
    43 #elif defined HAVE_GLES_2X
    44     EglApp app("Quad", ivec2(640, 480), 60.0f);
    45 #else
    46     SdlApp app("Quad", ivec2(640, 480), 60.0f);
    47 #endif
     32    Application app("Quad", ivec2(640, 480), 60.0f);
    4833
    49     /* Register an input driver and some debug stuff */
    50 #if !defined HAVE_GLES_2X
    51     new SdlInput();
    52 #endif
     34    /* Register some debug stuff */
    5335    new DebugFps(5, 5);
    5436    new DebugQuad();
Note: See TracChangeset for help on using the changeset viewer.