浏览代码

core: implement Application::ShowPointer() so that applications can choose

whether to use the system mouse pointer or not.
legacy
Sam Hocevar sam 13 年前
父节点
当前提交
8ec5fff6df
共有 6 个文件被更改,包括 18 次插入1 次删除
  1. +5
    -0
      src/application/application.cpp
  2. +1
    -0
      src/application/application.h
  3. +5
    -0
      src/platform/ps3/ps3app.cpp
  4. +1
    -0
      src/platform/ps3/ps3app.h
  5. +5
    -1
      src/platform/sdl/sdlapp.cpp
  6. +1
    -0
      src/platform/sdl/sdlapp.h

+ 5
- 0
src/application/application.cpp 查看文件

@@ -58,6 +58,11 @@ Application::Application(char const *name, ivec2 resolution, float framerate)
data = new ApplicationData(name, resolution, framerate);
}

void Application::ShowPointer(bool show)
{
data->app.ShowPointer(show);
}

void Application::Run()
{
data->app.Run();


+ 1
- 0
src/application/application.h 查看文件

@@ -27,6 +27,7 @@ public:
Application(char const *name, ivec2 resolution, float framerate);
~Application();

void ShowPointer(bool show);
void Run();

private:


+ 5
- 0
src/platform/ps3/ps3app.cpp 查看文件

@@ -109,6 +109,11 @@ Ps3App::Ps3App(char const *title, ivec2 res, float fps) :
#endif
}

void Ps3App::ShowPointer(bool show)
{
;
}

void Ps3App::Run()
{
while (!Ticker::Finished())


+ 1
- 0
src/platform/ps3/ps3app.h 查看文件

@@ -29,6 +29,7 @@ public:
Ps3App(char const *title, ivec2 res, float fps);
virtual ~Ps3App();

void ShowPointer(bool show);
void Run();

private:


+ 5
- 1
src/platform/sdl/sdlapp.cpp 查看文件

@@ -62,7 +62,6 @@ SdlApp::SdlApp(char const *title, ivec2 res, float fps) :
}

SDL_WM_SetCaption(title, NULL);
SDL_ShowCursor(0);

/* Initialise everything */
Ticker::Setup(fps);
@@ -74,6 +73,11 @@ SdlApp::SdlApp(char const *title, ivec2 res, float fps) :
#endif
}

void SdlApp::ShowPointer(bool show)
{
SDL_ShowCursor(show ? 1 : 0);
}

void SdlApp::Run()
{
while (!Ticker::Finished())


+ 1
- 0
src/platform/sdl/sdlapp.h 查看文件

@@ -29,6 +29,7 @@ public:
SdlApp(char const *title, ivec2 res, float fps);
virtual ~SdlApp();

void ShowPointer(bool show);
void Run();

private:


正在加载...
取消
保存