Explorar el Código

ui: add a Platform class to query information about the current platform.

Implement GetMouseCount() to query the number of mice on the system.
legacy
Sam Hocevar sam hace 14 años
padre
commit
f23ce9c7b4
Se han modificado 4 ficheros con 72 adiciones y 0 borrados
  1. +1
    -0
      src/Makefile.am
  2. +1
    -0
      src/core.h
  3. +36
    -0
      src/platform.cpp
  4. +34
    -0
      src/platform.h

+ 1
- 0
src/Makefile.am Ver fichero

@@ -10,6 +10,7 @@ liblol_a_SOURCES = \
world.cpp world.h sample.cpp sample.h sampler.cpp sampler.h \
text.cpp text.h emitter.cpp emitter.h numeric.h hash.cpp hash.h \
worldentity.cpp worldentity.h shader.cpp shader.h image.cpp image.h \
platform.cpp platform.h \
\
sdlapp.cpp sdlapp.h sdlinput.cpp sdlinput.h \
\


+ 1
- 0
src/core.h Ver fichero

@@ -23,6 +23,7 @@

// Static classes
#include "log.h"
#include "platform.h"
#include "video.h"
#include "audio.h"
#include "scene.h"


+ 36
- 0
src/platform.cpp Ver fichero

@@ -0,0 +1,36 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://sam.zoy.org/projects/COPYING.WTFPL for more details.
//

#if defined HAVE_CONFIG_H
# include "config.h"
#endif

#include <cmath>

#include "core.h"

namespace lol
{

/*
* Public Platform class
*/

int Platform::GetMouseCount()
{
#if defined ANDROID_NDK
/* Assume Android devices are touch devices that don't have a mouse */
return 0;
#endif
return 1;
}

} /* namespace lol */


+ 34
- 0
src/platform.h Ver fichero

@@ -0,0 +1,34 @@
//
// Lol Engine
//
// Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://sam.zoy.org/projects/COPYING.WTFPL for more details.
//

//
// The Platform interface
// ----------------------
// Helper functions to set up the platform.
//

#if !defined __LOL_PLATFORM_H__
#define __LOL_PLATFORM_H__

#include <stdint.h>

namespace lol
{

class Platform
{
public:
static int GetMouseCount();
};

} /* namespace lol */

#endif // __LOL_PLATFORM_H__


Cargando…
Cancelar
Guardar