From fc34c84d4ef4a51b49297dabffc8c3aa936c9588 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Dec 2015 16:44:05 +0300 Subject: Move nacl rendering related files into nacl directory. --- src/CMakeLists.txt | 6 ++--- src/Makefile.am | 6 ++--- src/render/graphics.cpp | 4 ++-- src/render/nacl/naclfunctions.h | 35 +++++++++++++++++++++++++++ src/render/nacl/naclgles.cpp | 53 +++++++++++++++++++++++++++++++++++++++++ src/render/nacl/naclgles.h | 32 +++++++++++++++++++++++++ src/render/naclfunctions.h | 35 --------------------------- src/render/naclgles.cpp | 53 ----------------------------------------- src/render/naclgles.h | 32 ------------------------- 9 files changed, 128 insertions(+), 128 deletions(-) create mode 100644 src/render/nacl/naclfunctions.h create mode 100644 src/render/nacl/naclgles.cpp create mode 100644 src/render/nacl/naclgles.h delete mode 100644 src/render/naclfunctions.h delete mode 100644 src/render/naclgles.cpp delete mode 100644 src/render/naclgles.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d4dc28821..89e3cb267 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1034,9 +1034,9 @@ SET(SRCS render/mobileopenglgraphics.h render/modernopenglgraphics.cpp render/modernopenglgraphics.h - render/naclfunctions.h - render/naclgles.cpp - render/naclgles.h + render/nacl/naclfunctions.h + render/nacl/naclgles.cpp + render/nacl/naclgles.h input/mouseinput.h mumblemanager.cpp mumblemanager.h diff --git a/src/Makefile.am b/src/Makefile.am index a69806946..8a26916fb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -539,9 +539,9 @@ SRC += events/actionevent.h \ render/mobileopenglgraphics.h \ render/modernopenglgraphics.cpp \ render/modernopenglgraphics.h \ - render/naclfunctions.h \ - render/naclgles.cpp \ - render/naclgles.h \ + render/nacl/naclfunctions.h \ + render/nacl/naclgles.cpp \ + render/nacl/naclgles.h \ render/opengl/naclglfunctions.h \ render/normalopenglgraphics.cpp \ render/normalopenglgraphics.h \ diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 127a54bc4..a879d96a4 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -81,8 +81,8 @@ #include "resources/safeopenglimagehelper.h" #endif // ANDROID #ifdef __native_client__ -#include "render/naclfunctions.h" -#include "render/naclgles.h" +#include "render/nacl/naclfunctions.h" +#include "render/nacl/naclgles.h" #endif // __native_client__ #endif // USE_OPENGL diff --git a/src/render/nacl/naclfunctions.h b/src/render/nacl/naclfunctions.h new file mode 100644 index 000000000..212970776 --- /dev/null +++ b/src/render/nacl/naclfunctions.h @@ -0,0 +1,35 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_NACL_NACLFUNCTIONS_H +#define RENDER_NACL_NACLFUNCTIONS_H + +#if defined(__native_client__) && defined(USE_OPENGL) + +#include + +extern const struct PPB_Graphics3D_1_0 *graphics3dInterface; +extern PP_Resource gles2Context; + +#define naclResizeBuffers(...) \ + graphics3dInterface->ResizeBuffers(gles2Context, __VA_ARGS__) + +#endif // defined(__native_client__) && defined(USE_OPENGL) +#endif // RENDER_NACL_NACLFUNCTIONS_H diff --git a/src/render/nacl/naclgles.cpp b/src/render/nacl/naclgles.cpp new file mode 100644 index 000000000..44020386d --- /dev/null +++ b/src/render/nacl/naclgles.cpp @@ -0,0 +1,53 @@ +/* + * The ManaPlus Client + * Copyright (C) 2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#if defined(__native_client__) && defined(USE_OPENGL) + +#include "render/nacl/naclgles.h" + +#include "logger.h" + +#include "render/opengl/mglfunctions.h" + +#include + +#include +#include + +#include + +#include "debug.h" + +const struct PPB_OpenGLES2* gles2Interface = nullptr; +PP_Resource gles2Context = nullptr; +const struct PPB_Graphics3D_1_0 *graphics3dInterface = nullptr; + +void NaclGles::initGles() +{ + gles2Interface = static_cast( + PSGetInterface(PPB_OPENGLES2_INTERFACE)); + graphics3dInterface = static_cast( + PSGetInterface(PPB_GRAPHICS_3D_INTERFACE_1_0)); + gles2Context = glGetCurrentContextPPAPI(); + + logger->log("InitGles: %p, %d", gles2Interface, gles2Context); +} + +#endif // defined(__native_client__) && defined(USE_OPENGL) diff --git a/src/render/nacl/naclgles.h b/src/render/nacl/naclgles.h new file mode 100644 index 000000000..cba5d1403 --- /dev/null +++ b/src/render/nacl/naclgles.h @@ -0,0 +1,32 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_NACL_NACLGLES_H +#define RENDER_NACL_NACLGLES_H + +#if defined(__native_client__) && defined(USE_OPENGL) + +namespace NaclGles +{ + void initGles(); +} // namespace NaclGles + +#endif // defined(__native_client__) && defined(USE_OPENGL) +#endif // RENDER_NACL_NACLGLES_H diff --git a/src/render/naclfunctions.h b/src/render/naclfunctions.h deleted file mode 100644 index 940d02015..000000000 --- a/src/render/naclfunctions.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_NACLFUNCTIONS_H -#define RENDER_NACLFUNCTIONS_H - -#if defined(__native_client__) && defined(USE_OPENGL) - -#include - -extern const struct PPB_Graphics3D_1_0 *graphics3dInterface; -extern PP_Resource gles2Context; - -#define naclResizeBuffers(...) \ - graphics3dInterface->ResizeBuffers(gles2Context, __VA_ARGS__) - -#endif // defined(__native_client__) && defined(USE_OPENGL) -#endif // RENDER_NACLFUNCTIONS_H diff --git a/src/render/naclgles.cpp b/src/render/naclgles.cpp deleted file mode 100644 index be8ebc184..000000000 --- a/src/render/naclgles.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#if defined(__native_client__) && defined(USE_OPENGL) - -#include "render/naclgles.h" - -#include "logger.h" - -#include "render/opengl/mglfunctions.h" - -#include - -#include -#include - -#include - -#include "debug.h" - -const struct PPB_OpenGLES2* gles2Interface = nullptr; -PP_Resource gles2Context = nullptr; -const struct PPB_Graphics3D_1_0 *graphics3dInterface = nullptr; - -void NaclGles::initGles() -{ - gles2Interface = static_cast( - PSGetInterface(PPB_OPENGLES2_INTERFACE)); - graphics3dInterface = static_cast( - PSGetInterface(PPB_GRAPHICS_3D_INTERFACE_1_0)); - gles2Context = glGetCurrentContextPPAPI(); - - logger->log("InitGles: %p, %d", gles2Interface, gles2Context); -} - -#endif // defined(__native_client__) && defined(USE_OPENGL) diff --git a/src/render/naclgles.h b/src/render/naclgles.h deleted file mode 100644 index aaa4459d2..000000000 --- a/src/render/naclgles.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_NACLGLES_H -#define RENDER_NACLGLES_H - -#if defined(__native_client__) && defined(USE_OPENGL) - -namespace NaclGles -{ - void initGles(); -} // namespace NaclGles - -#endif // defined(__native_client__) && defined(USE_OPENGL) -#endif // RENDER_NACLGLES_H -- cgit v1.2.3-60-g2f50