Merge branch 'master' into win-64bit

This commit is contained in:
hiker 2017-08-16 17:29:57 +10:00
commit f3d56b37df
703 changed files with 65697 additions and 66369 deletions

View File

@ -1,5 +1,6 @@
environment:
DEPS_DIR: c:\\projects\dependencies
DEPS_BRANCH: master
ASSETS_DIR: c:\\projects\stk-assets
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma2 -mx=9
IRC_NOTIFY_SCRIPT: c:\\projects\stk-code\tools\appveyor-irc-notify.py
@ -11,7 +12,7 @@ shallow_clone: true
platform:
# - x86
- x64
configuration:
- Debug
- Release
@ -27,7 +28,7 @@ install:
- ps: >-
If(!(Test-Path "$env:DEPS_DIR")) {
Write-Host "Downloading dependencies";
Start-Process -FilePath "git" -ArgumentList "clone --branch adv_recording_64 --single-branch --depth 1 https://github.com/supertuxkart/dependencies.git $env:DEPS_DIR" -Wait;
Start-Process -FilePath "git" -ArgumentList "clone --branch $env:DEPS_BRANCH --single-branch --depth 1 https://github.com/supertuxkart/dependencies.git $env:DEPS_DIR" -Wait;
}
Else {
Write-Host "Updating dependencies";

5
.gitignore vendored
View File

@ -56,10 +56,13 @@ android/android-ndk*
android/android-sdk*
android/assets
android/bin
android/obj
android/build
android/libs
android/obj
android/.gradle
android-*
*.apk
*.keystore
lib/curl
lib/freetype

View File

@ -32,12 +32,8 @@ addons:
- libjpeg-dev
- libogg-dev
- libopenal-dev
- libpulse-dev
- libpng-dev
- libturbojpeg
- libvorbis-dev
- libvorbisenc2
- libvpx-dev
- libxrandr-dev
- mesa-common-dev
- pkg-config
@ -57,7 +53,7 @@ before_script:
script:
- mkdir "build"
- cd "build"
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSERVER_ONLY=$SERVER_ONLY -DCHECK_ASSETS=off -DDISABLE_VPX=on
- cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DSERVER_ONLY=$SERVER_ONLY -DCHECK_ASSETS=off -DBUILD_RECORDER=off
- make VERBOSE=1 -j $THREADS
notifications:

View File

@ -1,3 +1,18 @@
## SuperTuxKart 0.9.3
* Reduced RAM and VRAM usage, reducing load times by Auria and Benau
* New kart Wilbert by Jymis
* New kart Hexley by Jymis
* New track Cornfield Crossing by samuncle
* Physics improvements and various physics bugfixes by hiker
* Kart GFX improvements (exhaust and headlight)
* In-game screen recording feature by Benau and Stragus
* Bug fixes on the old render pipeline by Benau and Stragus
* Hardware skinning
* New smoother camera by Auria
* New grand prix win scene
* Gamepad configuration bugfixes
* Various improvements (wall driving fixes, parachutes, GP points, cannon fixes, colorization shader)
## SuperTuxKart 0.9.2
* Ghost replay races by Benau
* Battle mode AI by Benau

View File

@ -1,6 +1,6 @@
# root CMakeLists for the SuperTuxKart project
project(SuperTuxKart)
set(PROJECT_VERSION "0.9.1")
set(PROJECT_VERSION "git")
cmake_minimum_required(VERSION 2.8.4)
if(NOT (CMAKE_MAJOR_VERSION VERSION_LESS 3))
@ -27,14 +27,10 @@ option(SERVER_ONLY "Create a server only (i.e. no graphics or sound)" OFF)
option(USE_FRIBIDI "Support for right-to-left languages" ON)
option(CHECK_ASSETS "Check if assets are installed in ../stk-assets" ON)
option(USE_SYSTEM_ANGELSCRIPT "Use system angelscript instead of built-in angelscript. If you enable this option, make sure to use a compatible version." OFF)
option(ENABLE_NETWORK_MULTIPLAYER "Enable network multiplayer. This will replace the online profile GUI in the main menu with the network multiplayer GUI" OFF)
option(ENABLE_WAYLAND_DEVICE "Enable Wayland device for linux build" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_RECORDER "Build opengl recorder" ON
"NOT SERVER_ONLY;NOT USE_GLES2;NOT APPLE" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_RECORDER_WITH_SOUND "Build opengl recorder with sound" ON
BUILD_RECORDER OFF)
CMAKE_DEPENDENT_OPTION(BUILD_PULSE_WO_DL "If pulseaudio in your distro / system is optional, turn this off to load pulse with libdl"
ON "BUILD_RECORDER_WITH_SOUND;UNIX" OFF)
if (UNIX AND NOT APPLE)
option(USE_GLES2 "Use OpenGL ES2 renderer" OFF)
@ -93,16 +89,6 @@ if(DISABLE_VPX)
add_definitions(-DNO_VPX)
endif()
if(BUILD_RECORDER)
add_definitions(-DENABLE_RECORDER)
if(BUILD_RECORDER_WITH_SOUND)
add_definitions(-DENABLE_REC_SOUND)
if(BUILD_PULSE_WO_DL)
add_definitions(-DENABLE_PULSE_WO_DL)
endif()
endif()
endif()
# Build the Bullet physics library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
@ -118,7 +104,7 @@ if(NOT USE_GLES2 AND NOT SERVER_ONLY)
include_directories("${PROJECT_SOURCE_DIR}/lib/glew/include")
endif()
if((WIN32 AND NOT MINGW) OR APPLE)
if(MSVC OR APPLE)
if (NOT APPLE)
# Build zlib library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/zlib")
@ -129,15 +115,15 @@ if((WIN32 AND NOT MINGW) OR APPLE)
endif()
# Build png library
set (SKIP_INSTALL_ALL TRUE)
set (PNG_STATIC TRUE)
set (PNG_TESTS FALSE)
set (PNG_SHARED FALSE)
set(SKIP_INSTALL_ALL TRUE)
set(PNG_STATIC TRUE CACHE BOOL "Build static lib")
set(PNG_TESTS FALSE CACHE BOOL "Build libpng tests")
set(PNG_SHARED FALSE CACHE BOOL "Build shared lib")
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libpng")
include_directories("${PROJECT_SOURCE_DIR}/lib/libpng")
set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/")
set(PNG_LIBRARY png15_static)
set(PNG_LIBRARY png_static)
endif()
# Add jpeg library
@ -151,23 +137,25 @@ else()
include_directories(${JPEG_INCLUDE_DIR})
endif()
if(BUILD_RECORDER)
find_library(TURBOJPEG_LIBRARY NAMES turbojpeg libturbojpeg PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
mark_as_advanced(TURBOJPEG_LIBRARY)
if(UNIX)
include(FindPkgConfig)
pkg_check_modules(VPX vpx)
if (BUILD_RECORDER)
find_library(OPENGLRECORDER_LIBRARY NAMES openglrecorder libopenglrecorder PATHS "${PROJECT_SOURCE_DIR}/dependencies/lib")
find_path(OPENGLRECORDER_INCLUDEDIR NAMES openglrecorder.h PATHS "${PROJECT_SOURCE_DIR}/dependencies/include")
if (NOT OPENGLRECORDER_LIBRARY OR NOT OPENGLRECORDER_INCLUDEDIR)
if(PROJECT_VERSION STREQUAL "git")
message(WARNING "libopenglrecorder not found, disabling in-game recorder. "
"To use recorder, install libopenglrecorder.")
set(OPENGLRECORDER_LIBRARY CACHE INTERNAL "")
set(OPENGLRECORDER_INCLUDEDIR CACHE INTERNAL "")
set(BUILD_RECORDER OFF)
else()
message(FATAL_ERROR "libopenglrecorder not found. "
"Either install libopenglrecorder or disable in-game recorder with -DBUILD_RECORDER=0")
endif()
else()
find_path(VPX_INCLUDEDIR NAMES vpx/vpx_codec.h PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/include")
find_library(VPX_LIBRARIES NAMES libvpx PATHS "${PROJECT_SOURCE_DIR}/${DEPENDENCIES}/lib")
include_directories(${OPENGLRECORDER_INCLUDEDIR})
mark_as_advanced(OPENGLRECORDER_LIBRARY OPENGLRECORDER_INCLUDEDIR)
add_definitions(-DENABLE_RECORDER)
endif()
include_directories(${VPX_INCLUDEDIR})
if(BUILD_RECORDER_WITH_SOUND AND UNIX)
pkg_check_modules(PULSEAUDIO libpulse)
include_directories(${PULSEAUDIO_INCLUDEDIR})
endif()
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libwebm")
include_directories("${PROJECT_SOURCE_DIR}/lib/libwebm")
endif()
if(NOT SERVER_ONLY AND NOT USE_GLES2)
@ -301,11 +289,6 @@ if(MINGW AND CMAKE_BUILD_TYPE MATCHES Release)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--subsystem,windows")
endif()
# Netwowk Multiplayer
if(ENABLE_NETWORK_MULTIPLAYER)
add_definitions(-DENABLE_NETWORK_MULTIPLAYER_SCREEN)
endif()
if(WIN32)
# By default windows.h has macros defined for min and max that screw up everything
add_definitions(-DNOMINMAX)
@ -436,9 +419,9 @@ target_link_libraries(supertuxkart
if(NOT SERVER_ONLY)
if(NOT USE_GLES2)
target_link_libraries(supertuxkart ${OPENGL_LIBRARIES} glew graphics_utils)
target_link_libraries(supertuxkart ${OPENGL_gl_LIBRARY} glew graphics_utils)
else()
target_link_libraries(supertuxkart EGL GLESv2)
target_link_libraries(supertuxkart GLESv2)
endif()
endif()
@ -454,14 +437,7 @@ if(UNIX AND NOT APPLE)
endif()
if(BUILD_RECORDER)
target_link_libraries(supertuxkart webm ${TURBOJPEG_LIBRARY} ${VPX_LIBRARIES})
if(BUILD_RECORDER_WITH_SOUND AND UNIX)
if(BUILD_PULSE_WO_DL)
target_link_libraries(supertuxkart ${PULSEAUDIO_LIBRARIES})
else()
target_link_libraries(supertuxkart dl)
endif()
endif()
target_link_libraries(supertuxkart ${OPENGLRECORDER_LIBRARY})
endif()
# FreeBSD does not search in /usr/local/lib, but at least Freetype is installed there :(
@ -564,9 +540,9 @@ if(STK_ASSETS_DIR AND CHECK_ASSETS)
install(DIRECTORY ${STK_ASSETS_DIR} DESTINATION ${STK_INSTALL_DATA_DIR}/data PATTERN ".svn" EXCLUDE PATTERN ".git" EXCLUDE)
endif()
install(FILES ${STK_DATA_DIR}/supertuxkart.desktop DESTINATION share/applications)
install(FILES data/supertuxkart_32.png DESTINATION share/icons/hicolor/32x32/apps RENAME supertuxkart.png)
install(FILES data/supertuxkart_48.png DESTINATION share/icons/hicolor/48x48/apps RENAME supertuxkart.png)
install(FILES data/supertuxkart_128.png DESTINATION share/icons/hicolor/128x128/apps RENAME supertuxkart.png)
install(FILES data/supertuxkart_32.png data/supertuxkart_128.png DESTINATION share/pixmaps)
install(FILES data/supertuxkart_48.png DESTINATION share/pixmaps RENAME supertuxkart.png)
install(FILES data/supertuxkart.appdata.xml DESTINATION share/appdata)
if(MINGW)

124
README.md
View File

@ -1,49 +1,51 @@
# SuperTuxKart
[![Build Status](https://travis-ci.org/supertuxkart/stk-code.svg?branch=master)](https://travis-ci.org/supertuxkart/stk-code)
[![AppVeyor Build Satus](https://ci.appveyor.com/api/projects/status/github/supertuxkart/stk-code?svg=true&branch=master)](https://ci.appveyor.com/project/supertuxkart/stk-code)
[![#supertuxkart on freenode](https://img.shields.io/badge/freenode-%23supertuxkart-brightgreen.svg)](https://webchat.freenode.net/?channels=supertuxkart)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/supertuxkart/stk-code?svg=true&branch=master)](https://ci.appveyor.com/project/supertuxkart/stk-code)
[![#supertuxkart on the freenode IRC network](https://img.shields.io/badge/freenode-%23supertuxkart-brightgreen.svg)](https://webchat.freenode.net/?channels=supertuxkart)
SuperTuxKart is a free kart racing game. It focuses on fun and not on realistic kart physics. Instructions can be found on the in-game help page.
The SuperTuxKart homepage can be found at <https://supertuxkart.net/>. There is also our [FAQ](https://supertuxkart.net/FAQ) and information on how get in touch with the [community](https://supertuxkart.net/Community)
## Hardware Requirements
* You need a 3D graphics card. (NVIDIA GeForce 8xxx and higher, ATI Radeon HD 4xxx and higher or Intel HD 3000 and higher.)
* You should have a CPU that's running at 1GHz or better.
To run SuperTuxKart, make sure that your computer's specifications are equal or higher than the following specifications:
* A graphics card capable of 3D rendering - NVIDIA GeForce 8 series and newer (GeForce 8100 or newer), AMD/ATI Radeon HD 4000 series and newer, Intel HD Graphics 3000 and newer. OpenGL >= 3.1
* You should have a CPU that's running at 1 GHz or faster.
* You'll need at least 512 MB of free VRAM (video memory).
* Disk space: 400MB
* Ideally, you want a joystick with at least 6 buttons.
* Minimum disk space: 800 MB
* Ideally, you'll want a joystick with at least 6 buttons.
## License
This software is released under the GNU General Public License (GPL) which can be found in the file [`COPYING`](/COPYING) in the same directory as this file. Information about the licenses for artwork are contained in `data/licenses`.
The software is released under the GNU General Public License (GPL) which can be found in the file [`COPYING`](/COPYING) in the same directory as this file. Information about the licenses for the artwork is contained in `data/licenses`.
## 3D coordinates
A reminder for those looking at the code and 3d models:
A reminder for those who are looking at the code and 3D models:
STK : X right, Y up, Z forwards
SuperTuxKart: X right, Y up, Z forwards
Blender: X right, Y forwards, Z up
The exporters perform the needed transform, so in Blender you just work with XY plane as ground, and things will appear fine in STK (using XZ as ground in the code, obviously).
The export utilities perform the needed transformation, so in Blender you just work with the XY plane as ground, and things will appear fine in STK (using XZ as ground in the code, obviously).
## Building from source
First, you need both the code and the assets (See <https://supertuxkart.net/Source_control> for more information):
In order to build SuperTuxKart from source, you'll need both the code and the assets (See <https://supertuxkart.net/Source_control> for more information):
```
git clone https://github.com/supertuxkart/stk-code
svn checkout https://svn.code.sf.net/p/supertuxkart/code/stk-assets stk-assets
```bash
git clone https://github.com/supertuxkart/stk-code stk-code
svn co https://svn.code.sf.net/p/supertuxkart/code/stk-assets stk-assets
```
## Building on Linux
## Building SuperTuxKart on Linux
### Dependencies
Install the following packages:
To build SuperTuxKart from source, you'll need to install the following packages:
* OpenGL (mesa)
* OpenAL (recommended: openal-soft-devel)
* Ogg (libogg-dev)
* Ogg (libogg-dev)
* Vorbis (libvorbis-dev)
* Freetype (libfreetype6-dev)
* libcurl (libcurl-devel)
@ -54,18 +56,23 @@ Install the following packages:
Ubuntu command:
```
```bash
sudo apt-get install build-essential cmake libbluetooth-dev \
libcurl4-gnutls-dev libfreetype6-dev libfribidi-dev libgl1-mesa-dev \
libjpeg-dev libogg-dev libopenal-dev libpng-dev libvorbis-dev libxrandr-dev \
mesa-common-dev pkg-config zlib1g-dev
```
### In-game recorder
In order to build the in-game recorder for STK, you have to install
libopenglrecorder from your distribution, or compile it yourself from [here](https://github.com/Benau/libopenglrecorder).
Compilation instruction is explained there. If you don't need this feature, pass `-DBUILD_RECORDER=off` to cmake.
### Compiling
Compile SuperTuxKart:
Run the following commands to compile SuperTuxKart:
```
```bash
mkdir cmake_build
cd cmake_build
cmake ..
@ -75,15 +82,15 @@ STK can then be run from the build directory with `bin/supertuxkart`
### Further options
To create a debug version of STK, use:
To create a debug version of STK, run:
```
```bash
cmake .. -DCMAKE_BUILD_TYPE=Debug
```
You can install your build system-wide:
```
```bash
sudo make install
```
@ -94,22 +101,59 @@ location, specify `CMAKE_INSTALL_PREFIX` when running cmake, e.g.:
`cmake .. -DCMAKE_INSTALL_PREFIX=/opt/stk`
## Windows
1. Install VS 2013 (or later). The free express versions work fine.
2. Download and install a source package - either a released package or from our [git/svn repositories](https://supertuxkart.net/Source_control).
3. Download the latest dependency package from [here](https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart%20Dependencies/Windows/). Unzip it in the root directory, so that the dependencies directory is next to the src and data directories (if you are updating from a previous dependency package, you can delete the .dll files in the root directory, they are not needed anymore).
4. Download cmake and install it. Then start cmake-gui and select the STK root directory as 'Where is the source code', and a new directory in the root directory (next to src, data etc) as the build directory (for now I assume that this directory is called bld).
5. Click on configure. You will be asked to create the directory (yes), then for your VS version. Make sure you select the right version (be aware of the easy to confuse version numbers: VS 2013 = version 12). Click on configure, then generate. This will create the directory 'bld', and a VS solution in that directory.
6. In Visual Studio open the project file generated in the 'bld' folder.
7. Right click on the supertuxkart project in the solution explorer, and select "Set as StartUp Project".
8. Select Build->Build Solution (or press F7) to compile.
## Building SuperTuxKart on Windows
To Build SuperTuxKart on Windows, follow these instructions:
## OS X
1. Download and install Visual Studio from here: [Visual Studio - Download](https://www.visualstudio.com/downloads/). The free Visual Studio Community edition works fine.
2. Download the SuperTuxKart source package from either [SuperTuxKart download area - SourceForge.net](https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart/0.9.2) or [SuperTuxKart.net - Source Control](https://supertuxkart.net/Source_control), and unpack it.
*Note: If you downloaded the source package from here: [SuperTuxKart.net - Source Control](https://supertuxkart.net/Source_control), then both `stk-code` and `stk-assets` **must** be in the same directory, otherwise the build can result in failure*
3. Download the Windows dependencies package from either [SuperTuxKart download area: Dependecies - SourceForge.net](https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart%20Dependencies/Windows/)
or [SuperTuxKart on GitHub - Dependencies](https://github.com/supertuxkart/dependencies), and unpack it; then, copy the `dependencies` directory from either the `windows` or the `windows_64bit` directories into the `stk-code` directory
4. Download CMake from here: [CMake - download page](https://cmake.org/download/), install it; once CMake is installed, double click on the CMake icon on your desktop, and point it towards your `stk-code` directory in the 'Where is the source code' field, and point it to a directory called `build` or `bld`
5. Press 'Configure'; CMake will ask you if it is OK to create the aformentioned directory, press `Yes`. CMake will then ask you about your version of Visual Studio.
Confirm your selection; *Please look at the table below to avoid confusion between version numbers and releases of Visual Studio*;
CMake will begin creating the required files for the build in the directory.
6. Navigate to your build directory and open the `SuperTuxKart.sln` file; Visual Studio will now load the solution.
7. In the 'Solution Explorer', right click on the `supertuxkart` project and select "Set as StartUp project"
8. Open the 'Build' menu and select 'Build Solution'; or, press the default keyboard shortcut: `CTRL + SHIFT + B` to build the solution.
*Note: To avoid confusion between releases and versions, refer to this table:*
Visual Studio Release | Version
----------------------|------------
Visual Studio 2017| 15
Visual Studio 2015| 14
Visual Studio 2013| 13
## Building SuperTuxKart on Windows (from PowerShell/Command line)
1. Download and install Visual Studio from here: [Visual Studio - Download](https://www.visualstudio.com/downloads/), the free Visual Studio Community edition works fine.
2. Download a source package from either [SuperTuxKart 0.9.2 download area - SourceForge.net](https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart/0.9.2) or [SuperTuxKart.net - Source Control](https://supertuxkart.net/Source_control)
NOTE: the `stk-code` and `stk-assets` directories **must** be in the same directory
3. Download the Windows dependencies package from either [SuperTuxKart download area - SourceForge.net](https://sourceforge.net/projects/supertuxkart/files/SuperTuxKart%20Dependencies/Windows/)
or [SuperTuxKart on GitHub - Dependencies](https://github.com/supertuxkart/dependencies)
and unpack the archive; once unpacked, copy the `dependencies` directory from either the `windows` or the `windows_64bit` directories into the `stk-code` directory
4. Download CMake from here: [CMake - download page](https://cmake.org/download/); and install it. Navigate to the `stk-code` directory; and create an directory called "build":
```cmd
mkdir build
cd build
```
5. Once inside the build directory; run CMake to start the compilation process:
```cmd
cmake ..
```
6. Now that CMake finished configuring and creating the necessary files for the build, run the build command in the same directory:
```cmd
msbuild.exe SuperTuxKart.sln
```
SuperTuxKart can now be run as `bin\Debug\supertuxkart.exe` or `bin\Release\supertuxkart.exe`
## Building SuperTuxKart on macOS
### Getting Started
Install developer tools, either from the OS X Install DVD or from Apple's website.
Install the developer tools, either from the OS X Install DVD or from Apple's website.
If you have never built anything before, you have create `/usr/local/include/` first:
@ -144,23 +188,23 @@ You'll have to run these commands inside your stk-code directory.
With clang:
```
```bash
mkdir cmake_build
cd cmake_build
cmake ..
make
```
With GCC :
```
With GCC:
```bash
mkdir cmake_build
cd cmake_build
cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_C_COMPILER=/usr/bin/gcc
make
```
Building on 10.10 with 10.9 compat
```
Building on 10.10 with 10.9 compatibility:
```bash
cmake .. -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
```
@ -174,7 +218,7 @@ mkdir xcode_build && cd xcode_build
cmake .. -GXcode
```
Use Finder to navigate to your stk-code/xcode_build folder and open the newly generated Xcode project (SuperTuxKart.xcodeproj).
Use Finder to navigate to your stk-code/xcode_build folder and open the newly generated Xcode project (`SuperTuxKart.xcodeproj`).
You can then build the project in Xcode using Product -> Build

View File

@ -31,7 +31,8 @@ after some tweaks, but atm. only linux is supported.
Dependencies list (may be incomplete):
autoconf, automake, make, python, ant, imagemagick, cmake, vorbis-tools
autoconf, automake, make, python, gradle, ant, imagemagick, cmake,
vorbis-tools
Additionally some dependencies for optimize_data script:
@ -43,13 +44,12 @@ and extract it to stk-code/lib. It contains sources of libraries that are used
in STK, but are not availiable in stk-code repository (curl, freetype, openal).
You need also Android SDK for android-19 platform (the API for Android 4.4) and
Android NDK (versions r12b and r13b have been tested).
Android NDK r12b.
You need to create proper "android-sdk" and "android-ndk" symlinks in the
directory with Android project, so that the compilation script will have access
to the SDK and NDK.
These paths can be also set in SDK_PATH and NDK_PATH environmental variables.
to the SDK and NDK. These paths can be also set in SDK_PATH and NDK_PATH
environmental variables.
Before running the compilation, run the generate_assets script, so that
selected assets will be copied to "assets" directory, and then included in the
@ -74,6 +74,14 @@ You can choose build type by setting BUILD_TYPE environment variable to "debug"
or "release". The default is debug build. Note that if you choose release build,
you have to manually sign the apk with your key and run zipalign.
Additionally you can choose the build tool by setting BUILD_TOOL environment
variable to "gradle" or "ant". Note that ant has been already removed from
Android SDK, so you have to use SDK <= 25.2.5 for building with ant. By default
the BUILD_TOOL is set to "gradle".
You can override the SDK build-tools version by setting the BUILD_TOOLS_VER
environment variable.
Basically if all dependencies are installed in the system, it should be enough
to just run:
@ -84,6 +92,59 @@ to just run:
--------------------------------------------------------------------------------
RELEASE BUILD
--------------------------------------------------------------------------------
Making a release build is similar to typical compilation, but there are few
additional things to do.
You have to change version numbers. This is important, because assets manager
in STK checks these numbers and detects if already extracted data files are
up to date. So that when you will install new STK version, this will force new
data extraction automatically.
So that you have to:
1. Change "data/supertuxkart.git" to "data/supertuxkart.VERSION_NUMBER"
2. Open "src/utils/constants.cpp" and change:
const char STK_VERSION[] = "git";
to
const char STK_VERSION[] = "VERSION_NUMBER";
where "VERSION_NUMBER" is for example "0.9.3" or "git20170409" or whatever.
3. You can also update these lines in "android/AndroidManifest.xml":
android:versionCode="1"
android:versionName="1.0"
Before compilation you have to set:
export BUILD_TYPE=release
and then you make standard compilation with:
./generate_assets.sh
./make.sh -j5
The compiled apk is unsigned, so you have to sign it with your key. To sign it,
you have to run:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore \
my-release-key.keystore SuperTuxKart-release-unsigned.apk alias_name
and then:
zipalign -v 4 SuperTuxKart-release-unsigned.apk SuperTuxKart-release.apk
--------------------------------------------------------------------------------
KNOWN ISSUES
--------------------------------------------------------------------------------
@ -105,18 +166,14 @@ to just run:
It seems to affect only Android 5.0. More information about the crash:
https://code.google.com/p/android/issues/detail?id=160824
4. STK crashes on Qualcomm with Adreno 305 when trying to draw menu interface.
Backtrace shows glDrawElements function, and internally crashed in vbo
allocation.
5. STK crashes on startup on some devices when aarch64 build is made using
4. STK crashes on startup on some devices when aarch64 build is made using
Android r13 NDK. The r13 version has rather big modifications (it uses clang
instead of gcc by default). This is probably a bug in NDK/compiler/OS, but
for this reason using NDK r12 for 64-bit arm compilation is preferred.
6. Angelscript doesn't have full support for aarch64 builds, so that scripting
5. Angelscript doesn't have full support for aarch64 builds, so that scripting
won't work on this platform.
7. Turning left/right using accelerometer is available, but at this stage the
6. Turning left/right using accelerometer is available, but at this stage the
default screen orientation is not automatically detected and user must
manually choose if he needs "phone" or "tablet" accelerometer.

31
android/build.gradle Normal file
View File

@ -0,0 +1,31 @@
buildscript
{
repositories
{
jcenter()
}
dependencies
{
classpath 'com.android.tools.build:gradle:2.2.3'
}
}
apply plugin: 'com.android.application'
android
{
compileSdkVersion sdk_version.toInteger()
buildToolsVersion build_tools_ver
sourceSets
{
main
{
manifest.srcFile 'AndroidManifest.xml'
jniLibs.srcDirs = ['libs']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
}
}

View File

@ -5,22 +5,25 @@
# A script that generates data files for Android apk
# Below are simple configuration variables
# Below you can find some simple configuration variables.
# It's allowed to set "all" for KARTS and TRACKS if it's intended to create
# package with full data.
# The karts and tracks directories shouldn't exist in ASSETS_DIRS variable
# because they are handled separately
# because they are handled separately.
# The TEXTURE_SIZE and SOUND_QUALITY take effect only if DECREASE_QUALITY has
# value greater than 0
# value greater than 0.
# The CONVERT_TO_JPG variable enables converting all images that are safe to
# convert and keeps other images untouched.
# The script needs imagemagick and ogg utils installed to use DECREASE_QUALITY
# feature
################################################################################
export KARTS="tux nolok xue"
export KARTS="elephpant gnu nolok pidgin suzanne tux xue"
export TRACKS="battleisland cornfield_crossing featunlocked gplose gpwin \
hacienda introcutscene introcutscene2 lighthouse olivermath \
overworld snowmountain snowtuxpeak soccer_field tutorial"
overworld sandtrack scotland snowmountain snowtuxpeak \
soccer_field tutorial"
export ASSETS_PATHS="../data \
../../stk-assets \
@ -29,12 +32,17 @@ export ASSETS_PATHS="../data \
export ASSETS_DIRS="library models music sfx textures"
export TEXTURE_SIZE=256
export JPEG_QUALITY=85
export PNG_QUALITY=95
export SOUND_QUALITY=42
export SOUND_MONO=1
export SOUND_SAMPLE=32000
export RUN_OPTIMIZE_SCRIPT=0
export DECREASE_QUALITY=1
export CONVERT_TO_JPG=1
export BLACKLIST_FILES="data/music/cocoa_river_fast.ogg2"
################################################################################
@ -158,6 +166,7 @@ convert_image()
fi
FILE="$1"
FILE_TYPE="$2"
W=`identify -format "%[fx:w]" "$FILE"`
H=`identify -format "%[fx:h]" "$FILE"`
@ -167,19 +176,36 @@ convert_image()
return
fi
if [ $W -le $TEXTURE_SIZE ] && [ $H -le $TEXTURE_SIZE ]; then
return
if [ $W -gt $TEXTURE_SIZE ] || [ $H -gt $TEXTURE_SIZE ]; then
if [ $W -gt $H ]; then
SCALED_W=$TEXTURE_SIZE
SCALED_H=$(($TEXTURE_SIZE * $H / $W))
else
SCALED_W=$(($TEXTURE_SIZE * $W / $H))
SCALED_H=$TEXTURE_SIZE
fi
SCALE_CMD="-scale ${SCALED_W}x${SCALED_H}"
fi
if [ $W -gt $H ]; then
SCALED_W=$TEXTURE_SIZE
SCALED_H=$(($TEXTURE_SIZE * $H / $W))
else
SCALED_W=$(($TEXTURE_SIZE * $W / $H))
SCALED_H=$TEXTURE_SIZE
if [ "$FILE_TYPE" = "jpg" ]; then
QUALITY_CMD="-quality $JPEG_QUALITY"
elif [ "$FILE_TYPE" = "png" ]; then
QUALITY_CMD="-quality $PNG_QUALITY"
fi
convert -scale $SCALED_WE\x$SCALED_H "$FILE" "$FILE"
convert $SCALE_CMD $QUALITY_CMD "$FILE" "tmp.$FILE_TYPE"
if [ -s "tmp.$FILE_TYPE" ]; then
SIZE_OLD=`du -k "$FILE" | cut -f1`
SIZE_NEW=`du -k "tmp.$FILE_TYPE" | cut -f1`
if [ $SIZE_NEW -lt $SIZE_OLD ]; then
mv "tmp.$FILE_TYPE" "$FILE"
fi
fi
rm -f "tmp.$FILE_TYPE"
}
convert_sound()
@ -195,20 +221,20 @@ convert_sound()
if [ -s tmp.wav ]; then
OGGENC_CMD=""
if [ "$SOUND_MONO" -gt 0 ]; then
OGGENC_CMD="$OGGENC_CMD --downmix"
fi
OGG_RATE=`ogginfo "$FILE" | grep "Rate: " | cut -f 2 -d " " \
| grep -o '[0-9]*'`
if [ ! -z "$OGG_RATE" ] && [ "$OGG_RATE" -gt "32000" ]; then
OGGENC_CMD="$OGGENC_CMD --resample 32000"
if [ ! -z "$OGG_RATE" ] && [ "$OGG_RATE" -gt "$SOUND_SAMPLE" ]; then
OGGENC_CMD="$OGGENC_CMD --resample $SOUND_SAMPLE"
fi
OGGENC_CMD="$OGGENC_CMD -b $SOUND_QUALITY"
oggenc $OGGENC_CMD tmp.wav -o tmp.ogg
fi
@ -224,18 +250,269 @@ convert_sound()
rm -f tmp.wav tmp.ogg
}
convert_model()
{
if [ -z "$1" ]; then
echo "No texture path provided"
return
fi
TEXTURE_PATH="$1"
#echo " Texture: $TEXTURE_NAME"
ALREADY_CONVERTED=0
if [ -s "./converted_textures" ]; then
while read -r CONVERTED_TEXTURE; do
if [ "$TEXTURE_PATH" = "$CONVERTED_TEXTURE" ]; then
ALREADY_CONVERTED=1
break
fi
done < "./converted_textures"
fi
if [ $ALREADY_CONVERTED -eq 0 ]; then
if [ ! -f "$TEXTURE_PATH" ]; then
#echo " Couldn't find texture file. Ignore..."
continue
fi
FILE_EXTENSION=`echo "$TEXTURE_PATH" | tail -c 5`
if [ `echo "$FILE_EXTENSION" | head -c 1` != "." ]; then
#echo " Unsupported file extension. Ignore..."
continue
fi
FILE_FORMAT=`identify -format %m "$TEXTURE_PATH"`
if [ "$FILE_FORMAT" = "JPEG" ]; then
#echo " File is already JPEG. Ignore..."
continue
fi
#IS_OPAQUE=`identify -format '%[opaque]' "$TEXTURE_PATH"`
HAS_ALPHA=`identify -format '%A' "$TEXTURE_PATH"`
if [ "$HAS_ALPHA" = "True" ] || [ "$HAS_ALPHA" = "true" ]; then
#echo " File has alpha channel. Ignore..."
continue
fi
NEW_TEXTURE_NAME="`echo $TEXTURE_NAME | head -c -5`.jpg"
NEW_TEXTURE_PATH="`echo $TEXTURE_PATH | head -c -5`.jpg"
if [ -f "$NEW_TEXTURE_PATH" ]; then
#echo " There is already a file with .jpg extension. Ignore..."
continue
fi
convert -quality $JPEG_QUALITY "$TEXTURE_PATH" "$NEW_TEXTURE_PATH"
rm -f "$TEXTURE_PATH"
if [ -s "$DIRNAME/materials.xml" ]; then
sed -i "s/name=\"$TEXTURE_NAME\"/name=\"$NEW_TEXTURE_NAME\"/g" \
"$DIRNAME/materials.xml"
fi
if [ -s "$DIRNAME/scene.xml" ]; then
sed -i "s/name=\"$TEXTURE_NAME\"/name=\"$NEW_TEXTURE_NAME\"/g" \
"$DIRNAME/scene.xml"
fi
echo "$TEXTURE_PATH" >> "./converted_textures"
fi
echo -n ".jpg" | dd of=./tmp bs=1 seek=$(($TEXNAME_END - 4)) \
conv=notrunc 2> /dev/null
SIZE_OLD=`du -b "$FILE" | cut -f1`
SIZE_NEW=`du -b "tmp" | cut -f1`
if [ $SIZE_NEW -ne $SIZE_OLD ]; then
echo " Something went wrong..."
exit
fi
}
convert_b3d()
{
if [ -z "$1" ]; then
echo "No file to convert"
return
fi
FILE="$1"
echo "Convert file: $FILE"
if [ ! -f "$FILE" ]; then
echo " File doesn't exist."
return
fi
HEX_FILE=`hexdump -ve '1/1 "%.2x"' "$FILE"`
TEXS_CHUNK="54455853"
TEXS_CHUNK_POS=24
FOUND_CHUNK=`echo $HEX_FILE | head -c $(($TEXS_CHUNK_POS + 8)) \
| tail -c +$(($TEXS_CHUNK_POS + 1))`
if [ -z "$FOUND_CHUNK" ] || [ "$FOUND_CHUNK" != "$TEXS_CHUNK" ]; then
echo " Unsupported format."
return
fi
TEXS_SIZE=`echo $HEX_FILE | head -c $(($TEXS_CHUNK_POS + 16)) | tail -c 8`
TEXS_SIZE_CONVERTED=`echo $TEXS_SIZE | cut -c7-8`
TEXS_SIZE_CONVERTED=$TEXS_SIZE_CONVERTED`echo $TEXS_SIZE | cut -c5-6`
TEXS_SIZE_CONVERTED=$TEXS_SIZE_CONVERTED`echo $TEXS_SIZE | cut -c3-4`
TEXS_SIZE_CONVERTED=$TEXS_SIZE_CONVERTED`echo $TEXS_SIZE | cut -c1-2`
TEXS_SIZE_CONVERTED=`echo $((0x$TEXS_SIZE_CONVERTED))`
if [ $TEXS_SIZE_CONVERTED -le 0 ]; then
echo " Invalid TEXS size value."
return
fi
TEXS_BEGIN=$(($TEXS_CHUNK_POS + 16))
TEXS_END=$(($TEXS_BEGIN + $TEXS_SIZE_CONVERTED * 2))
HEX_TEXS=`echo $HEX_FILE | head -c $TEXS_END | tail -c +$(($TEXS_BEGIN+1))`
CURR_POS=0
cp "$FILE" tmp
while [ $CURR_POS -lt $TEXS_END ]; do
NULL_POS=`echo $HEX_TEXS | tail -c +$(($CURR_POS+1)) | grep -b -o "00" \
| head -n 1 | cut -f1 -d":"`
if [ -z $NULL_POS ]; then
#echo " Done."
break
fi
if [ $NULL_POS -lt 4 ]; then
echo " Something went wrong..."
break
fi
TEXNAME_BEGIN=$((($TEXS_BEGIN + $CURR_POS) / 2))
TEXNAME_END=$((($TEXS_BEGIN + $CURR_POS + $NULL_POS) / 2))
CURR_POS=$(($CURR_POS + $NULL_POS + 58))
TEXTURE_NAME=`dd if="$FILE" bs=1 skip=$TEXNAME_BEGIN \
count=$(($TEXNAME_END - $TEXNAME_BEGIN)) 2> /dev/null`
DIRNAME=`dirname "$FILE"`
TEXTURE_PATH="$DIRNAME/$TEXTURE_NAME"
convert_model "$TEXTURE_PATH"
done
mv tmp "$FILE"
}
convert_spm()
{
if [ -z "$1" ]; then
echo "No file to convert"
return
fi
FILE="$1"
echo "Convert file: $FILE"
if [ ! -f "$FILE" ]; then
echo " File doesn't exist."
return
fi
HEX_FILE=`hexdump -ve '1/1 "%.2x"' "$FILE"`
SP_HEADER="5350"
SP_FOUND=`echo $HEX_FILE | head -c 4`
if [ -z "$SP_FOUND" ] || [ "$SP_FOUND" != "$SP_HEADER" ]; then
echo " Unsupported format."
return
fi
TEXS_BEGIN=60
TEXS_COUNT=`echo $HEX_FILE | head -c $TEXS_BEGIN | tail -c 4`
TEXS_COUNT_CONVERTED=`echo $TEXS_COUNT | cut -c3-4`
TEXS_COUNT_CONVERTED=$TEXS_COUNT_CONVERTED`echo $TEXS_COUNT | cut -c1-2`
TEXS_COUNT_CONVERTED=`echo $((0x$TEXS_COUNT_CONVERTED))`
TEXS_COUNT_CONVERTED=$(($TEXS_COUNT_CONVERTED * 2))
if [ $TEXS_COUNT_CONVERTED -le 0 ]; then
echo " Invalid textures count value."
return
fi
CURR_POS=$(($TEXS_BEGIN + 2))
cp "$FILE" tmp
while [ $TEXS_COUNT_CONVERTED -gt 0 ]; do
TEXS_COUNT_CONVERTED=$(($TEXS_COUNT_CONVERTED - 1))
TEX_LEN=`echo $HEX_FILE | head -c $(($CURR_POS)) | tail -c 2`
TEX_LEN=`echo $((0x$TEX_LEN))`
TEXNAME_BEGIN=$(($CURR_POS / 2))
TEXNAME_END=$(($CURR_POS / 2 + $TEX_LEN))
CURR_POS=$(($CURR_POS + 2 + $TEX_LEN * 2))
if [ $TEX_LEN -eq 0 ]; then
#echo " Empty texture name, ignore..."
continue
fi
TEXTURE_NAME=`dd if="$FILE" bs=1 skip=$TEXNAME_BEGIN \
count=$(($TEXNAME_END - $TEXNAME_BEGIN)) 2> /dev/null`
DIRNAME=`dirname "$FILE"`
TEXTURE_PATH="$DIRNAME/$TEXTURE_NAME"
convert_model "$TEXTURE_PATH"
done
mv tmp "$FILE"
}
if [ $DECREASE_QUALITY -gt 0 ]; then
find assets/data -iname "*.png" | while read f; do convert_image "$f"; done
find assets/data -iname "*.jpg" | while read f; do convert_image "$f"; done
find assets/data -iname "*.png" | while read f; do convert_image "$f" "png"; done
find assets/data -iname "*.jpg" | while read f; do convert_image "$f" "jpg"; done
find assets/data -iname "*.ogg" | while read f; do convert_sound "$f"; done
fi
if [ $CONVERT_TO_JPG -gt 0 ]; then
find assets/data -iname "*.b3d" | while read f; do convert_b3d "$f"; done
find assets/data -iname "*.spm" | while read f; do convert_spm "$f"; done
if [ -s "./converted_textures" ]; then
echo "Converted textures:"
cat "./converted_textures"
rm -f "./converted_textures"
fi
fi
# Copy data directory
echo "Copy data directory"
cp -a ../data/* assets/data/
# Remove unused files
for BLACKLIST_FILE in $BLACKLIST_FILES; do
rm -f "assets/$BLACKLIST_FILE"
done
# Run optimize_data.sh script
if [ $RUN_OPTIMIZE_SCRIPT -gt 0 ]; then
echo "Run optimize_data.sh script"

View File

@ -22,16 +22,19 @@ export NDK_ABI_ARMV7=armeabi-v7a
export ARCH_ARMV7=arm
export HOST_ARMV7=arm-linux-androideabi
export NDK_PLATFORM_ARMV7=android-19
export SDK_VERSION_ARMV7=19
export NDK_ABI_X86=x86
export ARCH_X86=x86
export HOST_X86=i686-linux-android
export NDK_PLATFORM_X86=android-19
export SDK_VERSION_X86=19
export NDK_ABI_AARCH64=arm64-v8a
export ARCH_AARCH64=arm64
export HOST_AARCH64=aarch64-linux-android
export NDK_PLATFORM_AARCH64=android-21
export SDK_VERSION_AARCH64=21
# A helper function that checks if error ocurred
@ -46,8 +49,10 @@ check_error()
# Handle clean command
if [ ! -z "$1" ] && [ "$1" = "clean" ]; then
rm -rf bin
rm -rf build
rm -rf libs
rm -rf obj
rm -rf .gradle
exit
fi
@ -75,16 +80,19 @@ if [ "$COMPILE_ARCH" = "armv7" ]; then
export NDK_ABI=$NDK_ABI_ARMV7
export ARCH=$ARCH_ARMV7
export HOST=$HOST_ARMV7
export SDK_VERSION=$SDK_VERSION_ARMV7
elif [ "$COMPILE_ARCH" = "x86" ]; then
export NDK_PLATFORM=$NDK_PLATFORM_X86
export NDK_ABI=$NDK_ABI_X86
export ARCH=$ARCH_X86
export HOST=$HOST_X86
export SDK_VERSION=$SDK_VERSION_X86
elif [ "$COMPILE_ARCH" = "aarch64" ]; then
export NDK_PLATFORM=$NDK_PLATFORM_AARCH64
export NDK_ABI=$NDK_ABI_AARCH64
export ARCH=$ARCH_AARCH64
export HOST=$HOST_AARCH64
export SDK_VERSION=$SDK_VERSION_AARCH64
else
echo "Unknow COMPILE_ARCH: $COMPILE_ARCH. Possible values are: " \
"armv7, aarch64, x86"
@ -97,10 +105,12 @@ if [ -z "$BUILD_TYPE" ]; then
fi
if [ "$BUILD_TYPE" = "debug" ] || [ "$BUILD_TYPE" = "Debug" ]; then
export BUILD_TYPE="debug"
export ANT_BUILD_TYPE="debug"
export GRADLE_BUILD_TYPE="assembleDebug"
export IS_DEBUG_BUILD=1
elif [ "$BUILD_TYPE" = "release" ] || [ "$BUILD_TYPE" = "Release" ]; then
export BUILD_TYPE="release"
export ANT_BUILD_TYPE="release"
export GRADLE_BUILD_TYPE="assembleRelease"
export IS_DEBUG_BUILD=0
else
echo "Unsupported BUILD_TYPE: $BUILD_TYPE. Possible values are: " \
@ -108,6 +118,17 @@ else
exit
fi
# Check selected build tool
if [ -z "$BUILD_TOOL" ]; then
BUILD_TOOL="gradle"
fi
if [ "$BUILD_TOOL" != "gradle" ] && [ "$BUILD_TOOL" != "ant" ]; then
echo "Unsupported BUILD_TOOL: $BUILD_TOOL. Possible values are: " \
"gradle, ant"
exit
fi
# Check if we have access to the Android NDK and SDK
if [ -z "$NDK_PATH" ]; then
export NDK_PATH="$NDK_PATH_DEFAULT"
@ -134,6 +155,24 @@ if [ ! -d "$SDK_PATH" ]; then
exit
fi
# Find newest build-tools version
if [ -z "$BUILD_TOOLS_VER" ]; then
BUILD_TOOLS_DIRS=`ls -1 "$SDK_PATH/build-tools" | sort -V -r`
for DIR in $BUILD_TOOLS_DIRS; do
if [ "$DIR" = `echo $DIR | sed 's/[^0-9,.]//g'` ]; then
BUILD_TOOLS_VER="$DIR"
break
fi
done
fi
if [ -z "$BUILD_TOOLS_VER" ] || [ ! -d "$SDK_PATH/build-tools/$BUILD_TOOLS_VER" ]; then
echo "Error: Couldn't detect build-tools version."
exit
fi
# Standalone toolchain
if [ ! -f "$DIRNAME/obj/make_standalone_toolchain.stamp" ]; then
echo "Creating standalone toolchain"
@ -302,5 +341,16 @@ check_error
# Build apk
echo "Building APK"
ant $BUILD_TYPE -Dsdk.dir="$SDK_PATH" -Dtarget=$NDK_PLATFORM
if [ "$BUILD_TOOL" = "gradle" ]; then
export ANDROID_HOME="$SDK_PATH"
gradle -Psdk_version=$SDK_VERSION \
-Pbuild_tools_ver="$BUILD_TOOLS_VER" \
$GRADLE_BUILD_TYPE
elif [ "$BUILD_TOOL" = "ant" ]; then
ant -Dsdk.dir="$SDK_PATH" \
-Dtarget=$NDK_PLATFORM \
$ANT_BUILD_TYPE
fi
check_error

View File

@ -9,8 +9,11 @@ SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# figure out folder to look in
execute_process(COMMAND sh -c "ls /usr/lib/gcc/x86_64-w64-mingw32/ | grep posix | tr -d '\n'" OUTPUT_VARIABLE MINGW_DEPS_FOLDER)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/${DEPENDENCIES})
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 /usr/lib/gcc/x86_64-w64-mingw32/${MINGW_DEPS_FOLDER}/ ${PROJECT_SOURCE_DIR}/dependencies)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search

View File

@ -9,8 +9,11 @@ SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
SET(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# figure out folder to look in
execute_process(COMMAND sh -c "ls /usr/lib/gcc/i686-w64-mingw32/ | grep posix | tr -d '\n'" OUTPUT_VARIABLE MINGW_DEPS_FOLDER)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 /usr/lib/gcc/i686-w64-mingw32/4.9-posix ${PROJECT_SOURCE_DIR}/${DEPENDENCIES})
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 /usr/lib/gcc/i686-w64-mingw32/${MINGW_DEPS_FOLDER}/ ${PROJECT_SOURCE_DIR}/dependencies)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search

View File

@ -191,6 +191,7 @@ Voice acting
Sound effects
- Mike Koening and soundbible.com
- The Audio Monkey ( http://www.theaudiomonkey.co.uk )
- Battle For Wesnoth
- Iwan 'qubodup' Gabovitch
- The Trigger-Rally project

View File

@ -37,5 +37,6 @@
<card contains="ATI" os="windows" version="<=3.1.8787" disable="ForceLegacyDevice"/>
<card os="android" disable="TextureFormatBGRA8888"/>
<card os="android" disable="ColorBufferFloat"/>
<card contains="Adreno" os="android" version="<=19" disable="VertexIdWorking"/>
<card contains="Android Emulator" os="android" disable="ForceLegacyDevice"/>
</graphical-restrictions>

View File

@ -20,7 +20,7 @@
<box proportion="1" width="100%" layout="vertical-row">
<spacer width="5" height="15"/>
<button id="startTutorial" text="Click here to play the tutorial" align="center"/>
<button id="startTutorial" text="Start the tutorial" align="center"/>
<spacer width="5" height="15"/>
<div width="100%" proportion="2" layout="horizontal-row">

View File

@ -15,6 +15,14 @@
</div>
</div>
<div width="75%" layout="horizontal-row" proportion="1">
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Inverted buttons"/>
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
<spacer width="40" height="10" />
<checkbox id="buttons_inverted"/>
</div>
</div>
<div width="75%" layout="horizontal-row" proportion="1">
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Buttons scale"/>
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
@ -23,29 +31,11 @@
</div>
</div>
<label width="100%" I18N="In the multitouch settings screen" text="Accelerometer"/>
<div width="75%" layout="horizontal-row" proportion="1">
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Disabled"/>
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Accelerometer"/>
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
<spacer width="40" height="10" />
<checkbox id="accelerometer_disabled"/>
</div>
</div>
<div width="75%" layout="horizontal-row" proportion="1">
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Phone"/>
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
<spacer width="40" height="10" />
<checkbox id="accelerometer_phone"/>
</div>
</div>
<div width="75%" layout="horizontal-row" proportion="1">
<label proportion="1" align="center" text_align="right" I18N="In the multitouch settings screen" text="Tablet"/>
<div proportion="1" align="center" height="fit" layout="horizontal-row" >
<spacer width="40" height="10" />
<checkbox id="accelerometer_tablet"/>
<spinner id="accelerometer" proportion="1"/>
</div>
</div>

View File

@ -1,10 +1,12 @@
uniform sampler2D tex;
in vec2 uv;
in vec4 vertex_color;
out vec4 FragColor;
void main(void)
{
vec4 color = texture(tex, uv);
color *= vertex_color;
FragColor = vec4(color.a * color.rgb, color.a);
}

View File

@ -1,4 +1,4 @@
uniform mat4 ModelViewMatrix;
uniform mat4 color_matrix;
uniform vec3 Position;
uniform vec2 Size;
@ -11,10 +11,12 @@ in vec2 Texcoord;
#endif
out vec2 uv;
out vec4 vertex_color;
void main(void)
{
uv = Texcoord;
vec4 Center = ModelViewMatrix * vec4(Position, 1.);
vec4 Center = ViewMatrix * vec4(Position, 1.);
gl_Position = ProjectionMatrix * (Center + vec4(Size * Corner, 0., 0.));
vertex_color = color_matrix[gl_VertexID];
}

View File

@ -6,11 +6,11 @@ uniform vec2 texsize;
#ifdef Explicit_Attrib_Location_Usable
layout(location=0) in vec2 Position;
layout(location=3) in vec2 Texcoord;
layout(location=2) in uvec4 Color;
layout(location=2) in vec4 Color;
#else
in vec2 Position;
in vec2 Texcoord;
in uvec4 Color;
in vec4 Color;
#endif
out vec2 uv;
@ -18,7 +18,7 @@ out vec4 col;
void main()
{
col = vec4(Color) / 255.;
col = Color.zyxw;
uv = Texcoord * texsize + texcenter;
gl_Position = vec4(Position * size + center, 0., 1.);
}

View File

@ -20,7 +20,7 @@ out vec2 uv;
void main()
{
vec3 test = sin(windDir * (Position.y* 0.5)) * 0.5;
vec3 test = sin(windDir * (Position.y * 0.1)) * 1.;
test += cos(windDir) * 0.7;
mat4 new_model_matrix = ModelMatrix;

View File

@ -1,11 +1,9 @@
#ifdef Use_Bindless_Texture
layout(bindless_sampler) uniform sampler2D Albedo;
layout(bindless_sampler) uniform sampler2D dtex;
layout(bindless_sampler) uniform sampler2D SpecMap;
layout(bindless_sampler) uniform sampler2D colorization_mask;
#else
uniform sampler2D Albedo;
uniform sampler2D dtex;
uniform sampler2D SpecMap;
uniform sampler2D colorization_mask;
#endif
@ -36,25 +34,8 @@ void main(void)
vec2 new_xy = mix(vec2(old_hsv.x, old_hsv.y), vec2(color_change.x, max(old_hsv.y, color_change.y)), vec2(mask_step, mask_step));
color.xyz = hsvToRgb(vec3(new_xy.x, new_xy.y, old_hsv.z));
}
vec2 texc = gl_FragCoord.xy / screen;
float z = texture(dtex, texc).x;
vec4 xpos = 2.0 * vec4(texc, z, 1.0) - 1.0f;
xpos = InverseProjectionMatrix * xpos;
xpos /= xpos.w;
vec3 eyedir = normalize(xpos.xyz);
// Inspired from http://http.developer.nvidia.com/GPUGems3/gpugems3_ch16.html
vec3 L = normalize((transpose(InverseViewMatrix) * vec4(sun_direction, 0.)).xyz);
float fEdotL = clamp(dot(L, eyedir), 0., 1.);
float fPowEdotL = pow(fEdotL, 4.);
float fLdotNBack = max(0., - dot(nor, L) * 0.6 + 0.4);
float scattering = mix(fPowEdotL, fLdotNBack, .5);
float specmap = texture(SpecMap, uv).g;
float emitmap = texture(SpecMap, uv).b;
vec3 LightFactor = color.xyz * (scattering * 0.1) + getLightFactor(color.xyz, vec3(1.), specmap, emitmap);
vec3 LightFactor = getLightFactor(color.xyz, vec3(1.), specmap, emitmap);
FragColor = vec4(LightFactor, 1.);
}

View File

@ -41,7 +41,7 @@ flat out sampler2D thirdhandle;
void main()
{
vec3 test = sin(windDir * (Position.y* 0.5)) * 0.5;
vec3 test = sin(windDir * (Position.y * 0.1)) * 1.;
test += cos(windDir) * 0.7;
mat4 ModelMatrix = getWorldMatrix(Origin + test * Color.r, Orientation, Scale);
mat4 TransposeInverseModelView = transpose(getInverseWorldMatrix(Origin + test * Color.r, Orientation, Scale) * InverseViewMatrix);

View File

@ -1,9 +1,6 @@
#ifdef Use_Bindless_Texture
layout(bindless_sampler) uniform sampler2D dtex;
#else
#ifndef Use_Bindless_Texture
uniform sampler2D Albedo;
uniform sampler2D SpecMap;
uniform sampler2D dtex;
uniform sampler2D colorization_mask;
#endif
@ -45,24 +42,6 @@ void main(void)
vec2 new_xy = mix(vec2(old_hsv.x, old_hsv.y), vec2(color_change.x, max(old_hsv.y, color_change.y)), vec2(mask_step, mask_step));
color.xyz = hsvToRgb(vec3(new_xy.x, new_xy.y, old_hsv.z));
}
vec2 texc = gl_FragCoord.xy / screen;
float z = texture(dtex, texc).x;
vec4 xpos = 2.0 * vec4(texc, z, 1.0) - 1.0f;
xpos = InverseProjectionMatrix * xpos;
xpos /= xpos.w;
vec3 eyedir = normalize(xpos.xyz);
// Inspired from http://http.developer.nvidia.com/GPUGems3/gpugems3_ch16.html
vec3 L = normalize((transpose(InverseViewMatrix) * vec4(sun_direction, 0.)).xyz);
float fEdotL = clamp(dot(L, eyedir), 0., 1.);
float fPowEdotL = pow(fEdotL, 4.);
float fLdotNBack = max(0., - dot(nor, L) * 0.6 + 0.4);
float scattering = mix(fPowEdotL, fLdotNBack, .5);
vec3 LightFactor = color.xyz * (scattering * 0.1) + getLightFactor(color.xyz, vec3(1.), specmap, emitmap);
vec3 LightFactor = getLightFactor(color.xyz, vec3(1.), specmap, emitmap);
FragColor = vec4(LightFactor, 1.);
}

View File

@ -14,6 +14,11 @@ layout (location = 0) in vec3 particle_position;
layout (location = 1) in float lifetime;
layout (location = 2) in vec3 particle_velocity;
layout (location = 3) in float size;
#ifdef Needs_Vertex_Id_Workaround
layout (location = 8) in int vertex_id;
#endif
#else
in vec3 particle_position_initial;
in float lifetime_initial;
@ -24,6 +29,11 @@ in vec3 particle_position;
in float lifetime;
in vec3 particle_velocity;
in float size;
#ifdef Needs_Vertex_Id_Workaround
in int vertex_id;
#endif
#endif
out vec3 new_particle_position;
@ -36,7 +46,11 @@ void main(void)
float updated_lifetime = lifetime + (float(dt)/lifetime_initial);
if (updated_lifetime > 1.)
{
#ifdef Needs_Vertex_Id_Workaround
if (vertex_id < level)
#else
if (gl_VertexID < level)
#endif
{
float dt_from_last_frame = fract(updated_lifetime) * lifetime_initial;
float coeff = dt_from_last_frame / float(dt);

View File

@ -10,6 +10,7 @@ uniform sampler2D SSAO;
vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapValue, float emitMapValue)
{
#if defined(Advanced_Lighting_Enabled)
vec2 tc = gl_FragCoord.xy / screen;
vec3 DiffuseComponent = texture(DiffuseMap, tc).xyz;
vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
@ -17,4 +18,11 @@ vec3 getLightFactor(vec3 diffuseMatColor, vec3 specularMatColor, float specMapVa
vec3 tmp = diffuseMatColor * DiffuseComponent * (1. - specMapValue) + specularMatColor * SpecularComponent * specMapValue;
vec3 emitCol = diffuseMatColor.xyz * diffuseMatColor.xyz * diffuseMatColor.xyz * 15.;
return tmp * ao + (emitMapValue * emitCol);
#else
#if defined(GL_ES)
return diffuseMatColor * 0.73; // 0.5 ^ (1. / 2.2)
#else
return diffuseMatColor * 0.5;
#endif
#endif
}

View File

@ -2,6 +2,7 @@
Name=SuperTuxKart
Icon=supertuxkart
GenericName=A kart racing game
GenericName[da]=Et kart racerspil
GenericName[de]=Ein Kart-Rennspiel
GenericName[fr]=Un jeu de karting
GenericName[gl]=Xogo de carreiras con karts

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
data/supertuxkart_48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -18,6 +18,6 @@ add_library(glew STATIC
src/glew.c src/glewinfo.c
)
target_link_libraries(glew ${OPENGL_LIBRARIES})
target_link_libraries(glew ${OPENGL_gl_LIBRARY})
endif()

View File

@ -14064,6 +14064,9 @@ GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
GLXEW_VERSION_1_2 = GL_TRUE;
GLXEW_VERSION_1_3 = GL_TRUE;
GLXEW_VERSION_1_4 = GL_TRUE;
/* Check if GLX display is available */
if (glXGetCurrentDisplay == NULL || glXGetCurrentDisplay() == NULL)
return GLEW_OK;
/* query GLX version */
glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
if (major == 1 && minor <= 3)

View File

@ -5,12 +5,17 @@ find_package(JPEG REQUIRED)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/"
"${JPEG_INCLUDE_DIR}"
"${PNG_INCLUDE_DIRS}"
"${ZLIB_INCLUDE_DIR}"
"${CMAKE_CURRENT_BINARY_DIR}/../zlib/") # For zconf.h on WIN32
"${ZLIB_INCLUDE_DIR}")
if(MSVC OR APPLE)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/../zlib/" # For zconf.h on WIN32
"${CMAKE_CURRENT_BINARY_DIR}/../libpng/")
endif()
if (SERVER_ONLY)
add_definitions(-DNO_IRR_COMPILE_WITH_OPENGL_)
add_definitions(-DNO_IRR_COMPILE_WITH_X11_)
add_definitions(-DNO_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
else()
if(NOT USE_GLES2)
find_package(OpenGL REQUIRED)
@ -23,6 +28,10 @@ if (UNIX AND NOT APPLE)
include_directories(${X11_INCLUDE_DIR})
endif()
if(ENABLE_WAYLAND_DEVICE)
add_definitions(-D_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
endif()
if(APPLE)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/source/Irrlicht/MacOSX" "${CMAKE_CURRENT_SOURCE_DIR}/source/Irrlicht")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch x86_64")
@ -53,7 +62,7 @@ else()
endif()
if(USE_GLES2)
add_definitions(-D_IRR_COMPILE_WITH_OGLES2_ -DNO_IRR_COMPILE_WITH_SOFTWARE_ -DNO_IRR_COMPILE_WITH_BURNINGSVIDEO_ -DNO_IRR_COMPILE_WITH_OGLES1_ -DNO_IRR_COMPILE_WITH_OPENGL_ -DNO_IRR_USE_NON_SYSTEM_JPEG_LIB_ -DNO_IRR_USE_NON_SYSTEM_LIB_PNG_ -DNO_IRR_USE_NON_SYSTEM_ZLIB_)
add_definitions(-D_IRR_COMPILE_WITH_OGLES2_ -DNO_IRR_COMPILE_WITH_OPENGL_)
endif()
if(CYGWIN)
@ -67,6 +76,7 @@ source/Irrlicht/CAttributes.cpp
source/Irrlicht/CBillboardSceneNode.cpp
source/Irrlicht/CBoneSceneNode.cpp
source/Irrlicht/CCameraSceneNode.cpp
source/Irrlicht/CContextEGL.cpp
source/Irrlicht/CColorConverter.cpp
source/Irrlicht/CCubeSceneNode.cpp
source/Irrlicht/CDefaultGUIElementFactory.cpp
@ -118,6 +128,7 @@ source/Irrlicht/CIrrDeviceFB.cpp
source/Irrlicht/CIrrDeviceLinux.cpp
source/Irrlicht/CIrrDeviceSDL.cpp
source/Irrlicht/CIrrDeviceStub.cpp
source/Irrlicht/CIrrDeviceWayland.cpp
source/Irrlicht/CIrrDeviceWin32.cpp
source/Irrlicht/CLightSceneNode.cpp
source/Irrlicht/CLimitReadFile.cpp
@ -199,6 +210,7 @@ source/Irrlicht/CBillboardSceneNode.h
source/Irrlicht/CBlit.h
source/Irrlicht/CBoneSceneNode.h
source/Irrlicht/CCameraSceneNode.h
source/Irrlicht/CContextEGL.h
source/Irrlicht/CColorConverter.h
source/Irrlicht/CCubeSceneNode.h
source/Irrlicht/CDefaultGUIElementFactory.h
@ -250,6 +262,7 @@ source/Irrlicht/CIrrDeviceFB.h
source/Irrlicht/CIrrDeviceLinux.h
source/Irrlicht/CIrrDeviceSDL.h
source/Irrlicht/CIrrDeviceStub.h
source/Irrlicht/CIrrDeviceWayland.h
source/Irrlicht/CIrrDeviceWin32.h
source/Irrlicht/CLightSceneNode.h
source/Irrlicht/CLimitReadFile.h
@ -548,6 +561,14 @@ endif()
add_library(stkirrlicht STATIC ${IRRLICHT_SOURCES})
target_link_libraries(stkirrlicht ${PNG_LIBRARY} ${JPEG_LIBRARY} ${ZLIB_LIBRARY})
if(WIN32)
target_link_libraries(stkirrlicht imm32)
if(USE_GLES2 OR ENABLE_WAYLAND_DEVICE)
target_link_libraries(stkirrlicht EGL)
endif()
if(ENABLE_WAYLAND_DEVICE)
target_link_libraries(stkirrlicht wayland-client wayland-egl wayland-cursor xkbcommon)
endif()
if(WIN32)
target_link_libraries(stkirrlicht imm32 xinput9_1_0)
endif()

View File

@ -20,6 +20,9 @@ namespace irr
/** This device works on Windows Mobile, Pocket PC and Microsoft SmartPhone devices */
EIDT_WINCE,
//! A device native to Linux
EIDT_WAYLAND,
//! A device native to Unix style operating systems.
/** This device uses the X11 windowing system and works in Linux, Solaris, FreeBSD, OSX and
other operating systems which support X11. */

View File

@ -52,9 +52,6 @@ namespace video
primitives. */
EDT_OPENGL,
//! OpenGL-ES 1.x driver, for embedded and mobile systems
EDT_OGLES1,
//! OpenGL-ES 2.x driver, for embedded and mobile systems
/** Supports shaders etc. */
EDT_OGLES2,

View File

@ -177,8 +177,9 @@ namespace scene
\param newManager An optional new scene manager.
\return The newly created clone of this node. */
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) = 0;
virtual void setFrameLoopOnce(s32 begin, s32 end) = 0;
virtual u32 getAnimationSetNum() = 0;
virtual s32 getAnimationSet() const = 0;
virtual void addAnimationSet(u32 start, u32 end) = 0;
virtual void useAnimationSet(u32 set_num) = 0;
};

View File

@ -624,24 +624,24 @@ namespace scene
\code
SKeyMap keyMap[8];
keyMap[0].Action = EKA_MOVE_FORWARD;
keyMap[0].KeyCode = KEY_UP;
keyMap[0].KeyCode = IRR_KEY_UP;
keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_KEY_W;
keyMap[1].KeyCode = IRR_KEY_W;
keyMap[2].Action = EKA_MOVE_BACKWARD;
keyMap[2].KeyCode = KEY_DOWN;
keyMap[2].KeyCode = IRR_KEY_DOWN;
keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_KEY_S;
keyMap[3].KeyCode = IRR_KEY_S;
keyMap[4].Action = EKA_STRAFE_LEFT;
keyMap[4].KeyCode = KEY_LEFT;
keyMap[4].KeyCode = IRR_KEY_LEFT;
keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_KEY_A;
keyMap[5].KeyCode = IRR_KEY_A;
keyMap[6].Action = EKA_STRAFE_RIGHT;
keyMap[6].KeyCode = KEY_RIGHT;
keyMap[6].KeyCode = IRR_KEY_RIGHT;
keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_KEY_D;
keyMap[7].KeyCode = IRR_KEY_D;
camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
\endcode

View File

@ -117,14 +117,26 @@
#define _IRR_COMPILE_ANDROID_ASSET_READER_
#endif
#if defined(_IRR_COMPILE_WITH_OGLES2_) && !defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
#define _IRR_COMPILE_WITH_EGL_
#endif
#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_ANDROID_PLATFORM_)
#ifndef _IRR_SOLARIS_PLATFORM_
#define _IRR_LINUX_PLATFORM_
#endif
#define _IRR_POSIX_API_
#define _IRR_COMPILE_WITH_X11_DEVICE_
//#define _IRR_COMPILE_WITH_WAYLAND_DEVICE_
#endif
#ifdef NO_IRR_COMPILE_WITH_WAYLAND_DEVICE_
#undef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
#define _IRR_COMPILE_WITH_EGL_
#endif
//! Define _IRR_COMPILE_WITH_JOYSTICK_SUPPORT_ if you want joystick events.
#define _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
@ -156,7 +168,7 @@ headers, e.g. Summer 2004. This is a Microsoft issue, not an Irrlicht one.
//! Define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ if you want to use DirectInput for joystick handling.
/** This only applies to Windows devices, currently only supported under Win32 device.
If not defined, Windows Multimedia library is used, which offers also broad support for joystick devices. */
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#ifdef NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
#endif

View File

@ -152,6 +152,10 @@ namespace irr
/** \param text: New text of the window caption. */
virtual void setWindowCaption(const wchar_t* text) = 0;
//! Sets the class of the window.
/** \param text: New text of the window class. */
virtual void setWindowClass(const char* text) = 0;
//! Returns if the window is active.
/** If the window is inactive,
nothing needs to be drawn. So if you don't want to draw anything

View File

@ -10,176 +10,176 @@ namespace irr
enum EKEY_CODE
{
KEY_UNKNOWN = 0x0,
KEY_LBUTTON = 0x01, // Left mouse button
KEY_RBUTTON = 0x02, // Right mouse button
KEY_CANCEL = 0x03, // Control-break processing
KEY_MBUTTON = 0x04, // Middle mouse button (three-button mouse)
KEY_XBUTTON1 = 0x05, // Windows 2000/XP: X1 mouse button
KEY_XBUTTON2 = 0x06, // Windows 2000/XP: X2 mouse button
KEY_BACK = 0x08, // BACKSPACE key
KEY_TAB = 0x09, // TAB key
KEY_CLEAR = 0x0C, // CLEAR key
KEY_RETURN = 0x0D, // ENTER key
KEY_SHIFT = 0x10, // SHIFT key
KEY_CONTROL = 0x11, // CTRL key
KEY_MENU = 0x12, // ALT key
KEY_PAUSE = 0x13, // PAUSE key
KEY_CAPITAL = 0x14, // CAPS LOCK key
KEY_KANA = 0x15, // IME Kana mode
KEY_HANGUEL = 0x15, // IME Hanguel mode (maintained for compatibility use KEY_HANGUL)
KEY_HANGUL = 0x15, // IME Hangul mode
KEY_JUNJA = 0x17, // IME Junja mode
KEY_FINAL = 0x18, // IME final mode
KEY_HANJA = 0x19, // IME Hanja mode
KEY_KANJI = 0x19, // IME Kanji mode
KEY_ESCAPE = 0x1B, // ESC key
KEY_CONVERT = 0x1C, // IME convert
KEY_NONCONVERT = 0x1D, // IME nonconvert
KEY_ACCEPT = 0x1E, // IME accept
KEY_MODECHANGE = 0x1F, // IME mode change request
KEY_SPACE = 0x20, // SPACEBAR
KEY_PRIOR = 0x21, // PAGE UP key
KEY_NEXT = 0x22, // PAGE DOWN key
KEY_END = 0x23, // END key
KEY_HOME = 0x24, // HOME key
KEY_LEFT = 0x25, // LEFT ARROW key
KEY_UP = 0x26, // UP ARROW key
KEY_RIGHT = 0x27, // RIGHT ARROW key
KEY_DOWN = 0x28, // DOWN ARROW key
KEY_SELECT = 0x29, // SELECT key
KEY_PRINT = 0x2A, // PRINT key
KEY_EXECUT = 0x2B, // EXECUTE key
KEY_SNAPSHOT = 0x2C, // PRINT SCREEN key
KEY_INSERT = 0x2D, // INS key
KEY_DELETE = 0x2E, // DEL key
KEY_HELP = 0x2F, // HELP key
KEY_KEY_0 = 0x30, // 0 key
KEY_KEY_1 = 0x31, // 1 key
KEY_KEY_2 = 0x32, // 2 key
KEY_KEY_3 = 0x33, // 3 key
KEY_KEY_4 = 0x34, // 4 key
KEY_KEY_5 = 0x35, // 5 key
KEY_KEY_6 = 0x36, // 6 key
KEY_KEY_7 = 0x37, // 7 key
KEY_KEY_8 = 0x38, // 8 key
KEY_KEY_9 = 0x39, // 9 key
KEY_KEY_A = 0x41, // A key
KEY_KEY_B = 0x42, // B key
KEY_KEY_C = 0x43, // C key
KEY_KEY_D = 0x44, // D key
KEY_KEY_E = 0x45, // E key
KEY_KEY_F = 0x46, // F key
KEY_KEY_G = 0x47, // G key
KEY_KEY_H = 0x48, // H key
KEY_KEY_I = 0x49, // I key
KEY_KEY_J = 0x4A, // J key
KEY_KEY_K = 0x4B, // K key
KEY_KEY_L = 0x4C, // L key
KEY_KEY_M = 0x4D, // M key
KEY_KEY_N = 0x4E, // N key
KEY_KEY_O = 0x4F, // O key
KEY_KEY_P = 0x50, // P key
KEY_KEY_Q = 0x51, // Q key
KEY_KEY_R = 0x52, // R key
KEY_KEY_S = 0x53, // S key
KEY_KEY_T = 0x54, // T key
KEY_KEY_U = 0x55, // U key
KEY_KEY_V = 0x56, // V key
KEY_KEY_W = 0x57, // W key
KEY_KEY_X = 0x58, // X key
KEY_KEY_Y = 0x59, // Y key
KEY_KEY_Z = 0x5A, // Z key
KEY_LWIN = 0x5B, // Left Windows key (MicrosoftŽ NaturalŽ keyboard)
KEY_RWIN = 0x5C, // Right Windows key (Natural keyboard)
KEY_APPS = 0x5D, // Applications key (Natural keyboard)
KEY_SLEEP = 0x5F, // Computer Sleep key
KEY_NUMPAD0 = 0x60, // Numeric keypad 0 key
KEY_NUMPAD1 = 0x61, // Numeric keypad 1 key
KEY_NUMPAD2 = 0x62, // Numeric keypad 2 key
KEY_NUMPAD3 = 0x63, // Numeric keypad 3 key
KEY_NUMPAD4 = 0x64, // Numeric keypad 4 key
KEY_NUMPAD5 = 0x65, // Numeric keypad 5 key
KEY_NUMPAD6 = 0x66, // Numeric keypad 6 key
KEY_NUMPAD7 = 0x67, // Numeric keypad 7 key
KEY_NUMPAD8 = 0x68, // Numeric keypad 8 key
KEY_NUMPAD9 = 0x69, // Numeric keypad 9 key
KEY_MULTIPLY = 0x6A, // Multiply key
KEY_ADD = 0x6B, // Add key
KEY_SEPARATOR = 0x6C, // Separator key
KEY_SUBTRACT = 0x6D, // Subtract key
KEY_DECIMAL = 0x6E, // Decimal key
KEY_DIVIDE = 0x6F, // Divide key
KEY_F1 = 0x70, // F1 key
KEY_F2 = 0x71, // F2 key
KEY_F3 = 0x72, // F3 key
KEY_F4 = 0x73, // F4 key
KEY_F5 = 0x74, // F5 key
KEY_F6 = 0x75, // F6 key
KEY_F7 = 0x76, // F7 key
KEY_F8 = 0x77, // F8 key
KEY_F9 = 0x78, // F9 key
KEY_F10 = 0x79, // F10 key
KEY_F11 = 0x7A, // F11 key
KEY_F12 = 0x7B, // F12 key
KEY_F13 = 0x7C, // F13 key
KEY_F14 = 0x7D, // F14 key
KEY_F15 = 0x7E, // F15 key
KEY_F16 = 0x7F, // F16 key
KEY_F17 = 0x80, // F17 key
KEY_F18 = 0x81, // F18 key
KEY_F19 = 0x82, // F19 key
KEY_F20 = 0x83, // F20 key
KEY_F21 = 0x84, // F21 key
KEY_F22 = 0x85, // F22 key
KEY_F23 = 0x86, // F23 key
KEY_F24 = 0x87, // F24 key
KEY_NUMLOCK = 0x90, // NUM LOCK key
KEY_SCROLL = 0x91, // SCROLL LOCK key
KEY_LSHIFT = 0xA0, // Left SHIFT key
KEY_RSHIFT = 0xA1, // Right SHIFT key
KEY_LCONTROL = 0xA2, // Left CONTROL key
KEY_RCONTROL = 0xA3, // Right CONTROL key
KEY_LMENU = 0xA4, // Left MENU key
KEY_RMENU = 0xA5, // Right MENU key
KEY_BROWSER_BACK = 0xA6, // Browser Back key
KEY_BROWSER_FORWARD = 0xA7, // Browser Forward key
KEY_BROWSER_REFRESH = 0xA8, // Browser Refresh key
KEY_BROWSER_STOP = 0xA9, // Browser Stop key
KEY_BROWSER_SEARCH = 0xAA, // Browser Search key
KEY_BROWSER_FAVORITES =0xAB, // Browser Favorites key
KEY_BROWSER_HOME = 0xAC, // Browser Start and Home key
KEY_VOLUME_MUTE = 0xAD, // Volume Mute key
KEY_VOLUME_DOWN = 0xAE, // Volume Down key
KEY_VOLUME_UP = 0xAF, // Volume Up key
KEY_MEDIA_NEXT_TRACK = 0xB0, // Next Track key
KEY_MEDIA_PREV_TRACK = 0xB1, // Previous Track key
KEY_MEDIA_STOP = 0xB2, // Stop Media key
KEY_MEDIA_PLAY_PAUSE = 0xB3, // Play/Pause Media key
KEY_OEM_1 = 0xBA, // for US ";:"
KEY_PLUS = 0xBB, // Plus Key "+"
KEY_COMMA = 0xBC, // Comma Key ","
KEY_MINUS = 0xBD, // Minus Key "-"
KEY_PERIOD = 0xBE, // Period Key "."
KEY_OEM_2 = 0xBF, // for US "/?"
KEY_OEM_3 = 0xC0, // for US "`~"
KEY_OEM_4 = 0xDB, // for US "[{"
KEY_OEM_5 = 0xDC, // for US "\|"
KEY_OEM_6 = 0xDD, // for US "]}"
KEY_OEM_7 = 0xDE, // for US "'""
KEY_OEM_8 = 0xDF, // None
KEY_OEM_AX = 0xE1, // for Japan "AX"
KEY_OEM_102 = 0xE2, // "<>" or "\|"
KEY_ATTN = 0xF6, // Attn key
KEY_CRSEL = 0xF7, // CrSel key
KEY_EXSEL = 0xF8, // ExSel key
KEY_EREOF = 0xF9, // Erase EOF key
KEY_PLAY = 0xFA, // Play key
KEY_ZOOM = 0xFB, // Zoom key
KEY_PA1 = 0xFD, // PA1 key
KEY_OEM_CLEAR = 0xFE, // Clear key
IRR_KEY_UNKNOWN = 0x0,
IRR_KEY_LBUTTON = 0x01, // Left mouse button
IRR_KEY_RBUTTON = 0x02, // Right mouse button
IRR_KEY_CANCEL = 0x03, // Control-break processing
IRR_KEY_MBUTTON = 0x04, // Middle mouse button (three-button mouse)
IRR_KEY_XBUTTON1 = 0x05, // Windows 2000/XP: X1 mouse button
IRR_KEY_XBUTTON2 = 0x06, // Windows 2000/XP: X2 mouse button
IRR_KEY_BACK = 0x08, // BACKSPACE key
IRR_KEY_TAB = 0x09, // TAB key
IRR_KEY_CLEAR = 0x0C, // CLEAR key
IRR_KEY_RETURN = 0x0D, // ENTER key
IRR_KEY_SHIFT = 0x10, // SHIFT key
IRR_KEY_CONTROL = 0x11, // CTRL key
IRR_KEY_MENU = 0x12, // ALT key
IRR_KEY_PAUSE = 0x13, // PAUSE key
IRR_KEY_CAPITAL = 0x14, // CAPS LOCK key
IRR_KEY_KANA = 0x15, // IME Kana mode
IRR_KEY_HANGUEL = 0x15, // IME Hanguel mode (maintained for compatibility use KEY_HANGUL)
IRR_KEY_HANGUL = 0x15, // IME Hangul mode
IRR_KEY_JUNJA = 0x17, // IME Junja mode
IRR_KEY_FINAL = 0x18, // IME final mode
IRR_KEY_HANJA = 0x19, // IME Hanja mode
IRR_KEY_KANJI = 0x19, // IME Kanji mode
IRR_KEY_ESCAPE = 0x1B, // ESC key
IRR_KEY_CONVERT = 0x1C, // IME convert
IRR_KEY_NONCONVERT = 0x1D, // IME nonconvert
IRR_KEY_ACCEPT = 0x1E, // IME accept
IRR_KEY_MODECHANGE = 0x1F, // IME mode change request
IRR_KEY_SPACE = 0x20, // SPACEBAR
IRR_KEY_PRIOR = 0x21, // PAGE UP key
IRR_KEY_NEXT = 0x22, // PAGE DOWN key
IRR_KEY_END = 0x23, // END key
IRR_KEY_HOME = 0x24, // HOME key
IRR_KEY_LEFT = 0x25, // LEFT ARROW key
IRR_KEY_UP = 0x26, // UP ARROW key
IRR_KEY_RIGHT = 0x27, // RIGHT ARROW key
IRR_KEY_DOWN = 0x28, // DOWN ARROW key
IRR_KEY_SELECT = 0x29, // SELECT key
IRR_KEY_PRINT = 0x2A, // PRINT key
IRR_KEY_EXECUT = 0x2B, // EXECUTE key
IRR_KEY_SNAPSHOT = 0x2C, // PRINT SCREEN key
IRR_KEY_INSERT = 0x2D, // INS key
IRR_KEY_DELETE = 0x2E, // DEL key
IRR_KEY_HELP = 0x2F, // HELP key
IRR_KEY_0 = 0x30, // 0 key
IRR_KEY_1 = 0x31, // 1 key
IRR_KEY_2 = 0x32, // 2 key
IRR_KEY_3 = 0x33, // 3 key
IRR_KEY_4 = 0x34, // 4 key
IRR_KEY_5 = 0x35, // 5 key
IRR_KEY_6 = 0x36, // 6 key
IRR_KEY_7 = 0x37, // 7 key
IRR_KEY_8 = 0x38, // 8 key
IRR_KEY_9 = 0x39, // 9 key
IRR_KEY_A = 0x41, // A key
IRR_KEY_B = 0x42, // B key
IRR_KEY_C = 0x43, // C key
IRR_KEY_D = 0x44, // D key
IRR_KEY_E = 0x45, // E key
IRR_KEY_F = 0x46, // F key
IRR_KEY_G = 0x47, // G key
IRR_KEY_H = 0x48, // H key
IRR_KEY_I = 0x49, // I key
IRR_KEY_J = 0x4A, // J key
IRR_KEY_K = 0x4B, // K key
IRR_KEY_L = 0x4C, // L key
IRR_KEY_M = 0x4D, // M key
IRR_KEY_N = 0x4E, // N key
IRR_KEY_O = 0x4F, // O key
IRR_KEY_P = 0x50, // P key
IRR_KEY_Q = 0x51, // Q key
IRR_KEY_R = 0x52, // R key
IRR_KEY_S = 0x53, // S key
IRR_KEY_T = 0x54, // T key
IRR_KEY_U = 0x55, // U key
IRR_KEY_V = 0x56, // V key
IRR_KEY_W = 0x57, // W key
IRR_KEY_X = 0x58, // X key
IRR_KEY_Y = 0x59, // Y key
IRR_KEY_Z = 0x5A, // Z key
IRR_KEY_LWIN = 0x5B, // Left Windows key (MicrosoftŽ NaturalŽ keyboard)
IRR_KEY_RWIN = 0x5C, // Right Windows key (Natural keyboard)
IRR_KEY_APPS = 0x5D, // Applications key (Natural keyboard)
IRR_KEY_SLEEP = 0x5F, // Computer Sleep key
IRR_KEY_NUMPAD0 = 0x60, // Numeric keypad 0 key
IRR_KEY_NUMPAD1 = 0x61, // Numeric keypad 1 key
IRR_KEY_NUMPAD2 = 0x62, // Numeric keypad 2 key
IRR_KEY_NUMPAD3 = 0x63, // Numeric keypad 3 key
IRR_KEY_NUMPAD4 = 0x64, // Numeric keypad 4 key
IRR_KEY_NUMPAD5 = 0x65, // Numeric keypad 5 key
IRR_KEY_NUMPAD6 = 0x66, // Numeric keypad 6 key
IRR_KEY_NUMPAD7 = 0x67, // Numeric keypad 7 key
IRR_KEY_NUMPAD8 = 0x68, // Numeric keypad 8 key
IRR_KEY_NUMPAD9 = 0x69, // Numeric keypad 9 key
IRR_KEY_MULTIPLY = 0x6A, // Multiply key
IRR_KEY_ADD = 0x6B, // Add key
IRR_KEY_SEPARATOR = 0x6C, // Separator key
IRR_KEY_SUBTRACT = 0x6D, // Subtract key
IRR_KEY_DECIMAL = 0x6E, // Decimal key
IRR_KEY_DIVIDE = 0x6F, // Divide key
IRR_KEY_F1 = 0x70, // F1 key
IRR_KEY_F2 = 0x71, // F2 key
IRR_KEY_F3 = 0x72, // F3 key
IRR_KEY_F4 = 0x73, // F4 key
IRR_KEY_F5 = 0x74, // F5 key
IRR_KEY_F6 = 0x75, // F6 key
IRR_KEY_F7 = 0x76, // F7 key
IRR_KEY_F8 = 0x77, // F8 key
IRR_KEY_F9 = 0x78, // F9 key
IRR_KEY_F10 = 0x79, // F10 key
IRR_KEY_F11 = 0x7A, // F11 key
IRR_KEY_F12 = 0x7B, // F12 key
IRR_KEY_F13 = 0x7C, // F13 key
IRR_KEY_F14 = 0x7D, // F14 key
IRR_KEY_F15 = 0x7E, // F15 key
IRR_KEY_F16 = 0x7F, // F16 key
IRR_KEY_F17 = 0x80, // F17 key
IRR_KEY_F18 = 0x81, // F18 key
IRR_KEY_F19 = 0x82, // F19 key
IRR_KEY_F20 = 0x83, // F20 key
IRR_KEY_F21 = 0x84, // F21 key
IRR_KEY_F22 = 0x85, // F22 key
IRR_KEY_F23 = 0x86, // F23 key
IRR_KEY_F24 = 0x87, // F24 key
IRR_KEY_NUMLOCK = 0x90, // NUM LOCK key
IRR_KEY_SCROLL = 0x91, // SCROLL LOCK key
IRR_KEY_LSHIFT = 0xA0, // Left SHIFT key
IRR_KEY_RSHIFT = 0xA1, // Right SHIFT key
IRR_KEY_LCONTROL = 0xA2, // Left CONTROL key
IRR_KEY_RCONTROL = 0xA3, // Right CONTROL key
IRR_KEY_LMENU = 0xA4, // Left MENU key
IRR_KEY_RMENU = 0xA5, // Right MENU key
IRR_KEY_BROWSER_BACK = 0xA6, // Browser Back key
IRR_KEY_BROWSER_FORWARD = 0xA7, // Browser Forward key
IRR_KEY_BROWSER_REFRESH = 0xA8, // Browser Refresh key
IRR_KEY_BROWSER_STOP = 0xA9, // Browser Stop key
IRR_KEY_BROWSER_SEARCH = 0xAA, // Browser Search key
IRR_KEY_BROWSER_FAVORITES =0xAB, // Browser Favorites key
IRR_KEY_BROWSER_HOME = 0xAC, // Browser Start and Home key
IRR_KEY_VOLUME_MUTE = 0xAD, // Volume Mute key
IRR_KEY_VOLUME_DOWN = 0xAE, // Volume Down key
IRR_KEY_VOLUME_UP = 0xAF, // Volume Up key
IRR_KEY_MEDIA_NEXT_TRACK = 0xB0, // Next Track key
IRR_KEY_MEDIA_PREV_TRACK = 0xB1, // Previous Track key
IRR_KEY_MEDIA_STOP = 0xB2, // Stop Media key
IRR_KEY_MEDIA_PLAY_PAUSE = 0xB3, // Play/Pause Media key
IRR_KEY_OEM_1 = 0xBA, // for US ";:"
IRR_KEY_PLUS = 0xBB, // Plus Key "+"
IRR_KEY_COMMA = 0xBC, // Comma Key ","
IRR_KEY_MINUS = 0xBD, // Minus Key "-"
IRR_KEY_PERIOD = 0xBE, // Period Key "."
IRR_KEY_OEM_2 = 0xBF, // for US "/?"
IRR_KEY_OEM_3 = 0xC0, // for US "`~"
IRR_KEY_OEM_4 = 0xDB, // for US "[{"
IRR_KEY_OEM_5 = 0xDC, // for US "\|"
IRR_KEY_OEM_6 = 0xDD, // for US "]}"
IRR_KEY_OEM_7 = 0xDE, // for US "'""
IRR_KEY_OEM_8 = 0xDF, // None
IRR_KEY_OEM_AX = 0xE1, // for Japan "AX"
IRR_KEY_OEM_102 = 0xE2, // "<>" or "\|"
IRR_KEY_ATTN = 0xF6, // Attn key
IRR_KEY_CRSEL = 0xF7, // CrSel key
IRR_KEY_EXSEL = 0xF8, // ExSel key
IRR_KEY_EREOF = 0xF9, // Erase EOF key
IRR_KEY_PLAY = 0xFA, // Play key
IRR_KEY_ZOOM = 0xFB, // Zoom key
IRR_KEY_PA1 = 0xFD, // PA1 key
IRR_KEY_OEM_CLEAR = 0xFE, // Clear key
KEY_KEY_CODES_COUNT = 0xFF // this is not a key, but the amount of keycodes there are.
IRR_KEY_CODES_COUNT = 0xFF // this is not a key, but the amount of keycodes there are.
};
} // end namespace irr

View File

@ -1,10 +0,0 @@
; part of the Irrlicht Engine Shader example.
; This simple Direct3D9 pixel shader will be loaded by the engine.
; Please note that these example shaders don't do anything really useful.
; They only demonstrate that shaders can be used in Irrlicht.
ps.1.1
tex t0 ; sample color map
mul_x2 t0, t0, v0 ; mulitply with color
add r0, t0, t0 ; make it brighter and store result

View File

@ -1,37 +0,0 @@
; part of the Irrlicht Engine Shader example.
; This Direct3D9 vertex shader will be loaded by the engine.
; Please note that these example shaders don't do anything really useful.
; They only demonstrate that shaders can be used in Irrlicht.
vs.1.1
; transpose and transform position to clip space
mul r0, v0.x, c4
mad r0, v0.y, c5, r0
mad r0, v0.z, c6, r0
add oPos, c7, r0
; transform normal
dp3 r1.x, v1, c0
dp3 r1.y, v1, c1
dp3 r1.z, v1, c2
; renormalize normal
dp3 r1.w, r1, r1
rsq r1.w, r1.w
mul r1, r1, r1.w
; calculate light vector
m4x4 r6, v0, c10 ; vertex into world position
add r2, c8, -r6 ; vtxpos - lightpos
; normalize light vector
dp3 r2.w, r2, r2
rsq r2.w, r2.w
mul r2, r2, r2.w
; calculate light color
dp3 r3, r1, r2 ; dp3 with negative light vector
lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
mul oD0, r5.y, c9 ; ouput diffuse color
mov oT0, v3 ; store texture coordinates

View File

@ -1,84 +0,0 @@
// part of the Irrlicht Engine Shader example.
// These simple Direct3D9 pixel and vertex shaders will be loaded by the shaders
// example. Please note that these example shaders don't do anything really useful.
// They only demonstrate that shaders can be used in Irrlicht.
//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------
float4x4 mWorldViewProj; // World * View * Projection transformation
float4x4 mInvWorld; // Inverted world matrix
float4x4 mTransWorld; // Transposed world matrix
float3 mLightPos; // Light position
float4 mLightColor; // Light color
// Vertex shader output structure
struct VS_OUTPUT
{
float4 Position : POSITION; // vertex position
float4 Diffuse : COLOR0; // vertex diffuse color
float2 TexCoord : TEXCOORD0; // tex coords
};
VS_OUTPUT vertexMain(in float4 vPosition : POSITION,
in float3 vNormal : NORMAL,
float2 texCoord : TEXCOORD0 )
{
VS_OUTPUT Output;
// transform position to clip space
Output.Position = mul(vPosition, mWorldViewProj);
// transform normal
float3 normal = mul(float4(vNormal,0.0), mInvWorld);
// renormalize normal
normal = normalize(normal);
// position in world coodinates
float3 worldpos = mul(mTransWorld, vPosition);
// calculate light vector, vtxpos - lightpos
float3 lightVector = worldpos - mLightPos;
// normalize light vector
lightVector = normalize(lightVector);
// calculate light color
float3 tmp = dot(-lightVector, normal);
tmp = lit(tmp.x, tmp.y, 1.0);
tmp = mLightColor * tmp.y;
Output.Diffuse = float4(tmp.x, tmp.y, tmp.z, 0);
Output.TexCoord = texCoord;
return Output;
}
// Pixel shader output structure
struct PS_OUTPUT
{
float4 RGBColor : COLOR0; // Pixel color
};
sampler2D myTexture;
PS_OUTPUT pixelMain(float2 TexCoord : TEXCOORD0,
float4 Position : POSITION,
float4 Diffuse : COLOR0 )
{
PS_OUTPUT Output;
float4 col = tex2D( myTexture, TexCoord ); // sample color map
// multiply with diffuse and do other senseless operations
Output.RGBColor = Diffuse * col;
Output.RGBColor *= 4.0;
return Output;
}

View File

@ -1,11 +0,0 @@
; part of the Irrlicht Engine Shader example.
; This simple Direct3D9 pixel shader will be loaded by the engine.
; Please note that these example shaders don't do anything really useful.
; They only demonstrate that shaders can be used in Irrlicht.
ps.1.1
tex t0 ; sample color map
add r0, v0, v0 ; mulitply with color
mul t0, t0, r0 ; mulitply with color
add r0, t0, t0 ; make it brighter and store result

View File

@ -1,42 +0,0 @@
; part of the Irrlicht Engine Shader example.
; This Direct3D9 vertex shader will be loaded by the engine.
; Please note that these example shaders don't do anything really useful.
; They only demonstrate that shaders can be used in Irrlicht.
vs.1.1
dcl_position v0; ; declare position
dcl_normal v1; ; declare normal
dcl_color v2; ; declare color
dcl_texcoord0 v3; ; declare texture coordinate
; transpose and transform position to clip space
mul r0, v0.x, c4
mad r0, v0.y, c5, r0
mad r0, v0.z, c6, r0
add oPos, c7, r0
; transform normal
dp3 r1.x, v1, c0
dp3 r1.y, v1, c1
dp3 r1.z, v1, c2
; renormalize normal
dp3 r1.w, r1, r1
rsq r1.w, r1.w
mul r1, r1, r1.w
; calculate light vector
m4x4 r6, v0, c10 ; vertex into world position
add r2, c8, -r6 ; vtxpos - lightpos
; normalize light vector
dp3 r2.w, r2, r2
rsq r2.w, r2.w
mul r2, r2, r2.w
; calculate light color
dp3 r3, r1, r2 ; dp3 with negative light vector
lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
mul oD0, r5.y, c9 ; ouput diffuse color
mov oT0, v3 ; store texture coordinates

View File

@ -1,9 +0,0 @@
uniform sampler2D myTexture;
void main (void)
{
vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0]));
col *= gl_Color;
gl_FragColor = col * 4.0;
}

View File

@ -1,22 +0,0 @@
!!ARBfp1.0
# part of the Irrlicht Engine Shader example.
# Please note that these example shaders don't do anything really useful.
# They only demonstrate that shaders can be used in Irrlicht.
#Input
ATTRIB inTexCoord = fragment.texcoord; # texture coordinates
ATTRIB inColor = fragment.color.primary; # interpolated diffuse color
#Output
OUTPUT outColor = result.color;
TEMP texelColor;
TEMP tmp;
TXP texelColor, inTexCoord, texture, 2D;
ADD tmp, inColor, inColor; # mulitply with color
MUL texelColor, texelColor, tmp; # mulitply with color
ADD outColor, texelColor, texelColor; # make it brighter and store result
END

View File

@ -1,27 +0,0 @@
uniform mat4 mWorldViewProj;
uniform mat4 mInvWorld;
uniform mat4 mTransWorld;
uniform vec3 mLightPos;
uniform vec4 mLightColor;
void main(void)
{
gl_Position = mWorldViewProj * gl_Vertex;
vec4 normal = vec4(gl_Normal, 0.0);
normal = mInvWorld * normal;
normal = normalize(normal);
vec4 worldpos = gl_Vertex * mTransWorld;
vec4 lightVector = worldpos - vec4(mLightPos,1.0);
lightVector = normalize(lightVector);
float tmp2 = dot(-lightVector, normal);
vec4 tmp = mLightColor * tmp2;
gl_FrontColor = gl_BackColor = vec4(tmp.x, tmp.y, tmp.z, 0.0);
gl_TexCoord[0] = gl_MultiTexCoord0;
}

View File

@ -1,60 +0,0 @@
!!ARBvp1.0
# part of the Irrlicht Engine Shader example.
# Please note that these example shaders don't do anything really useful.
# They only demonstrate that shaders can be used in Irrlicht.
#input
ATTRIB InPos = vertex.position;
ATTRIB InColor = vertex.color;
ATTRIB InNormal = vertex.normal;
ATTRIB InTexCoord = vertex.texcoord;
#output
OUTPUT OutPos = result.position;
OUTPUT OutColor = result.color;
OUTPUT OutTexCoord = result.texcoord;
PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix.
TEMP Temp;
TEMP TempColor;
TEMP TempNormal;
TEMP TempPos;
#transform position to clip space
DP4 Temp.x, MVP[0], InPos;
DP4 Temp.y, MVP[1], InPos;
DP4 Temp.z, MVP[2], InPos;
DP4 Temp.w, MVP[3], InPos;
#transform normal
DP3 TempNormal.x, InNormal.x, program.local[0];
DP3 TempNormal.y, InNormal.y, program.local[1];
DP3 TempNormal.z, InNormal.z, program.local[2];
#renormalize normal
DP3 TempNormal.w, TempNormal, TempNormal;
RSQ TempNormal.w, TempNormal.w;
MUL TempNormal, TempNormal, TempNormal.w;
# calculate light vector
DP4 TempPos.x, InPos, program.local[10]; # vertex into world position
DP4 TempPos.y, InPos, program.local[11];
DP4 TempPos.z, InPos, program.local[12];
DP4 TempPos.w, InPos, program.local[13];
ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos
# normalize light vector
DP3 TempPos.w, TempPos, TempPos;
RSQ TempPos.w, TempPos.w;
MUL TempPos, TempPos, TempPos.w;
# calculate light color
DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector
LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y
MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color
MOV OutColor.w, 1.0; # we want alpha to be always 1
MOV OutTexCoord, InTexCoord; # store texture coordinate
MOV OutPos, Temp;
END

View File

@ -1002,5 +1002,60 @@ void CAnimatedMeshSceneNode::useAnimationSet(u32 set_num)
setFrameLoop(m_animation_set[set_num * 2], m_animation_set[set_num * 2 + 1]);
}
void CAnimatedMeshSceneNode::setFrameLoopOnce(s32 begin, s32 end)
{
if (LoopCallBack != NULL || !Looping)
{
return;
}
Looping = false;
class MiniLoopSetter : public IAnimationEndCallBack
{
private:
int m_old_start, m_old_end, m_new_start, m_new_end;
bool m_run_cb;
public:
MiniLoopSetter(int old_start, int old_end, int new_start, int new_end)
: m_old_start(old_start), m_old_end(old_end),
m_new_start(new_start), m_new_end(new_end), m_run_cb(false) {}
virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node)
{
if (!m_run_cb)
{
m_run_cb = true;
node->setFrameLoop(m_new_start, m_new_end);
return;
}
if (m_run_cb)
{
node->setFrameLoop(m_old_start, m_old_end);
node->setLoopMode(true);
node->setAnimationEndCallback(NULL);
return;
}
}
};
MiniLoopSetter* mls = new MiniLoopSetter(StartFrame, EndFrame,
begin, end);
setAnimationEndCallback(mls);
mls->drop();
}
s32 CAnimatedMeshSceneNode::getAnimationSet() const
{
for (u32 i = 0; i < m_animation_set.size(); i += 2)
{
if (m_animation_set[i] == (u32)StartFrame &&
m_animation_set[i + 1] == (u32)EndFrame)
{
return (s32)(i >> 1);
}
}
return -1;
}
} // end namespace scene
} // end namespace irr

View File

@ -161,13 +161,14 @@ namespace scene
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0);
virtual u32 getAnimationSetNum() { return m_animation_set.size() / 2; }
virtual s32 getAnimationSet() const;
virtual void addAnimationSet(u32 start, u32 end)
{
m_animation_set.push_back(start);
m_animation_set.push_back(end);
}
virtual void useAnimationSet(u32 set_num);
virtual void setFrameLoopOnce(s32 begin, s32 end);
protected:
//! Get a static mesh for the current frame of this animated mesh

View File

@ -0,0 +1,604 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2016-2017 SuperTuxKart-Team
//
// 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 3
// of the License, or (at your option) 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "IrrCompileConfig.h"
#if defined(_IRR_COMPILE_WITH_EGL_)
#include <cassert>
#include <cstdio>
#include <cstring>
#include <vector>
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
#include <android_native_app_glue.h>
#endif
#include "CContextEGL.h"
#include "os.h"
using namespace irr;
ContextManagerEGL::ContextManagerEGL()
{
m_egl_window = 0;
m_egl_display = EGL_NO_DISPLAY;
m_egl_surface = EGL_NO_SURFACE;
m_egl_context = EGL_NO_CONTEXT;
m_egl_config = 0;
m_egl_version = 0;
m_is_legacy_device = false;
m_initialized = false;
memset(&m_creation_params, 0, sizeof(ContextEGLParams));
}
ContextManagerEGL::~ContextManagerEGL()
{
close();
}
bool ContextManagerEGL::init(const ContextEGLParams& params)
{
if (m_initialized)
return false;
m_creation_params = params;
m_egl_window = m_creation_params.window;
bool success = initDisplay();
if (!success)
{
os::Printer::log("Error: Could not initialize EGL display.\n");
close();
return false;
}
bool has_minimum_requirements = false;
if (m_creation_params.opengl_api == CEGL_API_OPENGL)
{
if (hasEGLExtension("EGL_KHR_create_context") || m_egl_version >= 150)
{
has_minimum_requirements = true;
eglBindAPI(EGL_OPENGL_API);
}
}
else if (m_creation_params.opengl_api == CEGL_API_OPENGL_ES)
{
if (m_egl_version >= 130)
{
has_minimum_requirements = true;
eglBindAPI(EGL_OPENGL_ES_API);
}
}
if (!has_minimum_requirements)
{
os::Printer::log("Error: EGL version is too old.\n");
close();
return false;
}
success = chooseConfig();
if (!success)
{
os::Printer::log("Error: Couldn't get EGL config.\n");
close();
return false;
}
success = createSurface();
if (!success)
{
os::Printer::log("Error: Couldn't create EGL surface.\n");
close();
return false;
}
success = createContext();
if (!success)
{
os::Printer::log("Error: Couldn't create OpenGL context.\n");
close();
return false;
}
success = eglMakeCurrent(m_egl_display, m_egl_surface, m_egl_surface,
m_egl_context);
if (!success)
{
checkEGLError();
os::Printer::log("Error: Couldn't make context current for EGL display.\n");
close();
return false;
}
eglSwapInterval(m_egl_display, m_creation_params.vsync_enabled ? 1 : 0);
m_initialized = true;
return true;
}
bool ContextManagerEGL::initDisplay()
{
EGLNativeDisplayType display = m_creation_params.display;
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
display = EGL_DEFAULT_DISPLAY;
#endif
if (display != EGL_DEFAULT_DISPLAY)
{
m_egl_display = eglGetDisplay(display);
}
if (m_egl_display == EGL_NO_DISPLAY)
{
m_egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
}
if (m_egl_display == EGL_NO_DISPLAY)
{
return false;
}
int egl_version_major = 0;
int egl_version_minor = 0;
bool success = eglInitialize(m_egl_display, &egl_version_major,
&egl_version_minor);
if (success)
{
m_egl_version = 100 * egl_version_major + 10 * egl_version_minor;
}
return success;
}
bool ContextManagerEGL::chooseConfig()
{
std::vector<EGLint> config_attribs;
config_attribs.push_back(EGL_RED_SIZE);
config_attribs.push_back(8);
config_attribs.push_back(EGL_GREEN_SIZE);
config_attribs.push_back(8);
config_attribs.push_back(EGL_BLUE_SIZE);
config_attribs.push_back(8);
config_attribs.push_back(EGL_ALPHA_SIZE);
config_attribs.push_back(m_creation_params.with_alpha_channel ? 8 : 0);
config_attribs.push_back(EGL_DEPTH_SIZE);
config_attribs.push_back(16);
// config_attribs.push_back(EGL_BUFFER_SIZE);
// config_attribs.push_back(24);
// config_attribs.push_back(EGL_STENCIL_SIZE);
// config_attribs.push_back(stencil_buffer);
// config_attribs.push_back(EGL_SAMPLE_BUFFERS);
// config_attribs.push_back(antialias ? 1 : 0);
// config_attribs.push_back(EGL_SAMPLES);
// config_attribs.push_back(antialias);
if (m_creation_params.opengl_api == CEGL_API_OPENGL)
{
config_attribs.push_back(EGL_RENDERABLE_TYPE);
config_attribs.push_back(EGL_OPENGL_BIT);
}
else if (m_creation_params.opengl_api == CEGL_API_OPENGL_ES)
{
config_attribs.push_back(EGL_RENDERABLE_TYPE);
config_attribs.push_back(EGL_OPENGL_ES2_BIT);
}
if (m_creation_params.surface_type == CEGL_SURFACE_WINDOW)
{
config_attribs.push_back(EGL_SURFACE_TYPE);
config_attribs.push_back(EGL_WINDOW_BIT);
}
else if (m_creation_params.surface_type == CEGL_SURFACE_PBUFFER)
{
config_attribs.push_back(EGL_SURFACE_TYPE);
config_attribs.push_back(EGL_PBUFFER_BIT);
}
config_attribs.push_back(EGL_NONE);
config_attribs.push_back(0);
EGLint num_configs = 0;
bool success = eglChooseConfig(m_egl_display, &config_attribs[0],
&m_egl_config, 1, &num_configs);
if (!success || m_egl_config == NULL || num_configs < 1)
{
config_attribs[1] = 5; //EGL_RED_SIZE
config_attribs[3] = 6; //EGL_GREEN_SIZE
config_attribs[5] = 5; //EGL_BLUE_SIZE
config_attribs[7] = 0; //EGL_ALPHA_SIZE
config_attribs[9] = 1; //EGL_DEPTH_SIZE
success = eglChooseConfig(m_egl_display, &config_attribs[0],
&m_egl_config, 1, &num_configs);
}
if (!success || m_egl_config == NULL || num_configs < 1)
{
return false;
}
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
EGLint format = 0;
eglGetConfigAttrib(m_egl_display, m_egl_config, EGL_NATIVE_VISUAL_ID,
&format);
ANativeWindow_setBuffersGeometry(m_egl_window, 0, 0, format);
#endif
return true;
}
bool ContextManagerEGL::createSurface()
{
if (m_creation_params.surface_type == CEGL_SURFACE_WINDOW)
{
if (m_egl_surface == EGL_NO_SURFACE)
{
m_egl_surface = eglCreateWindowSurface(m_egl_display, m_egl_config,
m_egl_window, NULL);
}
if (m_egl_surface == EGL_NO_SURFACE)
{
m_egl_surface = eglCreateWindowSurface(m_egl_display, m_egl_config,
0, NULL);
}
}
else if (m_creation_params.surface_type == CEGL_SURFACE_PBUFFER)
{
if (m_egl_surface == EGL_NO_SURFACE)
{
std::vector<EGLint> pbuffer_attribs;
pbuffer_attribs.push_back(EGL_WIDTH);
pbuffer_attribs.push_back(m_creation_params.pbuffer_width);
pbuffer_attribs.push_back(EGL_HEIGHT);
pbuffer_attribs.push_back(m_creation_params.pbuffer_height);
pbuffer_attribs.push_back(EGL_NONE);
pbuffer_attribs.push_back(0);
m_egl_surface = eglCreatePbufferSurface(m_egl_display,
m_egl_config,
&pbuffer_attribs[0]);
}
if (m_egl_surface == EGL_NO_SURFACE)
{
std::vector<EGLint> pbuffer_attribs;
pbuffer_attribs.push_back(EGL_WIDTH);
pbuffer_attribs.push_back(m_creation_params.pbuffer_width);
pbuffer_attribs.push_back(EGL_HEIGHT);
pbuffer_attribs.push_back(m_creation_params.pbuffer_height);
pbuffer_attribs.push_back(EGL_LARGEST_PBUFFER);
pbuffer_attribs.push_back(EGL_TRUE);
pbuffer_attribs.push_back(EGL_NONE);
pbuffer_attribs.push_back(0);
m_egl_surface = eglCreatePbufferSurface(m_egl_display,
m_egl_config,
&pbuffer_attribs[0]);
}
}
return m_egl_surface != EGL_NO_SURFACE;
}
bool ContextManagerEGL::createContext()
{
m_is_legacy_device = false;
if (m_creation_params.opengl_api == CEGL_API_OPENGL_ES)
{
if (!m_creation_params.force_legacy_device)
{
if (m_egl_context == EGL_NO_CONTEXT)
{
std::vector<EGLint> context_attribs;
context_attribs.push_back(EGL_CONTEXT_CLIENT_VERSION);
context_attribs.push_back(3);
context_attribs.push_back(EGL_NONE);
context_attribs.push_back(0);
m_egl_context = eglCreateContext(m_egl_display,
m_egl_config,
EGL_NO_CONTEXT,
&context_attribs[0]);
}
}
if (m_egl_context == EGL_NO_CONTEXT)
{
m_is_legacy_device = true;
std::vector<EGLint> context_attribs;
context_attribs.push_back(EGL_CONTEXT_CLIENT_VERSION);
context_attribs.push_back(2);
context_attribs.push_back(EGL_NONE);
context_attribs.push_back(0);
m_egl_context = eglCreateContext(m_egl_display,
m_egl_config,
EGL_NO_CONTEXT,
&context_attribs[0]);
}
}
else if (m_creation_params.opengl_api == CEGL_API_OPENGL)
{
if (!m_creation_params.force_legacy_device)
{
if (m_egl_context == EGL_NO_CONTEXT)
{
std::vector<EGLint> context_attribs;
context_attribs.push_back(EGL_CONTEXT_MAJOR_VERSION);
context_attribs.push_back(4);
context_attribs.push_back(EGL_CONTEXT_MINOR_VERSION);
context_attribs.push_back(3);
context_attribs.push_back(EGL_NONE);
context_attribs.push_back(0);
m_egl_context = eglCreateContext(m_egl_display,
m_egl_config,
EGL_NO_CONTEXT,
&context_attribs[0]);
}
if (m_egl_context == EGL_NO_CONTEXT)
{
std::vector<EGLint> context_attribs;
context_attribs.push_back(EGL_CONTEXT_MAJOR_VERSION);
context_attribs.push_back(3);
context_attribs.push_back(EGL_CONTEXT_MINOR_VERSION);
context_attribs.push_back(3);
context_attribs.push_back(EGL_NONE);
context_attribs.push_back(0);
m_egl_context = eglCreateContext(m_egl_display,
m_egl_config,
EGL_NO_CONTEXT,
&context_attribs[0]);
}
if (m_egl_context == EGL_NO_CONTEXT)
{
std::vector<EGLint> context_attribs;
context_attribs.push_back(EGL_CONTEXT_MAJOR_VERSION);
context_attribs.push_back(3);
context_attribs.push_back(EGL_CONTEXT_MINOR_VERSION);
context_attribs.push_back(1);
context_attribs.push_back(EGL_NONE);
context_attribs.push_back(0);
m_egl_context = eglCreateContext(m_egl_display,
m_egl_config,
EGL_NO_CONTEXT,
&context_attribs[0]);
}
}
if (m_egl_context == EGL_NO_CONTEXT)
{
m_is_legacy_device = true;
std::vector<EGLint> context_attribs;
context_attribs.push_back(EGL_CONTEXT_MAJOR_VERSION);
context_attribs.push_back(2);
context_attribs.push_back(EGL_CONTEXT_MINOR_VERSION);
context_attribs.push_back(1);
context_attribs.push_back(EGL_NONE);
context_attribs.push_back(0);
m_egl_context = eglCreateContext(m_egl_display,
m_egl_config,
EGL_NO_CONTEXT,
&context_attribs[0]);
}
}
return m_egl_context != EGL_NO_CONTEXT;
}
void ContextManagerEGL::close()
{
eglMakeCurrent(m_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
if (m_egl_context != EGL_NO_CONTEXT)
{
eglDestroyContext(m_egl_display, m_egl_context);
m_egl_context = EGL_NO_CONTEXT;
}
if (m_egl_surface != EGL_NO_SURFACE)
{
eglDestroySurface(m_egl_display, m_egl_surface);
m_egl_surface = EGL_NO_SURFACE;
}
if (m_egl_display != EGL_NO_DISPLAY)
{
eglTerminate(m_egl_display);
m_egl_display = EGL_NO_DISPLAY;
}
}
bool ContextManagerEGL::swapBuffers()
{
bool success = eglSwapBuffers(m_egl_display, m_egl_surface);
#ifdef DEBUG
if (!success)
{
eglGetError();
}
#endif
return success;
}
bool ContextManagerEGL::makeCurrent()
{
bool success = eglMakeCurrent(m_egl_display, m_egl_surface, m_egl_surface,
m_egl_context);
return success;
}
void ContextManagerEGL::reloadEGLSurface(void* window)
{
if (!m_initialized)
return;
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
m_egl_window = (ANativeWindow*)window;
if (!m_egl_window)
{
os::Printer::log("Error: Invalid EGL window.\n");
}
#endif
eglMakeCurrent(m_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE,
EGL_NO_CONTEXT);
eglDestroySurface(m_egl_display, m_egl_surface);
m_egl_surface = EGL_NO_SURFACE;
bool success = createSurface();
if (!success)
{
os::Printer::log("Error: Could not create EGL surface.");
}
success = eglMakeCurrent(m_egl_display, m_egl_surface, m_egl_surface,
m_egl_context);
if (!success)
{
checkEGLError();
os::Printer::log("Error: Couldn't make context current for EGL display.\n");
}
}
bool ContextManagerEGL::getSurfaceDimensions(int* width, int* height)
{
if (!eglQuerySurface(m_egl_display, m_egl_surface, EGL_WIDTH, width))
return false;
if (!eglQuerySurface(m_egl_display, m_egl_surface, EGL_HEIGHT, height))
return false;
return true;
}
bool ContextManagerEGL::hasEGLExtension(const char* extension)
{
const char* extensions = eglQueryString(m_egl_display, EGL_EXTENSIONS);
if (extensions && strstr(extensions, extension) != NULL)
{
return true;
}
return false;
}
bool ContextManagerEGL::checkEGLError()
{
bool result = true;
switch (eglGetError())
{
case EGL_SUCCESS:
result = false;
break;
case EGL_NOT_INITIALIZED:
os::Printer::log("Error: EGL_NOT_INITIALIZED\n");
break;
case EGL_BAD_ACCESS:
os::Printer::log("Error: EGL_BAD_ACCESS\n");
break;
case EGL_BAD_ALLOC:
os::Printer::log("Error: EGL_BAD_ALLOC\n");
break;
case EGL_BAD_ATTRIBUTE:
os::Printer::log("Error: EGL_BAD_ATTRIBUTE\n");
break;
case EGL_BAD_CONTEXT:
os::Printer::log("Error: EGL_BAD_CONTEXT\n");
break;
case EGL_BAD_CONFIG:
os::Printer::log("Error: EGL_BAD_CONFIG\n");
break;
case EGL_BAD_CURRENT_SURFACE:
os::Printer::log("Error: EGL_BAD_CURRENT_SURFACE\n");
break;
case EGL_BAD_DISPLAY:
os::Printer::log("Error: EGL_BAD_DISPLAY\n");
break;
case EGL_BAD_SURFACE:
os::Printer::log("Error: EGL_BAD_SURFACE\n");
break;
case EGL_BAD_MATCH:
os::Printer::log("Error: EGL_BAD_MATCH\n");
break;
case EGL_BAD_PARAMETER:
os::Printer::log("Error: EGL_BAD_PARAMETER\n");
break;
case EGL_BAD_NATIVE_PIXMAP:
os::Printer::log("Error: EGL_BAD_NATIVE_PIXMAP\n");
break;
case EGL_BAD_NATIVE_WINDOW:
os::Printer::log("Error: EGL_BAD_NATIVE_WINDOW\n");
break;
case EGL_CONTEXT_LOST:
os::Printer::log("Error: EGL_CONTEXT_LOST\n");
break;
default:
os::Printer::log("Error: Unknown EGL error.\n");
break;
};
return result;
}
#endif

View File

@ -0,0 +1,97 @@
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2016-2017 SuperTuxKart-Team
//
// 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 3
// of the License, or (at your option) 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef CONTEXT_EGL_HPP
#define CONTEXT_EGL_HPP
#include "IrrCompileConfig.h"
#if defined(_IRR_COMPILE_WITH_EGL_)
#include <EGL/egl.h>
#ifndef EGL_CONTEXT_MAJOR_VERSION
#define EGL_CONTEXT_MAJOR_VERSION 0x3098
#endif
#ifndef EGL_CONTEXT_MINOR_VERSION
#define EGL_CONTEXT_MINOR_VERSION 0x30FB
#endif
enum ContextEGLOpenGLAPI
{
CEGL_API_OPENGL,
CEGL_API_OPENGL_ES
};
enum ContextEGLSurfaceType
{
CEGL_SURFACE_WINDOW,
CEGL_SURFACE_PBUFFER
};
struct ContextEGLParams
{
ContextEGLOpenGLAPI opengl_api;
ContextEGLSurfaceType surface_type;
EGLNativeWindowType window;
EGLNativeDisplayType display;
bool force_legacy_device;
bool with_alpha_channel;
bool vsync_enabled;
int pbuffer_width;
int pbuffer_height;
};
class ContextManagerEGL
{
private:
EGLNativeWindowType m_egl_window;
EGLDisplay m_egl_display;
EGLSurface m_egl_surface;
EGLContext m_egl_context;
EGLConfig m_egl_config;
ContextEGLParams m_creation_params;
bool m_is_legacy_device;
bool m_initialized;
int m_egl_version;
bool initDisplay();
bool chooseConfig();
bool createSurface();
bool createContext();
bool hasEGLExtension(const char* extension);
bool checkEGLError();
public:
ContextManagerEGL();
~ContextManagerEGL();
bool init(const ContextEGLParams& params);
void close();
void reloadEGLSurface(void* window);
bool swapBuffers();
bool makeCurrent();
bool isLegacyDevice() {return m_is_legacy_device;}
bool getSurfaceDimensions(int* width, int* height);
};
#endif
#endif

View File

@ -116,7 +116,8 @@ bool CGUIButton::OnEvent(const SEvent& event)
{
case EET_KEY_INPUT_EVENT:
if (event.KeyInput.PressedDown &&
(event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE))
(event.KeyInput.Key == IRR_KEY_RETURN ||
event.KeyInput.Key == IRR_KEY_SPACE))
{
if (!IsPushButton)
setPressed(true);
@ -125,14 +126,16 @@ bool CGUIButton::OnEvent(const SEvent& event)
return true;
}
if (Pressed && !IsPushButton && event.KeyInput.PressedDown && event.KeyInput.Key == KEY_ESCAPE)
if (Pressed && !IsPushButton && event.KeyInput.PressedDown &&
event.KeyInput.Key == IRR_KEY_ESCAPE)
{
setPressed(false);
return true;
}
else
if (!event.KeyInput.PressedDown && Pressed &&
(event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE))
(event.KeyInput.Key == IRR_KEY_RETURN ||
event.KeyInput.Key == IRR_KEY_SPACE))
{
if (!IsPushButton)

View File

@ -40,20 +40,23 @@ bool CGUICheckBox::OnEvent(const SEvent& event)
{
case EET_KEY_INPUT_EVENT:
if (event.KeyInput.PressedDown &&
(event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE))
(event.KeyInput.Key == IRR_KEY_RETURN ||
event.KeyInput.Key == IRR_KEY_SPACE))
{
Pressed = true;
return true;
}
else
if (Pressed && event.KeyInput.PressedDown && event.KeyInput.Key == KEY_ESCAPE)
if (Pressed && event.KeyInput.PressedDown &&
event.KeyInput.Key == IRR_KEY_ESCAPE)
{
Pressed = false;
return true;
}
else
if (!event.KeyInput.PressedDown && Pressed &&
(event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE))
(event.KeyInput.Key == IRR_KEY_RETURN ||
event.KeyInput.Key == IRR_KEY_SPACE))
{
Pressed = false;
if (Parent)

View File

@ -208,14 +208,16 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
{
case EET_KEY_INPUT_EVENT:
if (ListBox && event.KeyInput.PressedDown && event.KeyInput.Key == KEY_ESCAPE)
if (ListBox && event.KeyInput.PressedDown &&
event.KeyInput.Key == IRR_KEY_ESCAPE)
{
// hide list box
openCloseMenu();
return true;
}
else
if (event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE)
if (event.KeyInput.Key == IRR_KEY_RETURN ||
event.KeyInput.Key == IRR_KEY_SPACE)
{
if (!event.KeyInput.PressedDown)
{
@ -233,18 +235,18 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
bool absorb = true;
switch (event.KeyInput.Key)
{
case KEY_DOWN:
case IRR_KEY_DOWN:
setSelected(Selected+1);
break;
case KEY_UP:
case IRR_KEY_UP:
setSelected(Selected-1);
break;
case KEY_HOME:
case KEY_PRIOR:
case IRR_KEY_HOME:
case IRR_KEY_PRIOR:
setSelected(0);
break;
case KEY_END:
case KEY_NEXT:
case IRR_KEY_END:
case IRR_KEY_NEXT:
setSelected((s32)Items.size()-1);
break;
default:

View File

@ -274,12 +274,12 @@ bool CGUIEditBox::processKey(const SEvent& event)
switch(event.KeyInput.Key)
{
case KEY_KEY_A:
case IRR_KEY_A:
// select all
newMarkBegin = 0;
newMarkEnd = Text.size();
break;
case KEY_KEY_C:
case IRR_KEY_C:
// copy to clipboard
if (!PasswordBox && Operator && MarkBegin != MarkEnd)
{
@ -295,7 +295,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
Operator->copyToClipboard(s.c_str());
}
break;
case KEY_KEY_X:
case IRR_KEY_X:
// cut to the clipboard
if (!PasswordBox && Operator && MarkBegin != MarkEnd)
{
@ -326,7 +326,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
}
}
break;
case KEY_KEY_V:
case IRR_KEY_V:
if ( !isEnabled() )
break;
@ -380,7 +380,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
textChanged = true;
}
break;
case KEY_HOME:
case IRR_KEY_HOME:
// move/highlight to start of text
if (event.KeyInput.Shift)
{
@ -395,7 +395,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
newMarkEnd = 0;
}
break;
case KEY_END:
case IRR_KEY_END:
// move/highlight to end of text
if (event.KeyInput.Shift)
{
@ -418,7 +418,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
else
switch(event.KeyInput.Key)
{
case KEY_END:
case IRR_KEY_END:
{
s32 p = Text.size();
if (WordWrap || MultiLine)
@ -445,7 +445,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
BlinkStartTime = os::Timer::getTime();
}
break;
case KEY_HOME:
case IRR_KEY_HOME:
{
s32 p = 0;
@ -470,7 +470,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
BlinkStartTime = os::Timer::getTime();
}
break;
case KEY_RETURN:
case IRR_KEY_RETURN:
if (MultiLine)
{
inputChar(L'\n');
@ -481,7 +481,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
sendGuiEvent( EGET_EDITBOX_ENTER );
}
return true;
case KEY_LEFT:
case IRR_KEY_LEFT:
if (event.KeyInput.Shift)
{
@ -503,7 +503,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
BlinkStartTime = os::Timer::getTime();
break;
case KEY_RIGHT:
case IRR_KEY_RIGHT:
if (event.KeyInput.Shift)
{
if (Text.size() > (u32)CursorPos)
@ -523,7 +523,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
if (Text.size() > (u32)CursorPos) CursorPos++;
BlinkStartTime = os::Timer::getTime();
break;
case KEY_UP:
case IRR_KEY_UP:
if (MultiLine || (WordWrap && BrokenText.size() > 1) )
{
s32 lineNo = getLineFromPos(CursorPos);
@ -554,7 +554,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
return false;
}
break;
case KEY_DOWN:
case IRR_KEY_DOWN:
if (MultiLine || (WordWrap && BrokenText.size() > 1) )
{
s32 lineNo = getLineFromPos(CursorPos);
@ -586,7 +586,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
}
break;
case KEY_BACK:
case IRR_KEY_BACK:
if ( !isEnabled() )
break;
@ -626,7 +626,7 @@ bool CGUIEditBox::processKey(const SEvent& event)
textChanged = true;
}
break;
case KEY_DELETE:
case IRR_KEY_DELETE:
if ( !isEnabled() )
break;
@ -664,33 +664,33 @@ bool CGUIEditBox::processKey(const SEvent& event)
}
break;
case KEY_ESCAPE:
case KEY_TAB:
case KEY_SHIFT:
case KEY_F1:
case KEY_F2:
case KEY_F3:
case KEY_F4:
case KEY_F5:
case KEY_F6:
case KEY_F7:
case KEY_F8:
case KEY_F9:
case KEY_F10:
case KEY_F11:
case KEY_F12:
case KEY_F13:
case KEY_F14:
case KEY_F15:
case KEY_F16:
case KEY_F17:
case KEY_F18:
case KEY_F19:
case KEY_F20:
case KEY_F21:
case KEY_F22:
case KEY_F23:
case KEY_F24:
case IRR_KEY_ESCAPE:
case IRR_KEY_TAB:
case IRR_KEY_SHIFT:
case IRR_KEY_F1:
case IRR_KEY_F2:
case IRR_KEY_F3:
case IRR_KEY_F4:
case IRR_KEY_F5:
case IRR_KEY_F6:
case IRR_KEY_F7:
case IRR_KEY_F8:
case IRR_KEY_F9:
case IRR_KEY_F10:
case IRR_KEY_F11:
case IRR_KEY_F12:
case IRR_KEY_F13:
case IRR_KEY_F14:
case IRR_KEY_F15:
case IRR_KEY_F16:
case IRR_KEY_F17:
case IRR_KEY_F18:
case IRR_KEY_F19:
case IRR_KEY_F20:
case IRR_KEY_F21:
case IRR_KEY_F22:
case IRR_KEY_F23:
case IRR_KEY_F24:
// ignore these keys
return false;

View File

@ -561,7 +561,7 @@ bool CGUIEnvironment::postEventFromUser(const SEvent& event)
// Send focus changing event
if (event.EventType == EET_KEY_INPUT_EVENT &&
event.KeyInput.PressedDown &&
event.KeyInput.Key == KEY_TAB)
event.KeyInput.Key == IRR_KEY_TAB)
{
IGUIElement *next = getNextElement(event.KeyInput.Shift, event.KeyInput.Control);
if (next && next != Focus)

View File

@ -236,32 +236,32 @@ bool CGUIListBox::OnEvent(const SEvent& event)
{
case EET_KEY_INPUT_EVENT:
if (event.KeyInput.PressedDown &&
(event.KeyInput.Key == KEY_DOWN ||
event.KeyInput.Key == KEY_UP ||
event.KeyInput.Key == KEY_HOME ||
event.KeyInput.Key == KEY_END ||
event.KeyInput.Key == KEY_NEXT ||
event.KeyInput.Key == KEY_PRIOR ) )
(event.KeyInput.Key == IRR_KEY_DOWN ||
event.KeyInput.Key == IRR_KEY_UP ||
event.KeyInput.Key == IRR_KEY_HOME ||
event.KeyInput.Key == IRR_KEY_END ||
event.KeyInput.Key == IRR_KEY_NEXT ||
event.KeyInput.Key == IRR_KEY_PRIOR))
{
s32 oldSelected = Selected;
switch (event.KeyInput.Key)
{
case KEY_DOWN:
case IRR_KEY_DOWN:
Selected += 1;
break;
case KEY_UP:
case IRR_KEY_UP:
Selected -= 1;
break;
case KEY_HOME:
case IRR_KEY_HOME:
Selected = 0;
break;
case KEY_END:
case IRR_KEY_END:
Selected = (s32)Items.size()-1;
break;
case KEY_NEXT:
case IRR_KEY_NEXT:
Selected += AbsoluteRect.getHeight() / ItemHeight;
break;
case KEY_PRIOR:
case IRR_KEY_PRIOR:
Selected -= AbsoluteRect.getHeight() / ItemHeight;
break;
default:
@ -290,7 +290,9 @@ bool CGUIListBox::OnEvent(const SEvent& event)
return true;
}
else
if (!event.KeyInput.PressedDown && ( event.KeyInput.Key == KEY_RETURN || event.KeyInput.Key == KEY_SPACE ) )
if (!event.KeyInput.PressedDown &&
(event.KeyInput.Key == IRR_KEY_RETURN ||
event.KeyInput.Key == IRR_KEY_SPACE))
{
if (Parent)
{

View File

@ -269,28 +269,28 @@ bool CGUIMessageBox::OnEvent(const SEvent& event)
{
switch (event.KeyInput.Key)
{
case KEY_RETURN:
case IRR_KEY_RETURN:
if (OkButton)
{
OkButton->setPressed(true);
Pressed = true;
}
break;
case KEY_KEY_Y:
case IRR_KEY_Y:
if (YesButton)
{
YesButton->setPressed(true);
Pressed = true;
}
break;
case KEY_KEY_N:
case IRR_KEY_N:
if (NoButton)
{
NoButton->setPressed(true);
Pressed = true;
}
break;
case KEY_ESCAPE:
case IRR_KEY_ESCAPE:
if (Pressed)
{
// cancel press
@ -319,7 +319,7 @@ bool CGUIMessageBox::OnEvent(const SEvent& event)
else
if (Pressed)
{
if (OkButton && event.KeyInput.Key == KEY_RETURN)
if (OkButton && event.KeyInput.Key == IRR_KEY_RETURN)
{
setVisible(false); // this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
Environment->setFocus(0);
@ -329,7 +329,7 @@ bool CGUIMessageBox::OnEvent(const SEvent& event)
return true;
}
else
if ((CancelButton || CloseButton) && event.KeyInput.Key == KEY_ESCAPE)
if ((CancelButton || CloseButton) && event.KeyInput.Key == IRR_KEY_ESCAPE)
{
setVisible(false); // this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
Environment->setFocus(0);
@ -339,7 +339,7 @@ bool CGUIMessageBox::OnEvent(const SEvent& event)
return true;
}
else
if (YesButton && event.KeyInput.Key == KEY_KEY_Y)
if (YesButton && event.KeyInput.Key == IRR_KEY_Y)
{
setVisible(false); // this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
Environment->setFocus(0);
@ -349,7 +349,7 @@ bool CGUIMessageBox::OnEvent(const SEvent& event)
return true;
}
else
if (NoButton && event.KeyInput.Key == KEY_KEY_N)
if (NoButton && event.KeyInput.Key == IRR_KEY_N)
{
setVisible(false); // this is a workaround to make sure it's no longer the hovered element, crashes on pressing 1-2 times ESC
Environment->setFocus(0);

View File

@ -71,24 +71,24 @@ bool CGUIScrollBar::OnEvent(const SEvent& event)
bool absorb = true;
switch (event.KeyInput.Key)
{
case KEY_LEFT:
case KEY_UP:
case IRR_KEY_LEFT:
case IRR_KEY_UP:
setPos(Pos-SmallStep);
break;
case KEY_RIGHT:
case KEY_DOWN:
case IRR_KEY_RIGHT:
case IRR_KEY_DOWN:
setPos(Pos+SmallStep);
break;
case KEY_HOME:
case IRR_KEY_HOME:
setPos(Min);
break;
case KEY_PRIOR:
case IRR_KEY_PRIOR:
setPos(Pos-LargeStep);
break;
case KEY_END:
case IRR_KEY_END:
setPos(Max);
break;
case KEY_NEXT:
case IRR_KEY_NEXT:
setPos(Pos+LargeStep);
break;
default:

View File

@ -10,6 +10,7 @@
#include <assert.h>
#include "os.h"
#include "CContextEGL.h"
#include "CFileSystem.h"
#include "COGLES2Driver.h"
@ -17,9 +18,6 @@ namespace irr
{
namespace video
{
IVideoDriver* createOGLES1Driver(const SIrrlichtCreationParameters& params,
video::SExposedVideoData& data, io::IFileSystem* io);
IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params,
video::SExposedVideoData& data, io::IFileSystem* io);
}
@ -34,7 +32,6 @@ namespace irr
bool CIrrDeviceAndroid::IsPaused = true;
bool CIrrDeviceAndroid::IsFocused = false;
bool CIrrDeviceAndroid::IsStarted = false;
bool CIrrDeviceAndroid::IsClosing = false;
//! constructor
CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param)
@ -48,12 +45,21 @@ CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param)
#endif
Android = (android_app *)(param.PrivateData);
IsClosing = Android->destroyRequested;
assert(Android != NULL);
Android->userData = this;
Android->onAppCmd = handleAndroidCommand;
Android->onInputEvent = handleInput;
createKeyMap();
CursorControl = new CCursorControl();
Close = Android->destroyRequested;
// It typically shouldn't happen, but just in case...
if (Close)
return;
SensorManager = ASensorManager_getInstance();
SensorEventQueue = ASensorManager_createEventQueue(SensorManager,
@ -62,15 +68,10 @@ CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param)
ANativeActivity_setWindowFlags(Android->activity,
AWINDOW_FLAG_KEEP_SCREEN_ON |
AWINDOW_FLAG_FULLSCREEN, 0);
createKeyMap();
// Create cursor control
CursorControl = new CCursorControl();
os::Printer::log("Waiting for Android activity window to be created.", ELL_DEBUG);
while ((!IsStarted || !IsFocused || IsPaused) && !IsClosing)
while (!IsStarted || !IsFocused || IsPaused)
{
s32 events = 0;
android_poll_source* source = 0;
@ -88,7 +89,7 @@ CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param)
ExposedVideoData.OGLESAndroid.Window = Android->window;
getVideoModeList();
createVideoModeList();
createDriver();
@ -100,27 +101,30 @@ CIrrDeviceAndroid::CIrrDeviceAndroid(const SIrrlichtCreationParameters& param)
CIrrDeviceAndroid::~CIrrDeviceAndroid()
{
Android->userData = NULL;
Android->onAppCmd = NULL;
Android->onInputEvent = NULL;
}
video::IVideoModeList* CIrrDeviceAndroid::getVideoModeList()
void CIrrDeviceAndroid::createVideoModeList()
{
if (Android == NULL || Android->window == NULL)
return NULL;
core::dimension2d<u32> size = core::dimension2d<u32>(
ANativeWindow_getWidth(Android->window),
ANativeWindow_getHeight(Android->window));
CreationParams.WindowSize.Width = size.Width;
CreationParams.WindowSize.Height = size.Height;
if (!VideoModeList.getVideoModeCount())
if (VideoModeList.getVideoModeCount() > 0)
return;
int width = ANativeWindow_getWidth(Android->window);
int height = ANativeWindow_getHeight(Android->window);
if (width > 0 && height > 0)
{
VideoModeList.addMode(size, 32);
VideoModeList.setDesktop(32, size);
CreationParams.WindowSize.Width = width;
CreationParams.WindowSize.Height = height;
}
return &VideoModeList;
core::dimension2d<u32> size = core::dimension2d<u32>(
CreationParams.WindowSize.Width,
CreationParams.WindowSize.Height);
VideoModeList.addMode(size, 32);
VideoModeList.setDesktop(32, size);
}
void CIrrDeviceAndroid::createDriver()
@ -128,14 +132,6 @@ void CIrrDeviceAndroid::createDriver()
// Create the driver.
switch(CreationParams.DriverType)
{
case video::EDT_OGLES1:
#ifdef _IRR_COMPILE_WITH_OGLES1_
VideoDriver = video::createOGLES1Driver(CreationParams, ExposedVideoData, FileSystem);
#else
os::Printer::log("No OpenGL ES 1.0 support compiled in.", ELL_ERROR);
#endif
break;
case video::EDT_OGLES2:
#ifdef _IRR_COMPILE_WITH_OGLES2_
VideoDriver = video::createOGLES2Driver(CreationParams, ExposedVideoData, FileSystem);
@ -157,12 +153,12 @@ void CIrrDeviceAndroid::createDriver()
bool CIrrDeviceAndroid::run()
{
os::Timer::tick();
while (!IsClosing)
while (!Close)
{
s32 Events = 0;
android_poll_source* Source = 0;
bool should_run = (IsStarted && IsFocused && !IsPaused) || IsClosing;
bool should_run = (IsStarted && IsFocused && !IsPaused);
s32 id = ALooper_pollAll(should_run ? 0 : -1, NULL, &Events,
(void**)&Source);
@ -208,7 +204,7 @@ bool CIrrDeviceAndroid::run()
}
}
return !IsClosing;
return !Close;
}
void CIrrDeviceAndroid::yield()
@ -261,6 +257,7 @@ bool CIrrDeviceAndroid::isWindowMinimized() const
void CIrrDeviceAndroid::closeDevice()
{
Close = true;
}
void CIrrDeviceAndroid::setResizable(bool resize)
@ -287,6 +284,7 @@ E_DEVICE_TYPE CIrrDeviceAndroid::getType() const
void CIrrDeviceAndroid::handleAndroidCommand(android_app* app, int32_t cmd)
{
CIrrDeviceAndroid* device = (CIrrDeviceAndroid *)app->userData;
assert(device != NULL);
switch (cmd)
{
@ -296,18 +294,15 @@ void CIrrDeviceAndroid::handleAndroidCommand(android_app* app, int32_t cmd)
case APP_CMD_INIT_WINDOW:
os::Printer::log("Android command APP_CMD_INIT_WINDOW", ELL_DEBUG);
if (device != NULL)
device->getExposedVideoData().OGLESAndroid.Window = app->window;
// If the Android app is resumed, we need to re-create EGL surface
// to allow to draw something on it again.
if (device->VideoDriver != NULL &&
device->CreationParams.DriverType == video::EDT_OGLES2)
{
device->getExposedVideoData().OGLESAndroid.Window = app->window;
// If the Android app is resumed, we need to re-create EGL surface
// to allow to draw something on it again.
if (device->VideoDriver != NULL &&
device->CreationParams.DriverType == video::EDT_OGLES2)
{
video::COGLES2Driver* driver = (video::COGLES2Driver*)(device->VideoDriver);
driver->reloadEGLSurface(app->window);
}
video::COGLES2Driver* driver = (video::COGLES2Driver*)(device->VideoDriver);
driver->getEGLContext()->reloadEGLSurface(app->window);
}
IsStarted = true;
@ -326,7 +321,7 @@ void CIrrDeviceAndroid::handleAndroidCommand(android_app* app, int32_t cmd)
break;
case APP_CMD_DESTROY:
os::Printer::log("Android command APP_CMD_DESTROY", ELL_DEBUG);
IsClosing = true;
device->Close = true;
// Make sure that state variables are set to the default state
// when the app is destroyed
IsPaused = true;
@ -360,25 +355,20 @@ void CIrrDeviceAndroid::handleAndroidCommand(android_app* app, int32_t cmd)
break;
}
if (device != NULL)
{
SEvent event;
event.EventType = EET_SYSTEM_EVENT;
event.SystemEvent.EventType = ESET_ANDROID_CMD;
event.SystemEvent.AndroidCmd.Cmd = cmd;
device->postEventFromUser(event);
}
SEvent event;
event.EventType = EET_SYSTEM_EVENT;
event.SystemEvent.EventType = ESET_ANDROID_CMD;
event.SystemEvent.AndroidCmd.Cmd = cmd;
device->postEventFromUser(event);
}
s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
{
CIrrDeviceAndroid* device = (CIrrDeviceAndroid*)app->userData;
assert(device != NULL);
s32 status = 0;
if (device == NULL)
return status;
switch (AInputEvent_getType(androidEvent))
{
case AINPUT_EVENT_TYPE_MOTION:
@ -505,7 +495,7 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
event.EventType = EET_KEY_INPUT_EVENT;
event.KeyInput.Char = 0;
event.KeyInput.PressedDown = false;
event.KeyInput.Key = KEY_UNKNOWN;
event.KeyInput.Key = IRR_KEY_UNKNOWN;
int32_t keyCode = AKeyEvent_getKeyCode(androidEvent);
int32_t keyAction = AKeyEvent_getAction(androidEvent);
@ -539,11 +529,7 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
keyMetaState & AMETA_CTRL_RIGHT_ON);
event.KeyInput.SystemKeyCode = (u32)keyCode;
if (keyCode >= 0 && (u32)keyCode < device->KeyMap.size())
{
event.KeyInput.Key = device->KeyMap[keyCode];
}
event.KeyInput.Key = device->KeyMap[keyCode];
if (event.KeyInput.Key > 0)
{
@ -590,234 +576,232 @@ video::SExposedVideoData& CIrrDeviceAndroid::getExposedVideoData()
void CIrrDeviceAndroid::createKeyMap()
{
KeyMap.set_used(223);
KeyMap[0] = KEY_UNKNOWN; // AKEYCODE_UNKNOWN
KeyMap[1] = KEY_LBUTTON; // AKEYCODE_SOFT_LEFT
KeyMap[2] = KEY_RBUTTON; // AKEYCODE_SOFT_RIGHT
KeyMap[3] = KEY_HOME; // AKEYCODE_HOME
KeyMap[4] = KEY_ESCAPE; // AKEYCODE_BACK
KeyMap[5] = KEY_UNKNOWN; // AKEYCODE_CALL
KeyMap[6] = KEY_UNKNOWN; // AKEYCODE_ENDCALL
KeyMap[7] = KEY_KEY_0; // AKEYCODE_0
KeyMap[8] = KEY_KEY_1; // AKEYCODE_1
KeyMap[9] = KEY_KEY_2; // AKEYCODE_2
KeyMap[10] = KEY_KEY_3; // AKEYCODE_3
KeyMap[11] = KEY_KEY_4; // AKEYCODE_4
KeyMap[12] = KEY_KEY_5; // AKEYCODE_5
KeyMap[13] = KEY_KEY_6; // AKEYCODE_6
KeyMap[14] = KEY_KEY_7; // AKEYCODE_7
KeyMap[15] = KEY_KEY_8; // AKEYCODE_8
KeyMap[16] = KEY_KEY_9; // AKEYCODE_9
KeyMap[17] = KEY_UNKNOWN; // AKEYCODE_STAR
KeyMap[18] = KEY_UNKNOWN; // AKEYCODE_POUND
KeyMap[19] = KEY_UP; // AKEYCODE_DPAD_UP
KeyMap[20] = KEY_DOWN; // AKEYCODE_DPAD_DOWN
KeyMap[21] = KEY_LEFT; // AKEYCODE_DPAD_LEFT
KeyMap[22] = KEY_RIGHT; // AKEYCODE_DPAD_RIGHT
KeyMap[23] = KEY_SELECT; // AKEYCODE_DPAD_CENTER
KeyMap[24] = KEY_VOLUME_DOWN; // AKEYCODE_VOLUME_UP
KeyMap[25] = KEY_VOLUME_UP; // AKEYCODE_VOLUME_DOWN
KeyMap[26] = KEY_UNKNOWN; // AKEYCODE_POWER
KeyMap[27] = KEY_UNKNOWN; // AKEYCODE_CAMERA
KeyMap[28] = KEY_CLEAR; // AKEYCODE_CLEAR
KeyMap[29] = KEY_KEY_A; // AKEYCODE_A
KeyMap[30] = KEY_KEY_B; // AKEYCODE_B
KeyMap[31] = KEY_KEY_C; // AKEYCODE_C
KeyMap[32] = KEY_KEY_D; // AKEYCODE_D
KeyMap[33] = KEY_KEY_E; // AKEYCODE_E
KeyMap[34] = KEY_KEY_F; // AKEYCODE_F
KeyMap[35] = KEY_KEY_G; // AKEYCODE_G
KeyMap[36] = KEY_KEY_H; // AKEYCODE_H
KeyMap[37] = KEY_KEY_I; // AKEYCODE_I
KeyMap[38] = KEY_KEY_J; // AKEYCODE_J
KeyMap[39] = KEY_KEY_K; // AKEYCODE_K
KeyMap[40] = KEY_KEY_L; // AKEYCODE_L
KeyMap[41] = KEY_KEY_M; // AKEYCODE_M
KeyMap[42] = KEY_KEY_N; // AKEYCODE_N
KeyMap[43] = KEY_KEY_O; // AKEYCODE_O
KeyMap[44] = KEY_KEY_P; // AKEYCODE_P
KeyMap[45] = KEY_KEY_Q; // AKEYCODE_Q
KeyMap[46] = KEY_KEY_R; // AKEYCODE_R
KeyMap[47] = KEY_KEY_S; // AKEYCODE_S
KeyMap[48] = KEY_KEY_T; // AKEYCODE_T
KeyMap[49] = KEY_KEY_U; // AKEYCODE_U
KeyMap[50] = KEY_KEY_V; // AKEYCODE_V
KeyMap[51] = KEY_KEY_W; // AKEYCODE_W
KeyMap[52] = KEY_KEY_X; // AKEYCODE_X
KeyMap[53] = KEY_KEY_Y; // AKEYCODE_Y
KeyMap[54] = KEY_KEY_Z; // AKEYCODE_Z
KeyMap[55] = KEY_COMMA; // AKEYCODE_COMMA
KeyMap[56] = KEY_PERIOD; // AKEYCODE_PERIOD
KeyMap[57] = KEY_MENU; // AKEYCODE_ALT_LEFT
KeyMap[58] = KEY_MENU; // AKEYCODE_ALT_RIGHT
KeyMap[59] = KEY_LSHIFT; // AKEYCODE_SHIFT_LEFT
KeyMap[60] = KEY_RSHIFT; // AKEYCODE_SHIFT_RIGHT
KeyMap[61] = KEY_TAB; // AKEYCODE_TAB
KeyMap[62] = KEY_SPACE; // AKEYCODE_SPACE
KeyMap[63] = KEY_UNKNOWN; // AKEYCODE_SYM
KeyMap[64] = KEY_UNKNOWN; // AKEYCODE_EXPLORER
KeyMap[65] = KEY_UNKNOWN; // AKEYCODE_ENVELOPE
KeyMap[66] = KEY_RETURN; // AKEYCODE_ENTER
KeyMap[67] = KEY_BACK; // AKEYCODE_DEL
KeyMap[68] = KEY_OEM_3; // AKEYCODE_GRAVE
KeyMap[69] = KEY_MINUS; // AKEYCODE_MINUS
KeyMap[70] = KEY_UNKNOWN; // AKEYCODE_EQUALS
KeyMap[71] = KEY_UNKNOWN; // AKEYCODE_LEFT_BRACKET
KeyMap[72] = KEY_UNKNOWN; // AKEYCODE_RIGHT_BRACKET
KeyMap[73] = KEY_UNKNOWN; // AKEYCODE_BACKSLASH
KeyMap[74] = KEY_UNKNOWN; // AKEYCODE_SEMICOLON
KeyMap[75] = KEY_UNKNOWN; // AKEYCODE_APOSTROPHE
KeyMap[76] = KEY_UNKNOWN; // AKEYCODE_SLASH
KeyMap[77] = KEY_UNKNOWN; // AKEYCODE_AT
KeyMap[78] = KEY_UNKNOWN; // AKEYCODE_NUM
KeyMap[79] = KEY_UNKNOWN; // AKEYCODE_HEADSETHOOK
KeyMap[80] = KEY_UNKNOWN; // AKEYCODE_FOCUS (*Camera* focus)
KeyMap[81] = KEY_PLUS; // AKEYCODE_PLUS
KeyMap[82] = KEY_MENU; // AKEYCODE_MENU
KeyMap[83] = KEY_UNKNOWN; // AKEYCODE_NOTIFICATION
KeyMap[84] = KEY_UNKNOWN; // AKEYCODE_SEARCH
KeyMap[85] = KEY_MEDIA_PLAY_PAUSE; // AKEYCODE_MEDIA_PLAY_PAUSE
KeyMap[86] = KEY_MEDIA_STOP; // AKEYCODE_MEDIA_STOP
KeyMap[87] = KEY_MEDIA_NEXT_TRACK; // AKEYCODE_MEDIA_NEXT
KeyMap[88] = KEY_MEDIA_PREV_TRACK; // AKEYCODE_MEDIA_PREVIOUS
KeyMap[89] = KEY_UNKNOWN; // AKEYCODE_MEDIA_REWIND
KeyMap[90] = KEY_UNKNOWN; // AKEYCODE_MEDIA_FAST_FORWARD
KeyMap[91] = KEY_VOLUME_MUTE; // AKEYCODE_MUTE
KeyMap[92] = KEY_PRIOR; // AKEYCODE_PAGE_UP
KeyMap[93] = KEY_NEXT; // AKEYCODE_PAGE_DOWN
KeyMap[94] = KEY_UNKNOWN; // AKEYCODE_PICTSYMBOLS
KeyMap[95] = KEY_UNKNOWN; // AKEYCODE_SWITCH_CHARSET
KeyMap[AKEYCODE_UNKNOWN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_SOFT_LEFT] = IRR_KEY_LBUTTON;
KeyMap[AKEYCODE_SOFT_RIGHT] = IRR_KEY_RBUTTON;
KeyMap[AKEYCODE_HOME] = IRR_KEY_HOME;
KeyMap[AKEYCODE_BACK] = IRR_KEY_ESCAPE;
KeyMap[AKEYCODE_CALL] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_ENDCALL] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_0] = IRR_KEY_0;
KeyMap[AKEYCODE_1] = IRR_KEY_1;
KeyMap[AKEYCODE_2] = IRR_KEY_2;
KeyMap[AKEYCODE_3] = IRR_KEY_3;
KeyMap[AKEYCODE_4] = IRR_KEY_4;
KeyMap[AKEYCODE_5] = IRR_KEY_5;
KeyMap[AKEYCODE_6] = IRR_KEY_6;
KeyMap[AKEYCODE_7] = IRR_KEY_7;
KeyMap[AKEYCODE_8] = IRR_KEY_8;
KeyMap[AKEYCODE_9] = IRR_KEY_9;
KeyMap[AKEYCODE_STAR] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_POUND] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_DPAD_UP] = IRR_KEY_UP;
KeyMap[AKEYCODE_DPAD_DOWN] = IRR_KEY_DOWN;
KeyMap[AKEYCODE_DPAD_LEFT] = IRR_KEY_LEFT;
KeyMap[AKEYCODE_DPAD_RIGHT] = IRR_KEY_RIGHT;
KeyMap[AKEYCODE_DPAD_CENTER] = IRR_KEY_SELECT;
KeyMap[AKEYCODE_VOLUME_UP] = IRR_KEY_VOLUME_DOWN;
KeyMap[AKEYCODE_VOLUME_DOWN] = IRR_KEY_VOLUME_UP;
KeyMap[AKEYCODE_POWER] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CAMERA] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CLEAR] = IRR_KEY_CLEAR;
KeyMap[AKEYCODE_A] = IRR_KEY_A;
KeyMap[AKEYCODE_B] = IRR_KEY_B;
KeyMap[AKEYCODE_C] = IRR_KEY_C;
KeyMap[AKEYCODE_D] = IRR_KEY_D;
KeyMap[AKEYCODE_E] = IRR_KEY_E;
KeyMap[AKEYCODE_F] = IRR_KEY_F;
KeyMap[AKEYCODE_G] = IRR_KEY_G;
KeyMap[AKEYCODE_H] = IRR_KEY_H;
KeyMap[AKEYCODE_I] = IRR_KEY_I;
KeyMap[AKEYCODE_J] = IRR_KEY_J;
KeyMap[AKEYCODE_K] = IRR_KEY_K;
KeyMap[AKEYCODE_L] = IRR_KEY_L;
KeyMap[AKEYCODE_M] = IRR_KEY_M;
KeyMap[AKEYCODE_N] = IRR_KEY_N;
KeyMap[AKEYCODE_O] = IRR_KEY_O;
KeyMap[AKEYCODE_P] = IRR_KEY_P;
KeyMap[AKEYCODE_Q] = IRR_KEY_Q;
KeyMap[AKEYCODE_R] = IRR_KEY_R;
KeyMap[AKEYCODE_S] = IRR_KEY_S;
KeyMap[AKEYCODE_T] = IRR_KEY_T;
KeyMap[AKEYCODE_U] = IRR_KEY_U;
KeyMap[AKEYCODE_V] = IRR_KEY_V;
KeyMap[AKEYCODE_W] = IRR_KEY_W;
KeyMap[AKEYCODE_X] = IRR_KEY_X;
KeyMap[AKEYCODE_Y] = IRR_KEY_Y;
KeyMap[AKEYCODE_Z] = IRR_KEY_Z;
KeyMap[AKEYCODE_COMMA] = IRR_KEY_COMMA;
KeyMap[AKEYCODE_PERIOD] = IRR_KEY_PERIOD;
KeyMap[AKEYCODE_ALT_LEFT] = IRR_KEY_MENU;
KeyMap[AKEYCODE_ALT_RIGHT] = IRR_KEY_MENU;
KeyMap[AKEYCODE_SHIFT_LEFT] = IRR_KEY_LSHIFT;
KeyMap[AKEYCODE_SHIFT_RIGHT] = IRR_KEY_RSHIFT;
KeyMap[AKEYCODE_TAB] = IRR_KEY_TAB;
KeyMap[AKEYCODE_SPACE] = IRR_KEY_SPACE;
KeyMap[AKEYCODE_SYM] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_EXPLORER] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_ENVELOPE] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_ENTER] = IRR_KEY_RETURN;
KeyMap[AKEYCODE_DEL] = IRR_KEY_BACK;
KeyMap[AKEYCODE_GRAVE] = IRR_KEY_OEM_3;
KeyMap[AKEYCODE_MINUS] = IRR_KEY_MINUS;
KeyMap[AKEYCODE_EQUALS] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_LEFT_BRACKET] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_RIGHT_BRACKET] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BACKSLASH] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_SEMICOLON] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_APOSTROPHE] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_SLASH] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_AT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_NUM] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_HEADSETHOOK] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_FOCUS] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_PLUS] = IRR_KEY_PLUS;
KeyMap[AKEYCODE_MENU] = IRR_KEY_MENU;
KeyMap[AKEYCODE_NOTIFICATION] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_SEARCH] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MEDIA_PLAY_PAUSE] = IRR_KEY_MEDIA_PLAY_PAUSE;
KeyMap[AKEYCODE_MEDIA_STOP] = IRR_KEY_MEDIA_STOP;
KeyMap[AKEYCODE_MEDIA_NEXT] = IRR_KEY_MEDIA_NEXT_TRACK;
KeyMap[AKEYCODE_MEDIA_PREVIOUS] = IRR_KEY_MEDIA_PREV_TRACK;
KeyMap[AKEYCODE_MEDIA_REWIND] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MEDIA_FAST_FORWARD] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MUTE] = IRR_KEY_VOLUME_MUTE;
KeyMap[AKEYCODE_PAGE_UP] = IRR_KEY_PRIOR;
KeyMap[AKEYCODE_PAGE_DOWN] = IRR_KEY_NEXT;
KeyMap[AKEYCODE_PICTSYMBOLS] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_SWITCH_CHARSET] = IRR_KEY_UNKNOWN;
// following look like controller inputs
KeyMap[96] = KEY_UNKNOWN; // AKEYCODE_BUTTON_A
KeyMap[97] = KEY_UNKNOWN; // AKEYCODE_BUTTON_B
KeyMap[98] = KEY_UNKNOWN; // AKEYCODE_BUTTON_C
KeyMap[99] = KEY_UNKNOWN; // AKEYCODE_BUTTON_X
KeyMap[100] = KEY_UNKNOWN; // AKEYCODE_BUTTON_Y
KeyMap[101] = KEY_UNKNOWN; // AKEYCODE_BUTTON_Z
KeyMap[102] = KEY_UNKNOWN; // AKEYCODE_BUTTON_L1
KeyMap[103] = KEY_UNKNOWN; // AKEYCODE_BUTTON_R1
KeyMap[104] = KEY_UNKNOWN; // AKEYCODE_BUTTON_L2
KeyMap[105] = KEY_UNKNOWN; // AKEYCODE_BUTTON_R2
KeyMap[106] = KEY_UNKNOWN; // AKEYCODE_BUTTON_THUMBL
KeyMap[107] = KEY_UNKNOWN; // AKEYCODE_BUTTON_THUMBR
KeyMap[108] = KEY_UNKNOWN; // AKEYCODE_BUTTON_START
KeyMap[109] = KEY_UNKNOWN; // AKEYCODE_BUTTON_SELECT
KeyMap[110] = KEY_UNKNOWN; // AKEYCODE_BUTTON_MODE
KeyMap[AKEYCODE_BUTTON_A] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_B] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_C] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_X] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_Y] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_Z] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_L1] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_R1] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_L2] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_R2] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_THUMBL] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_THUMBR] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_START] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_SELECT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_MODE] = IRR_KEY_UNKNOWN;
KeyMap[111] = KEY_ESCAPE; // AKEYCODE_ESCAPE
KeyMap[112] = KEY_DELETE; // AKEYCODE_FORWARD_DEL
KeyMap[113] = KEY_CONTROL; // AKEYCODE_CTRL_LEFT
KeyMap[114] = KEY_CONTROL; // AKEYCODE_CTRL_RIGHT
KeyMap[115] = KEY_CAPITAL; // AKEYCODE_CAPS_LOCK
KeyMap[116] = KEY_SCROLL; // AKEYCODE_SCROLL_LOCK
KeyMap[117] = KEY_UNKNOWN; // AKEYCODE_META_LEFT
KeyMap[118] = KEY_UNKNOWN; // AKEYCODE_META_RIGHT
KeyMap[119] = KEY_UNKNOWN; // AKEYCODE_FUNCTION
KeyMap[120] = KEY_SNAPSHOT; // AKEYCODE_SYSRQ
KeyMap[121] = KEY_PAUSE; // AKEYCODE_BREAK
KeyMap[122] = KEY_HOME; // AKEYCODE_MOVE_HOME
KeyMap[123] = KEY_END; // AKEYCODE_MOVE_END
KeyMap[124] = KEY_INSERT; // AKEYCODE_INSERT
KeyMap[125] = KEY_UNKNOWN; // AKEYCODE_FORWARD
KeyMap[126] = KEY_PLAY; // AKEYCODE_MEDIA_PLAY
KeyMap[127] = KEY_MEDIA_PLAY_PAUSE; // AKEYCODE_MEDIA_PAUSE
KeyMap[128] = KEY_UNKNOWN; // AKEYCODE_MEDIA_CLOSE
KeyMap[129] = KEY_UNKNOWN; // AKEYCODE_MEDIA_EJECT
KeyMap[130] = KEY_UNKNOWN; // AKEYCODE_MEDIA_RECORD
KeyMap[131] = KEY_F1; // AKEYCODE_F1
KeyMap[132] = KEY_F2; // AKEYCODE_F2
KeyMap[133] = KEY_F3; // AKEYCODE_F3
KeyMap[134] = KEY_F4; // AKEYCODE_F4
KeyMap[135] = KEY_F5; // AKEYCODE_F5
KeyMap[136] = KEY_F6; // AKEYCODE_F6
KeyMap[137] = KEY_F7; // AKEYCODE_F7
KeyMap[138] = KEY_F8; // AKEYCODE_F8
KeyMap[139] = KEY_F9; // AKEYCODE_F9
KeyMap[140] = KEY_F10; // AKEYCODE_F10
KeyMap[141] = KEY_F11; // AKEYCODE_F11
KeyMap[142] = KEY_F12; // AKEYCODE_F12
KeyMap[143] = KEY_NUMLOCK; // AKEYCODE_NUM_LOCK
KeyMap[144] = KEY_NUMPAD0; // AKEYCODE_NUMPAD_0
KeyMap[145] = KEY_NUMPAD1; // AKEYCODE_NUMPAD_1
KeyMap[146] = KEY_NUMPAD2; // AKEYCODE_NUMPAD_2
KeyMap[147] = KEY_NUMPAD3; // AKEYCODE_NUMPAD_3
KeyMap[148] = KEY_NUMPAD4; // AKEYCODE_NUMPAD_4
KeyMap[149] = KEY_NUMPAD5; // AKEYCODE_NUMPAD_5
KeyMap[150] = KEY_NUMPAD6; // AKEYCODE_NUMPAD_6
KeyMap[151] = KEY_NUMPAD7; // AKEYCODE_NUMPAD_7
KeyMap[152] = KEY_NUMPAD8; // AKEYCODE_NUMPAD_8
KeyMap[153] = KEY_NUMPAD9; // AKEYCODE_NUMPAD_9
KeyMap[154] = KEY_DIVIDE; // AKEYCODE_NUMPAD_DIVIDE
KeyMap[155] = KEY_MULTIPLY; // AKEYCODE_NUMPAD_MULTIPLY
KeyMap[156] = KEY_SUBTRACT; // AKEYCODE_NUMPAD_SUBTRACT
KeyMap[157] = KEY_ADD; // AKEYCODE_NUMPAD_ADD
KeyMap[158] = KEY_UNKNOWN; // AKEYCODE_NUMPAD_DOT
KeyMap[159] = KEY_COMMA; // AKEYCODE_NUMPAD_COMMA
KeyMap[160] = KEY_RETURN; // AKEYCODE_NUMPAD_ENTER
KeyMap[161] = KEY_UNKNOWN; // AKEYCODE_NUMPAD_EQUALS
KeyMap[162] = KEY_UNKNOWN; // AKEYCODE_NUMPAD_LEFT_PAREN
KeyMap[163] = KEY_UNKNOWN; // AKEYCODE_NUMPAD_RIGHT_PAREN
KeyMap[164] = KEY_VOLUME_MUTE; // AKEYCODE_VOLUME_MUTE
KeyMap[165] = KEY_UNKNOWN; // AKEYCODE_INFO
KeyMap[166] = KEY_UNKNOWN; // AKEYCODE_CHANNEL_UP
KeyMap[167] = KEY_UNKNOWN; // AKEYCODE_CHANNEL_DOWN
KeyMap[168] = KEY_ZOOM; // AKEYCODE_ZOOM_IN
KeyMap[169] = KEY_UNKNOWN; // AKEYCODE_ZOOM_OUT
KeyMap[170] = KEY_UNKNOWN; // AKEYCODE_TV
KeyMap[171] = KEY_UNKNOWN; // AKEYCODE_WINDOW
KeyMap[172] = KEY_UNKNOWN; // AKEYCODE_GUIDE
KeyMap[173] = KEY_UNKNOWN; // AKEYCODE_DVR
KeyMap[174] = KEY_UNKNOWN; // AKEYCODE_BOOKMARK
KeyMap[175] = KEY_UNKNOWN; // AKEYCODE_CAPTIONS
KeyMap[176] = KEY_UNKNOWN; // AKEYCODE_SETTINGS
KeyMap[177] = KEY_UNKNOWN; // AKEYCODE_TV_POWER
KeyMap[178] = KEY_UNKNOWN; // AKEYCODE_TV_INPUT
KeyMap[179] = KEY_UNKNOWN; // AKEYCODE_STB_POWER
KeyMap[180] = KEY_UNKNOWN; // AKEYCODE_STB_INPUT
KeyMap[181] = KEY_UNKNOWN; // AKEYCODE_AVR_POWER
KeyMap[182] = KEY_UNKNOWN; // AKEYCODE_AVR_INPUT
KeyMap[183] = KEY_UNKNOWN; // AKEYCODE_PROG_RED
KeyMap[184] = KEY_UNKNOWN; // AKEYCODE_PROG_GREEN
KeyMap[185] = KEY_UNKNOWN; // AKEYCODE_PROG_YELLOW
KeyMap[186] = KEY_UNKNOWN; // AKEYCODE_PROG_BLUE
KeyMap[187] = KEY_UNKNOWN; // AKEYCODE_APP_SWITCH
KeyMap[188] = KEY_UNKNOWN; // AKEYCODE_BUTTON_1
KeyMap[189] = KEY_UNKNOWN; // AKEYCODE_BUTTON_2
KeyMap[190] = KEY_UNKNOWN; // AKEYCODE_BUTTON_3
KeyMap[191] = KEY_UNKNOWN; // AKEYCODE_BUTTON_4
KeyMap[192] = KEY_UNKNOWN; // AKEYCODE_BUTTON_5
KeyMap[193] = KEY_UNKNOWN; // AKEYCODE_BUTTON_6
KeyMap[194] = KEY_UNKNOWN; // AKEYCODE_BUTTON_7
KeyMap[195] = KEY_UNKNOWN; // AKEYCODE_BUTTON_8
KeyMap[196] = KEY_UNKNOWN; // AKEYCODE_BUTTON_9
KeyMap[197] = KEY_UNKNOWN; // AKEYCODE_BUTTON_10
KeyMap[198] = KEY_UNKNOWN; // AKEYCODE_BUTTON_11
KeyMap[199] = KEY_UNKNOWN; // AKEYCODE_BUTTON_12
KeyMap[200] = KEY_UNKNOWN; // AKEYCODE_BUTTON_13
KeyMap[201] = KEY_UNKNOWN; // AKEYCODE_BUTTON_14
KeyMap[202] = KEY_UNKNOWN; // AKEYCODE_BUTTON_15
KeyMap[203] = KEY_UNKNOWN; // AKEYCODE_BUTTON_16
KeyMap[204] = KEY_UNKNOWN; // AKEYCODE_LANGUAGE_SWITCH
KeyMap[205] = KEY_UNKNOWN; // AKEYCODE_MANNER_MODE
KeyMap[206] = KEY_UNKNOWN; // AKEYCODE_3D_MODE
KeyMap[207] = KEY_UNKNOWN; // AKEYCODE_CONTACTS
KeyMap[208] = KEY_UNKNOWN; // AKEYCODE_CALENDAR
KeyMap[209] = KEY_UNKNOWN; // AKEYCODE_MUSIC
KeyMap[210] = KEY_UNKNOWN; // AKEYCODE_CALCULATOR
KeyMap[211] = KEY_UNKNOWN; // AKEYCODE_ZENKAKU_HANKAKU
KeyMap[212] = KEY_UNKNOWN; // AKEYCODE_EISU
KeyMap[213] = KEY_UNKNOWN; // AKEYCODE_MUHENKAN
KeyMap[214] = KEY_UNKNOWN; // AKEYCODE_HENKAN
KeyMap[215] = KEY_UNKNOWN; // AKEYCODE_KATAKANA_HIRAGANA
KeyMap[216] = KEY_UNKNOWN; // AKEYCODE_YEN
KeyMap[217] = KEY_UNKNOWN; // AKEYCODE_RO
KeyMap[218] = KEY_UNKNOWN; // AKEYCODE_KANA
KeyMap[219] = KEY_UNKNOWN; // AKEYCODE_ASSIST
KeyMap[220] = KEY_UNKNOWN; // AKEYCODE_BRIGHTNESS_DOWN
KeyMap[221] = KEY_UNKNOWN; // AKEYCODE_BRIGHTNESS_UP ,
KeyMap[222] = KEY_UNKNOWN; // AKEYCODE_MEDIA_AUDIO_TRACK
KeyMap[AKEYCODE_ESCAPE] = IRR_KEY_ESCAPE;
KeyMap[AKEYCODE_FORWARD_DEL] = IRR_KEY_DELETE;
KeyMap[AKEYCODE_CTRL_LEFT] = IRR_KEY_CONTROL;
KeyMap[AKEYCODE_CTRL_RIGHT] = IRR_KEY_CONTROL;
KeyMap[AKEYCODE_CAPS_LOCK] = IRR_KEY_CAPITAL;
KeyMap[AKEYCODE_SCROLL_LOCK] = IRR_KEY_SCROLL;
KeyMap[AKEYCODE_META_LEFT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_META_RIGHT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_FUNCTION] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_SYSRQ] = IRR_KEY_SNAPSHOT;
KeyMap[AKEYCODE_BREAK] = IRR_KEY_PAUSE;
KeyMap[AKEYCODE_MOVE_HOME] = IRR_KEY_HOME;
KeyMap[AKEYCODE_MOVE_END] = IRR_KEY_END;
KeyMap[AKEYCODE_INSERT] = IRR_KEY_INSERT;
KeyMap[AKEYCODE_FORWARD] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MEDIA_PLAY] = IRR_KEY_PLAY;
KeyMap[AKEYCODE_MEDIA_PAUSE] = IRR_KEY_MEDIA_PLAY_PAUSE;
KeyMap[AKEYCODE_MEDIA_CLOSE] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MEDIA_EJECT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MEDIA_RECORD] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_F1] = IRR_KEY_F1;
KeyMap[AKEYCODE_F2] = IRR_KEY_F2;
KeyMap[AKEYCODE_F3] = IRR_KEY_F3;
KeyMap[AKEYCODE_F4] = IRR_KEY_F4;
KeyMap[AKEYCODE_F5] = IRR_KEY_F5;
KeyMap[AKEYCODE_F6] = IRR_KEY_F6;
KeyMap[AKEYCODE_F7] = IRR_KEY_F7;
KeyMap[AKEYCODE_F8] = IRR_KEY_F8;
KeyMap[AKEYCODE_F9] = IRR_KEY_F9;
KeyMap[AKEYCODE_F10] = IRR_KEY_F10;
KeyMap[AKEYCODE_F11] = IRR_KEY_F11;
KeyMap[AKEYCODE_F12] = IRR_KEY_F12;
KeyMap[AKEYCODE_NUM_LOCK] = IRR_KEY_NUMLOCK;
KeyMap[AKEYCODE_NUMPAD_0] = IRR_KEY_NUMPAD0;
KeyMap[AKEYCODE_NUMPAD_1] = IRR_KEY_NUMPAD1;
KeyMap[AKEYCODE_NUMPAD_2] = IRR_KEY_NUMPAD2;
KeyMap[AKEYCODE_NUMPAD_3] = IRR_KEY_NUMPAD3;
KeyMap[AKEYCODE_NUMPAD_4] = IRR_KEY_NUMPAD4;
KeyMap[AKEYCODE_NUMPAD_5] = IRR_KEY_NUMPAD5;
KeyMap[AKEYCODE_NUMPAD_6] = IRR_KEY_NUMPAD6;
KeyMap[AKEYCODE_NUMPAD_7] = IRR_KEY_NUMPAD7;
KeyMap[AKEYCODE_NUMPAD_8] = IRR_KEY_NUMPAD8;
KeyMap[AKEYCODE_NUMPAD_9] = IRR_KEY_NUMPAD9;
KeyMap[AKEYCODE_NUMPAD_DIVIDE] = IRR_KEY_DIVIDE;
KeyMap[AKEYCODE_NUMPAD_MULTIPLY] = IRR_KEY_MULTIPLY;
KeyMap[AKEYCODE_NUMPAD_SUBTRACT] = IRR_KEY_SUBTRACT;
KeyMap[AKEYCODE_NUMPAD_ADD] = IRR_KEY_ADD;
KeyMap[AKEYCODE_NUMPAD_DOT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_NUMPAD_COMMA] = IRR_KEY_COMMA;
KeyMap[AKEYCODE_NUMPAD_ENTER] = IRR_KEY_RETURN;
KeyMap[AKEYCODE_NUMPAD_EQUALS] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_NUMPAD_LEFT_PAREN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_NUMPAD_RIGHT_PAREN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_VOLUME_MUTE] = IRR_KEY_VOLUME_MUTE;
KeyMap[AKEYCODE_INFO] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CHANNEL_UP] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CHANNEL_DOWN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_ZOOM_IN] = IRR_KEY_ZOOM;
KeyMap[AKEYCODE_ZOOM_OUT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_TV] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_WINDOW] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_GUIDE] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_DVR] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BOOKMARK] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CAPTIONS] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_SETTINGS] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_TV_POWER] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_TV_INPUT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_STB_POWER] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_STB_INPUT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_AVR_POWER] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_AVR_INPUT] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_PROG_RED] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_PROG_GREEN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_PROG_YELLOW] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_PROG_BLUE] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_APP_SWITCH] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_1] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_2] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_3] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_4] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_5] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_6] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_7] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_8] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_9] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_10] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_11] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_12] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_13] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_14] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_15] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BUTTON_16] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_LANGUAGE_SWITCH] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MANNER_MODE] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_3D_MODE] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CONTACTS] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CALENDAR] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MUSIC] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_CALCULATOR] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_ZENKAKU_HANKAKU] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_EISU] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MUHENKAN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_HENKAN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_KATAKANA_HIRAGANA] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_YEN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_RO] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_KANA] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_ASSIST] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BRIGHTNESS_DOWN] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_BRIGHTNESS_UP] = IRR_KEY_UNKNOWN;
KeyMap[AKEYCODE_MEDIA_AUDIO_TRACK] = IRR_KEY_UNKNOWN;
}
void CIrrDeviceAndroid::getKeyChar(SEvent& event)

View File

@ -18,6 +18,8 @@
#include "IImagePresenter.h"
#include "ICursorControl.h"
#include <map>
namespace irr
{
@ -35,6 +37,7 @@ namespace irr
virtual void yield();
virtual void sleep(u32 timeMs, bool pauseTimer=false);
virtual void setWindowCaption(const wchar_t* text);
virtual void setWindowClass(const char* text) {}
virtual bool present(video::IImage* surface, void* windowId, core::rect<s32>* srcClip);
virtual bool isWindowActive() const;
virtual bool isWindowFocused() const;
@ -53,7 +56,6 @@ namespace irr
virtual bool deactivateGyroscope();
virtual bool isGyroscopeActive();
virtual bool isGyroscopeAvailable();
video::IVideoModeList* getVideoModeList();
class CCursorControl : public gui::ICursorControl
{
@ -103,16 +105,16 @@ namespace irr
static bool IsPaused;
static bool IsFocused;
static bool IsStarted;
static bool IsClosing;
bool IsMousePressed;
video::SExposedVideoData ExposedVideoData;
core::array<EKEY_CODE> KeyMap;
std::map<int, EKEY_CODE> KeyMap;
void createDriver();
void createKeyMap();
void createVideoModeList();
void getKeyChar(SEvent& event);
video::SExposedVideoData& getExposedVideoData();

View File

@ -59,6 +59,9 @@ namespace irr
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text);
//! sets the class of the window
virtual void setWindowClass(const char* text) {}
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const;

View File

@ -239,30 +239,30 @@ bool CIrrDeviceFB::run()
switch (ev.code)
{
case KEY_RIGHTCTRL:
case KEY_LEFTCTRL:
case IRR_KEY_RIGHTCTRL:
case IRR_KEY_LEFTCTRL:
irrevent.KeyInput.Control = true;
break;
case KEY_RIGHTSHIFT:
case KEY_LEFTSHIFT:
case IRR_KEY_RIGHTSHIFT:
case IRR_KEY_LEFTSHIFT:
irrevent.KeyInput.Shift = true;
break;
case KEY_ESC:
case IRR_KEY_ESC:
irrevent.KeyInput.Key = (EKEY_CODE)0x1B;
break;
case KEY_SPACE:
case IRR_KEY_SPACE:
irrevent.KeyInput.Key = (EKEY_CODE)0x20;
break;
case KEY_UP:
case IRR_KEY_UP:
irrevent.KeyInput.Key = (EKEY_CODE)0x26;
break;
case KEY_LEFT:
case IRR_KEY_LEFT:
irrevent.KeyInput.Key = (EKEY_CODE)0x25;
break;
case KEY_RIGHT:
case IRR_KEY_RIGHT:
irrevent.KeyInput.Key = (EKEY_CODE)0x27;
break;
case KEY_DOWN:
case IRR_KEY_DOWN:
irrevent.KeyInput.Key = (EKEY_CODE)0x28;
break;
default:

View File

@ -45,6 +45,9 @@ namespace irr
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text);
//! sets the class of the window
virtual void setWindowClass(const char* text) {}
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const;

View File

@ -29,6 +29,14 @@ extern bool GLContextDebugBit;
#include <X11/XKBlib.h>
#include <X11/Xatom.h>
#ifdef _IRR_COMPILE_WITH_OPENGL_
#include <GL/gl.h>
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
#define GLX_GLXEXT_PROTOTYPES
#include "glxext.h"
#endif
#endif
#ifdef _IRR_LINUX_XCURSOR_
#include <X11/Xcursor/Xcursor.h>
#endif
@ -516,6 +524,7 @@ void IrrPrintXGrabError(int grabResult, const c8 * grabCommand )
#endif
#ifdef _IRR_COMPILE_WITH_OPENGL_
#ifdef _IRR_COMPILE_WITH_X11_
static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, bool force_legacy_context)
{
GLXContext Context;
@ -600,7 +609,7 @@ static GLXContext getMeAGLContext(Display *display, GLXFBConfig glxFBConfig, boo
Context = glXCreateNewContext(display, glxFBConfig, GLX_RGBA_TYPE, NULL, True);
return Context;
}
#endif
#endif
bool CIrrDeviceLinux::createWindow()
@ -1209,6 +1218,9 @@ bool CIrrDeviceLinux::createInputContext()
return false;
}
// It's showed as memory leak, but we shouldn't delete it. From the xlib
// documentation: "The returned modifiers string is owned by Xlib and
// should not be modified or freed by the client."
char* p = XSetLocaleModifiers("");
if (p == NULL)
{
@ -1823,6 +1835,22 @@ void CIrrDeviceLinux::setWindowCaption(const wchar_t* text)
#endif
}
//! sets the class of the window
void CIrrDeviceLinux::setWindowClass(const char* text)
{
#ifdef _IRR_COMPILE_WITH_X11_
if (CreationParams.DriverType == video::EDT_NULL)
return;
// Set class hints on Linux, used by Window Managers.
XClassHint* classhint = XAllocClassHint();
classhint->res_name = (char*)text;
classhint->res_class = (char*)text;
XSetClassHint(display, window, classhint);
XFree(classhint);
#endif
}
//! presents a surface in the client area
bool CIrrDeviceLinux::present(video::IImage* image, void* windowId, core::rect<s32>* srcRect)
@ -2138,194 +2166,194 @@ void CIrrDeviceLinux::createKeyMap()
#ifdef _IRR_COMPILE_WITH_X11_
KeyMap.reallocate(190);
KeyMap.push_back(SKeyMap(XK_BackSpace, KEY_BACK));
KeyMap.push_back(SKeyMap(XK_Tab, KEY_TAB));
KeyMap.push_back(SKeyMap(XK_ISO_Left_Tab, KEY_TAB));
KeyMap.push_back(SKeyMap(XK_BackSpace, IRR_KEY_BACK));
KeyMap.push_back(SKeyMap(XK_Tab, IRR_KEY_TAB));
KeyMap.push_back(SKeyMap(XK_ISO_Left_Tab, IRR_KEY_TAB));
KeyMap.push_back(SKeyMap(XK_Linefeed, 0)); // ???
KeyMap.push_back(SKeyMap(XK_Clear, KEY_CLEAR));
KeyMap.push_back(SKeyMap(XK_Return, KEY_RETURN));
KeyMap.push_back(SKeyMap(XK_Pause, KEY_PAUSE));
KeyMap.push_back(SKeyMap(XK_Scroll_Lock, KEY_SCROLL));
KeyMap.push_back(SKeyMap(XK_Clear, IRR_KEY_CLEAR));
KeyMap.push_back(SKeyMap(XK_Return, IRR_KEY_RETURN));
KeyMap.push_back(SKeyMap(XK_Pause, IRR_KEY_PAUSE));
KeyMap.push_back(SKeyMap(XK_Scroll_Lock, IRR_KEY_SCROLL));
KeyMap.push_back(SKeyMap(XK_Sys_Req, 0)); // ???
KeyMap.push_back(SKeyMap(XK_Escape, KEY_ESCAPE));
KeyMap.push_back(SKeyMap(XK_Insert, KEY_INSERT));
KeyMap.push_back(SKeyMap(XK_Delete, KEY_DELETE));
KeyMap.push_back(SKeyMap(XK_Home, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_Left, KEY_LEFT));
KeyMap.push_back(SKeyMap(XK_Up, KEY_UP));
KeyMap.push_back(SKeyMap(XK_Right, KEY_RIGHT));
KeyMap.push_back(SKeyMap(XK_Down, KEY_DOWN));
KeyMap.push_back(SKeyMap(XK_Prior, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_Page_Up, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_Next, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_Page_Down, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_End, KEY_END));
KeyMap.push_back(SKeyMap(XK_Begin, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_Num_Lock, KEY_NUMLOCK));
KeyMap.push_back(SKeyMap(XK_KP_Space, KEY_SPACE));
KeyMap.push_back(SKeyMap(XK_KP_Tab, KEY_TAB));
KeyMap.push_back(SKeyMap(XK_KP_Enter, KEY_RETURN));
KeyMap.push_back(SKeyMap(XK_KP_F1, KEY_F1));
KeyMap.push_back(SKeyMap(XK_KP_F2, KEY_F2));
KeyMap.push_back(SKeyMap(XK_KP_F3, KEY_F3));
KeyMap.push_back(SKeyMap(XK_KP_F4, KEY_F4));
KeyMap.push_back(SKeyMap(XK_KP_Home, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_KP_Left, KEY_LEFT));
KeyMap.push_back(SKeyMap(XK_KP_Up, KEY_UP));
KeyMap.push_back(SKeyMap(XK_KP_Right, KEY_RIGHT));
KeyMap.push_back(SKeyMap(XK_KP_Down, KEY_DOWN));
KeyMap.push_back(SKeyMap(XK_Print, KEY_PRINT));
KeyMap.push_back(SKeyMap(XK_KP_Prior, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Page_Up, KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Next, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_KP_Page_Down, KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_KP_End, KEY_END));
KeyMap.push_back(SKeyMap(XK_KP_Begin, KEY_HOME));
KeyMap.push_back(SKeyMap(XK_KP_Insert, KEY_INSERT));
KeyMap.push_back(SKeyMap(XK_KP_Delete, KEY_DELETE));
KeyMap.push_back(SKeyMap(XK_Escape, IRR_KEY_ESCAPE));
KeyMap.push_back(SKeyMap(XK_Insert, IRR_KEY_INSERT));
KeyMap.push_back(SKeyMap(XK_Delete, IRR_KEY_DELETE));
KeyMap.push_back(SKeyMap(XK_Home, IRR_KEY_HOME));
KeyMap.push_back(SKeyMap(XK_Left, IRR_KEY_LEFT));
KeyMap.push_back(SKeyMap(XK_Up, IRR_KEY_UP));
KeyMap.push_back(SKeyMap(XK_Right, IRR_KEY_RIGHT));
KeyMap.push_back(SKeyMap(XK_Down, IRR_KEY_DOWN));
KeyMap.push_back(SKeyMap(XK_Prior, IRR_KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_Page_Up, IRR_KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_Next, IRR_KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_Page_Down, IRR_KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_End, IRR_KEY_END));
KeyMap.push_back(SKeyMap(XK_Begin, IRR_KEY_HOME));
KeyMap.push_back(SKeyMap(XK_Num_Lock, IRR_KEY_NUMLOCK));
KeyMap.push_back(SKeyMap(XK_KP_Space, IRR_KEY_SPACE));
KeyMap.push_back(SKeyMap(XK_KP_Tab, IRR_KEY_TAB));
KeyMap.push_back(SKeyMap(XK_KP_Enter, IRR_KEY_RETURN));
KeyMap.push_back(SKeyMap(XK_KP_F1, IRR_KEY_F1));
KeyMap.push_back(SKeyMap(XK_KP_F2, IRR_KEY_F2));
KeyMap.push_back(SKeyMap(XK_KP_F3, IRR_KEY_F3));
KeyMap.push_back(SKeyMap(XK_KP_F4, IRR_KEY_F4));
KeyMap.push_back(SKeyMap(XK_KP_Home, IRR_KEY_HOME));
KeyMap.push_back(SKeyMap(XK_KP_Left, IRR_KEY_LEFT));
KeyMap.push_back(SKeyMap(XK_KP_Up, IRR_KEY_UP));
KeyMap.push_back(SKeyMap(XK_KP_Right, IRR_KEY_RIGHT));
KeyMap.push_back(SKeyMap(XK_KP_Down, IRR_KEY_DOWN));
KeyMap.push_back(SKeyMap(XK_Print, IRR_KEY_PRINT));
KeyMap.push_back(SKeyMap(XK_KP_Prior, IRR_KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Page_Up, IRR_KEY_PRIOR));
KeyMap.push_back(SKeyMap(XK_KP_Next, IRR_KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_KP_Page_Down, IRR_KEY_NEXT));
KeyMap.push_back(SKeyMap(XK_KP_End, IRR_KEY_END));
KeyMap.push_back(SKeyMap(XK_KP_Begin, IRR_KEY_HOME));
KeyMap.push_back(SKeyMap(XK_KP_Insert, IRR_KEY_INSERT));
KeyMap.push_back(SKeyMap(XK_KP_Delete, IRR_KEY_DELETE));
KeyMap.push_back(SKeyMap(XK_KP_Equal, 0)); // ???
KeyMap.push_back(SKeyMap(XK_KP_Multiply, KEY_MULTIPLY));
KeyMap.push_back(SKeyMap(XK_KP_Add, KEY_ADD));
KeyMap.push_back(SKeyMap(XK_KP_Separator, KEY_SEPARATOR));
KeyMap.push_back(SKeyMap(XK_KP_Subtract, KEY_SUBTRACT));
KeyMap.push_back(SKeyMap(XK_KP_Decimal, KEY_DECIMAL));
KeyMap.push_back(SKeyMap(XK_KP_Divide, KEY_DIVIDE));
KeyMap.push_back(SKeyMap(XK_KP_0, KEY_NUMPAD0));
KeyMap.push_back(SKeyMap(XK_KP_1, KEY_NUMPAD1));
KeyMap.push_back(SKeyMap(XK_KP_2, KEY_NUMPAD2));
KeyMap.push_back(SKeyMap(XK_KP_3, KEY_NUMPAD3));
KeyMap.push_back(SKeyMap(XK_KP_4, KEY_NUMPAD4));
KeyMap.push_back(SKeyMap(XK_KP_5, KEY_NUMPAD5));
KeyMap.push_back(SKeyMap(XK_KP_6, KEY_NUMPAD6));
KeyMap.push_back(SKeyMap(XK_KP_7, KEY_NUMPAD7));
KeyMap.push_back(SKeyMap(XK_KP_8, KEY_NUMPAD8));
KeyMap.push_back(SKeyMap(XK_KP_9, KEY_NUMPAD9));
KeyMap.push_back(SKeyMap(XK_F1, KEY_F1));
KeyMap.push_back(SKeyMap(XK_F2, KEY_F2));
KeyMap.push_back(SKeyMap(XK_F3, KEY_F3));
KeyMap.push_back(SKeyMap(XK_F4, KEY_F4));
KeyMap.push_back(SKeyMap(XK_F5, KEY_F5));
KeyMap.push_back(SKeyMap(XK_F6, KEY_F6));
KeyMap.push_back(SKeyMap(XK_F7, KEY_F7));
KeyMap.push_back(SKeyMap(XK_F8, KEY_F8));
KeyMap.push_back(SKeyMap(XK_F9, KEY_F9));
KeyMap.push_back(SKeyMap(XK_F10, KEY_F10));
KeyMap.push_back(SKeyMap(XK_F11, KEY_F11));
KeyMap.push_back(SKeyMap(XK_F12, KEY_F12));
KeyMap.push_back(SKeyMap(XK_Shift_L, KEY_LSHIFT));
KeyMap.push_back(SKeyMap(XK_Shift_R, KEY_RSHIFT));
KeyMap.push_back(SKeyMap(XK_Control_L, KEY_LCONTROL));
KeyMap.push_back(SKeyMap(XK_Control_R, KEY_RCONTROL));
KeyMap.push_back(SKeyMap(XK_Caps_Lock, KEY_CAPITAL));
KeyMap.push_back(SKeyMap(XK_Shift_Lock, KEY_CAPITAL));
KeyMap.push_back(SKeyMap(XK_Meta_L, KEY_LWIN));
KeyMap.push_back(SKeyMap(XK_Meta_R, KEY_RWIN));
KeyMap.push_back(SKeyMap(XK_Alt_L, KEY_LMENU));
KeyMap.push_back(SKeyMap(XK_Alt_R, KEY_RMENU));
KeyMap.push_back(SKeyMap(XK_ISO_Level3_Shift, KEY_RMENU));
KeyMap.push_back(SKeyMap(XK_Menu, KEY_MENU));
KeyMap.push_back(SKeyMap(XK_space, KEY_SPACE));
KeyMap.push_back(SKeyMap(XK_KP_Multiply, IRR_KEY_MULTIPLY));
KeyMap.push_back(SKeyMap(XK_KP_Add, IRR_KEY_ADD));
KeyMap.push_back(SKeyMap(XK_KP_Separator, IRR_KEY_SEPARATOR));
KeyMap.push_back(SKeyMap(XK_KP_Subtract, IRR_KEY_SUBTRACT));
KeyMap.push_back(SKeyMap(XK_KP_Decimal, IRR_KEY_DECIMAL));
KeyMap.push_back(SKeyMap(XK_KP_Divide, IRR_KEY_DIVIDE));
KeyMap.push_back(SKeyMap(XK_KP_0, IRR_KEY_NUMPAD0));
KeyMap.push_back(SKeyMap(XK_KP_1, IRR_KEY_NUMPAD1));
KeyMap.push_back(SKeyMap(XK_KP_2, IRR_KEY_NUMPAD2));
KeyMap.push_back(SKeyMap(XK_KP_3, IRR_KEY_NUMPAD3));
KeyMap.push_back(SKeyMap(XK_KP_4, IRR_KEY_NUMPAD4));
KeyMap.push_back(SKeyMap(XK_KP_5, IRR_KEY_NUMPAD5));
KeyMap.push_back(SKeyMap(XK_KP_6, IRR_KEY_NUMPAD6));
KeyMap.push_back(SKeyMap(XK_KP_7, IRR_KEY_NUMPAD7));
KeyMap.push_back(SKeyMap(XK_KP_8, IRR_KEY_NUMPAD8));
KeyMap.push_back(SKeyMap(XK_KP_9, IRR_KEY_NUMPAD9));
KeyMap.push_back(SKeyMap(XK_F1, IRR_KEY_F1));
KeyMap.push_back(SKeyMap(XK_F2, IRR_KEY_F2));
KeyMap.push_back(SKeyMap(XK_F3, IRR_KEY_F3));
KeyMap.push_back(SKeyMap(XK_F4, IRR_KEY_F4));
KeyMap.push_back(SKeyMap(XK_F5, IRR_KEY_F5));
KeyMap.push_back(SKeyMap(XK_F6, IRR_KEY_F6));
KeyMap.push_back(SKeyMap(XK_F7, IRR_KEY_F7));
KeyMap.push_back(SKeyMap(XK_F8, IRR_KEY_F8));
KeyMap.push_back(SKeyMap(XK_F9, IRR_KEY_F9));
KeyMap.push_back(SKeyMap(XK_F10, IRR_KEY_F10));
KeyMap.push_back(SKeyMap(XK_F11, IRR_KEY_F11));
KeyMap.push_back(SKeyMap(XK_F12, IRR_KEY_F12));
KeyMap.push_back(SKeyMap(XK_Shift_L, IRR_KEY_LSHIFT));
KeyMap.push_back(SKeyMap(XK_Shift_R, IRR_KEY_RSHIFT));
KeyMap.push_back(SKeyMap(XK_Control_L, IRR_KEY_LCONTROL));
KeyMap.push_back(SKeyMap(XK_Control_R, IRR_KEY_RCONTROL));
KeyMap.push_back(SKeyMap(XK_Caps_Lock, IRR_KEY_CAPITAL));
KeyMap.push_back(SKeyMap(XK_Shift_Lock, IRR_KEY_CAPITAL));
KeyMap.push_back(SKeyMap(XK_Meta_L, IRR_KEY_LWIN));
KeyMap.push_back(SKeyMap(XK_Meta_R, IRR_KEY_RWIN));
KeyMap.push_back(SKeyMap(XK_Alt_L, IRR_KEY_LMENU));
KeyMap.push_back(SKeyMap(XK_Alt_R, IRR_KEY_RMENU));
KeyMap.push_back(SKeyMap(XK_ISO_Level3_Shift, IRR_KEY_RMENU));
KeyMap.push_back(SKeyMap(XK_Menu, IRR_KEY_MENU));
KeyMap.push_back(SKeyMap(XK_space, IRR_KEY_SPACE));
KeyMap.push_back(SKeyMap(XK_exclam, 0)); //?
KeyMap.push_back(SKeyMap(XK_quotedbl, 0)); //?
KeyMap.push_back(SKeyMap(XK_section, 0)); //?
KeyMap.push_back(SKeyMap(XK_numbersign, KEY_OEM_2));
KeyMap.push_back(SKeyMap(XK_numbersign, IRR_KEY_OEM_2));
KeyMap.push_back(SKeyMap(XK_dollar, 0)); //?
KeyMap.push_back(SKeyMap(XK_percent, 0)); //?
KeyMap.push_back(SKeyMap(XK_ampersand, 0)); //?
KeyMap.push_back(SKeyMap(XK_apostrophe, KEY_OEM_7));
KeyMap.push_back(SKeyMap(XK_apostrophe, IRR_KEY_OEM_7));
KeyMap.push_back(SKeyMap(XK_parenleft, 0)); //?
KeyMap.push_back(SKeyMap(XK_parenright, 0)); //?
KeyMap.push_back(SKeyMap(XK_asterisk, 0)); //?
KeyMap.push_back(SKeyMap(XK_plus, KEY_PLUS)); //?
KeyMap.push_back(SKeyMap(XK_comma, KEY_COMMA)); //?
KeyMap.push_back(SKeyMap(XK_minus, KEY_MINUS)); //?
KeyMap.push_back(SKeyMap(XK_period, KEY_PERIOD)); //?
KeyMap.push_back(SKeyMap(XK_slash, KEY_OEM_2)); //?
KeyMap.push_back(SKeyMap(XK_0, KEY_KEY_0));
KeyMap.push_back(SKeyMap(XK_1, KEY_KEY_1));
KeyMap.push_back(SKeyMap(XK_2, KEY_KEY_2));
KeyMap.push_back(SKeyMap(XK_3, KEY_KEY_3));
KeyMap.push_back(SKeyMap(XK_4, KEY_KEY_4));
KeyMap.push_back(SKeyMap(XK_5, KEY_KEY_5));
KeyMap.push_back(SKeyMap(XK_6, KEY_KEY_6));
KeyMap.push_back(SKeyMap(XK_7, KEY_KEY_7));
KeyMap.push_back(SKeyMap(XK_8, KEY_KEY_8));
KeyMap.push_back(SKeyMap(XK_9, KEY_KEY_9));
KeyMap.push_back(SKeyMap(XK_plus, IRR_KEY_PLUS)); //?
KeyMap.push_back(SKeyMap(XK_comma, IRR_KEY_COMMA)); //?
KeyMap.push_back(SKeyMap(XK_minus, IRR_KEY_MINUS)); //?
KeyMap.push_back(SKeyMap(XK_period, IRR_KEY_PERIOD)); //?
KeyMap.push_back(SKeyMap(XK_slash, IRR_KEY_OEM_2)); //?
KeyMap.push_back(SKeyMap(XK_0, IRR_KEY_0));
KeyMap.push_back(SKeyMap(XK_1, IRR_KEY_1));
KeyMap.push_back(SKeyMap(XK_2, IRR_KEY_2));
KeyMap.push_back(SKeyMap(XK_3, IRR_KEY_3));
KeyMap.push_back(SKeyMap(XK_4, IRR_KEY_4));
KeyMap.push_back(SKeyMap(XK_5, IRR_KEY_5));
KeyMap.push_back(SKeyMap(XK_6, IRR_KEY_6));
KeyMap.push_back(SKeyMap(XK_7, IRR_KEY_7));
KeyMap.push_back(SKeyMap(XK_8, IRR_KEY_8));
KeyMap.push_back(SKeyMap(XK_9, IRR_KEY_9));
KeyMap.push_back(SKeyMap(XK_colon, 0)); //?
KeyMap.push_back(SKeyMap(XK_semicolon, KEY_OEM_1));
KeyMap.push_back(SKeyMap(XK_less, KEY_OEM_102));
KeyMap.push_back(SKeyMap(XK_equal, KEY_PLUS));
KeyMap.push_back(SKeyMap(XK_semicolon, IRR_KEY_OEM_1));
KeyMap.push_back(SKeyMap(XK_less, IRR_KEY_OEM_102));
KeyMap.push_back(SKeyMap(XK_equal, IRR_KEY_PLUS));
KeyMap.push_back(SKeyMap(XK_greater, 0)); //?
KeyMap.push_back(SKeyMap(XK_question, 0)); //?
KeyMap.push_back(SKeyMap(XK_at, KEY_KEY_2)); //?
KeyMap.push_back(SKeyMap(XK_at, IRR_KEY_2)); //?
KeyMap.push_back(SKeyMap(XK_mu, 0)); //?
KeyMap.push_back(SKeyMap(XK_EuroSign, 0)); //?
KeyMap.push_back(SKeyMap(XK_A, KEY_KEY_A));
KeyMap.push_back(SKeyMap(XK_B, KEY_KEY_B));
KeyMap.push_back(SKeyMap(XK_C, KEY_KEY_C));
KeyMap.push_back(SKeyMap(XK_D, KEY_KEY_D));
KeyMap.push_back(SKeyMap(XK_E, KEY_KEY_E));
KeyMap.push_back(SKeyMap(XK_F, KEY_KEY_F));
KeyMap.push_back(SKeyMap(XK_G, KEY_KEY_G));
KeyMap.push_back(SKeyMap(XK_H, KEY_KEY_H));
KeyMap.push_back(SKeyMap(XK_I, KEY_KEY_I));
KeyMap.push_back(SKeyMap(XK_J, KEY_KEY_J));
KeyMap.push_back(SKeyMap(XK_K, KEY_KEY_K));
KeyMap.push_back(SKeyMap(XK_L, KEY_KEY_L));
KeyMap.push_back(SKeyMap(XK_M, KEY_KEY_M));
KeyMap.push_back(SKeyMap(XK_N, KEY_KEY_N));
KeyMap.push_back(SKeyMap(XK_O, KEY_KEY_O));
KeyMap.push_back(SKeyMap(XK_P, KEY_KEY_P));
KeyMap.push_back(SKeyMap(XK_Q, KEY_KEY_Q));
KeyMap.push_back(SKeyMap(XK_R, KEY_KEY_R));
KeyMap.push_back(SKeyMap(XK_S, KEY_KEY_S));
KeyMap.push_back(SKeyMap(XK_T, KEY_KEY_T));
KeyMap.push_back(SKeyMap(XK_U, KEY_KEY_U));
KeyMap.push_back(SKeyMap(XK_V, KEY_KEY_V));
KeyMap.push_back(SKeyMap(XK_W, KEY_KEY_W));
KeyMap.push_back(SKeyMap(XK_X, KEY_KEY_X));
KeyMap.push_back(SKeyMap(XK_Y, KEY_KEY_Y));
KeyMap.push_back(SKeyMap(XK_Z, KEY_KEY_Z));
KeyMap.push_back(SKeyMap(XK_bracketleft, KEY_OEM_4));
KeyMap.push_back(SKeyMap(XK_backslash, KEY_OEM_5));
KeyMap.push_back(SKeyMap(XK_bracketright, KEY_OEM_6));
KeyMap.push_back(SKeyMap(XK_asciicircum, KEY_OEM_5));
KeyMap.push_back(SKeyMap(XK_A, IRR_KEY_A));
KeyMap.push_back(SKeyMap(XK_B, IRR_KEY_B));
KeyMap.push_back(SKeyMap(XK_C, IRR_KEY_C));
KeyMap.push_back(SKeyMap(XK_D, IRR_KEY_D));
KeyMap.push_back(SKeyMap(XK_E, IRR_KEY_E));
KeyMap.push_back(SKeyMap(XK_F, IRR_KEY_F));
KeyMap.push_back(SKeyMap(XK_G, IRR_KEY_G));
KeyMap.push_back(SKeyMap(XK_H, IRR_KEY_H));
KeyMap.push_back(SKeyMap(XK_I, IRR_KEY_I));
KeyMap.push_back(SKeyMap(XK_J, IRR_KEY_J));
KeyMap.push_back(SKeyMap(XK_K, IRR_KEY_K));
KeyMap.push_back(SKeyMap(XK_L, IRR_KEY_L));
KeyMap.push_back(SKeyMap(XK_M, IRR_KEY_M));
KeyMap.push_back(SKeyMap(XK_N, IRR_KEY_N));
KeyMap.push_back(SKeyMap(XK_O, IRR_KEY_O));
KeyMap.push_back(SKeyMap(XK_P, IRR_KEY_P));
KeyMap.push_back(SKeyMap(XK_Q, IRR_KEY_Q));
KeyMap.push_back(SKeyMap(XK_R, IRR_KEY_R));
KeyMap.push_back(SKeyMap(XK_S, IRR_KEY_S));
KeyMap.push_back(SKeyMap(XK_T, IRR_KEY_T));
KeyMap.push_back(SKeyMap(XK_U, IRR_KEY_U));
KeyMap.push_back(SKeyMap(XK_V, IRR_KEY_V));
KeyMap.push_back(SKeyMap(XK_W, IRR_KEY_W));
KeyMap.push_back(SKeyMap(XK_X, IRR_KEY_X));
KeyMap.push_back(SKeyMap(XK_Y, IRR_KEY_Y));
KeyMap.push_back(SKeyMap(XK_Z, IRR_KEY_Z));
KeyMap.push_back(SKeyMap(XK_bracketleft, IRR_KEY_OEM_4));
KeyMap.push_back(SKeyMap(XK_backslash, IRR_KEY_OEM_5));
KeyMap.push_back(SKeyMap(XK_bracketright, IRR_KEY_OEM_6));
KeyMap.push_back(SKeyMap(XK_asciicircum, IRR_KEY_OEM_5));
KeyMap.push_back(SKeyMap(XK_degree, 0)); //?
KeyMap.push_back(SKeyMap(XK_underscore, KEY_MINUS)); //?
KeyMap.push_back(SKeyMap(XK_grave, KEY_OEM_3));
KeyMap.push_back(SKeyMap(XK_acute, KEY_OEM_6));
KeyMap.push_back(SKeyMap(XK_a, KEY_KEY_A));
KeyMap.push_back(SKeyMap(XK_b, KEY_KEY_B));
KeyMap.push_back(SKeyMap(XK_c, KEY_KEY_C));
KeyMap.push_back(SKeyMap(XK_d, KEY_KEY_D));
KeyMap.push_back(SKeyMap(XK_e, KEY_KEY_E));
KeyMap.push_back(SKeyMap(XK_f, KEY_KEY_F));
KeyMap.push_back(SKeyMap(XK_g, KEY_KEY_G));
KeyMap.push_back(SKeyMap(XK_h, KEY_KEY_H));
KeyMap.push_back(SKeyMap(XK_i, KEY_KEY_I));
KeyMap.push_back(SKeyMap(XK_j, KEY_KEY_J));
KeyMap.push_back(SKeyMap(XK_k, KEY_KEY_K));
KeyMap.push_back(SKeyMap(XK_l, KEY_KEY_L));
KeyMap.push_back(SKeyMap(XK_m, KEY_KEY_M));
KeyMap.push_back(SKeyMap(XK_n, KEY_KEY_N));
KeyMap.push_back(SKeyMap(XK_o, KEY_KEY_O));
KeyMap.push_back(SKeyMap(XK_p, KEY_KEY_P));
KeyMap.push_back(SKeyMap(XK_q, KEY_KEY_Q));
KeyMap.push_back(SKeyMap(XK_r, KEY_KEY_R));
KeyMap.push_back(SKeyMap(XK_s, KEY_KEY_S));
KeyMap.push_back(SKeyMap(XK_t, KEY_KEY_T));
KeyMap.push_back(SKeyMap(XK_u, KEY_KEY_U));
KeyMap.push_back(SKeyMap(XK_v, KEY_KEY_V));
KeyMap.push_back(SKeyMap(XK_w, KEY_KEY_W));
KeyMap.push_back(SKeyMap(XK_x, KEY_KEY_X));
KeyMap.push_back(SKeyMap(XK_y, KEY_KEY_Y));
KeyMap.push_back(SKeyMap(XK_z, KEY_KEY_Z));
KeyMap.push_back(SKeyMap(XK_ssharp, KEY_OEM_4));
KeyMap.push_back(SKeyMap(XK_adiaeresis, KEY_OEM_7));
KeyMap.push_back(SKeyMap(XK_odiaeresis, KEY_OEM_3));
KeyMap.push_back(SKeyMap(XK_udiaeresis, KEY_OEM_1));
KeyMap.push_back(SKeyMap(XK_Super_L, KEY_LWIN));
KeyMap.push_back(SKeyMap(XK_Super_R, KEY_RWIN));
KeyMap.push_back(SKeyMap(XK_underscore, IRR_KEY_MINUS)); //?
KeyMap.push_back(SKeyMap(XK_grave, IRR_KEY_OEM_3));
KeyMap.push_back(SKeyMap(XK_acute, IRR_KEY_OEM_6));
KeyMap.push_back(SKeyMap(XK_a, IRR_KEY_A));
KeyMap.push_back(SKeyMap(XK_b, IRR_KEY_B));
KeyMap.push_back(SKeyMap(XK_c, IRR_KEY_C));
KeyMap.push_back(SKeyMap(XK_d, IRR_KEY_D));
KeyMap.push_back(SKeyMap(XK_e, IRR_KEY_E));
KeyMap.push_back(SKeyMap(XK_f, IRR_KEY_F));
KeyMap.push_back(SKeyMap(XK_g, IRR_KEY_G));
KeyMap.push_back(SKeyMap(XK_h, IRR_KEY_H));
KeyMap.push_back(SKeyMap(XK_i, IRR_KEY_I));
KeyMap.push_back(SKeyMap(XK_j, IRR_KEY_J));
KeyMap.push_back(SKeyMap(XK_k, IRR_KEY_K));
KeyMap.push_back(SKeyMap(XK_l, IRR_KEY_L));
KeyMap.push_back(SKeyMap(XK_m, IRR_KEY_M));
KeyMap.push_back(SKeyMap(XK_n, IRR_KEY_N));
KeyMap.push_back(SKeyMap(XK_o, IRR_KEY_O));
KeyMap.push_back(SKeyMap(XK_p, IRR_KEY_P));
KeyMap.push_back(SKeyMap(XK_q, IRR_KEY_Q));
KeyMap.push_back(SKeyMap(XK_r, IRR_KEY_R));
KeyMap.push_back(SKeyMap(XK_s, IRR_KEY_S));
KeyMap.push_back(SKeyMap(XK_t, IRR_KEY_T));
KeyMap.push_back(SKeyMap(XK_u, IRR_KEY_U));
KeyMap.push_back(SKeyMap(XK_v, IRR_KEY_V));
KeyMap.push_back(SKeyMap(XK_w, IRR_KEY_W));
KeyMap.push_back(SKeyMap(XK_x, IRR_KEY_X));
KeyMap.push_back(SKeyMap(XK_y, IRR_KEY_Y));
KeyMap.push_back(SKeyMap(XK_z, IRR_KEY_Z));
KeyMap.push_back(SKeyMap(XK_ssharp, IRR_KEY_OEM_4));
KeyMap.push_back(SKeyMap(XK_adiaeresis, IRR_KEY_OEM_7));
KeyMap.push_back(SKeyMap(XK_odiaeresis, IRR_KEY_OEM_3));
KeyMap.push_back(SKeyMap(XK_udiaeresis, IRR_KEY_OEM_1));
KeyMap.push_back(SKeyMap(XK_Super_L, IRR_KEY_LWIN));
KeyMap.push_back(SKeyMap(XK_Super_R, IRR_KEY_RWIN));
KeyMap.sort();
#endif

View File

@ -18,13 +18,8 @@
#ifdef _IRR_COMPILE_WITH_X11_
#ifdef _IRR_COMPILE_WITH_OPENGL_
#include <GL/gl.h>
#define GLX_GLXEXT_LEGACY 1
#include <GL/glx.h>
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
#define GLX_GLXEXT_PROTOTYPES
#include "glxext.h"
#endif
#endif
#include <X11/Xlib.h>
@ -68,6 +63,9 @@ namespace irr
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text);
//! sets the class of the window
virtual void setWindowClass(const char* text);
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const;

View File

@ -402,7 +402,7 @@ bool CIrrDeviceSDL::run()
#ifdef _IRR_WINDOWS_API_
// handle alt+f4 in Windows, because SDL seems not to
if ( (SDL_event.key.keysym.mod & KMOD_LALT) && key == KEY_F4)
if ( (SDL_event.key.keysym.mod & KMOD_LALT) && key == IRR_KEY_F4)
{
Close = true;
break;
@ -837,131 +837,131 @@ void CIrrDeviceSDL::createKeyMap()
// buttons missing
KeyMap.push_back(SKeyMap(SDLK_BACKSPACE, KEY_BACK));
KeyMap.push_back(SKeyMap(SDLK_TAB, KEY_TAB));
KeyMap.push_back(SKeyMap(SDLK_CLEAR, KEY_CLEAR));
KeyMap.push_back(SKeyMap(SDLK_RETURN, KEY_RETURN));
KeyMap.push_back(SKeyMap(SDLK_BACKSPACE, IRR_KEY_BACK));
KeyMap.push_back(SKeyMap(SDLK_TAB, IRR_KEY_TAB));
KeyMap.push_back(SKeyMap(SDLK_CLEAR, IRR_KEY_CLEAR));
KeyMap.push_back(SKeyMap(SDLK_RETURN, IRR_KEY_RETURN));
// combined modifiers missing
KeyMap.push_back(SKeyMap(SDLK_PAUSE, KEY_PAUSE));
KeyMap.push_back(SKeyMap(SDLK_CAPSLOCK, KEY_CAPITAL));
KeyMap.push_back(SKeyMap(SDLK_PAUSE, IRR_KEY_PAUSE));
KeyMap.push_back(SKeyMap(SDLK_CAPSLOCK, IRR_KEY_CAPITAL));
// asian letter keys missing
KeyMap.push_back(SKeyMap(SDLK_ESCAPE, KEY_ESCAPE));
KeyMap.push_back(SKeyMap(SDLK_ESCAPE, IRR_KEY_ESCAPE));
// asian letter keys missing
KeyMap.push_back(SKeyMap(SDLK_SPACE, KEY_SPACE));
KeyMap.push_back(SKeyMap(SDLK_PAGEUP, KEY_PRIOR));
KeyMap.push_back(SKeyMap(SDLK_PAGEDOWN, KEY_NEXT));
KeyMap.push_back(SKeyMap(SDLK_END, KEY_END));
KeyMap.push_back(SKeyMap(SDLK_HOME, KEY_HOME));
KeyMap.push_back(SKeyMap(SDLK_LEFT, KEY_LEFT));
KeyMap.push_back(SKeyMap(SDLK_UP, KEY_UP));
KeyMap.push_back(SKeyMap(SDLK_RIGHT, KEY_RIGHT));
KeyMap.push_back(SKeyMap(SDLK_DOWN, KEY_DOWN));
KeyMap.push_back(SKeyMap(SDLK_SPACE, IRR_KEY_SPACE));
KeyMap.push_back(SKeyMap(SDLK_PAGEUP, IRR_KEY_PRIOR));
KeyMap.push_back(SKeyMap(SDLK_PAGEDOWN, IRR_KEY_NEXT));
KeyMap.push_back(SKeyMap(SDLK_END, IRR_KEY_END));
KeyMap.push_back(SKeyMap(SDLK_HOME, IRR_KEY_HOME));
KeyMap.push_back(SKeyMap(SDLK_LEFT, IRR_KEY_LEFT));
KeyMap.push_back(SKeyMap(SDLK_UP, IRR_KEY_UP));
KeyMap.push_back(SKeyMap(SDLK_RIGHT, IRR_KEY_RIGHT));
KeyMap.push_back(SKeyMap(SDLK_DOWN, IRR_KEY_DOWN));
// select missing
KeyMap.push_back(SKeyMap(SDLK_PRINT, KEY_PRINT));
KeyMap.push_back(SKeyMap(SDLK_PRINT, IRR_KEY_PRINT));
// execute missing
KeyMap.push_back(SKeyMap(SDLK_PRINT, KEY_SNAPSHOT));
KeyMap.push_back(SKeyMap(SDLK_PRINT, IRR_KEY_SNAPSHOT));
KeyMap.push_back(SKeyMap(SDLK_INSERT, KEY_INSERT));
KeyMap.push_back(SKeyMap(SDLK_DELETE, KEY_DELETE));
KeyMap.push_back(SKeyMap(SDLK_HELP, KEY_HELP));
KeyMap.push_back(SKeyMap(SDLK_INSERT, IRR_KEY_INSERT));
KeyMap.push_back(SKeyMap(SDLK_DELETE, IRR_KEY_DELETE));
KeyMap.push_back(SKeyMap(SDLK_HELP, IRR_KEY_HELP));
KeyMap.push_back(SKeyMap(SDLK_0, KEY_KEY_0));
KeyMap.push_back(SKeyMap(SDLK_1, KEY_KEY_1));
KeyMap.push_back(SKeyMap(SDLK_2, KEY_KEY_2));
KeyMap.push_back(SKeyMap(SDLK_3, KEY_KEY_3));
KeyMap.push_back(SKeyMap(SDLK_4, KEY_KEY_4));
KeyMap.push_back(SKeyMap(SDLK_5, KEY_KEY_5));
KeyMap.push_back(SKeyMap(SDLK_6, KEY_KEY_6));
KeyMap.push_back(SKeyMap(SDLK_7, KEY_KEY_7));
KeyMap.push_back(SKeyMap(SDLK_8, KEY_KEY_8));
KeyMap.push_back(SKeyMap(SDLK_9, KEY_KEY_9));
KeyMap.push_back(SKeyMap(SDLK_0, IRR_KEY_IRR_KEY_0));
KeyMap.push_back(SKeyMap(SDLK_1, IRR_KEY_IRR_KEY_1));
KeyMap.push_back(SKeyMap(SDLK_2, IRR_KEY_IRR_KEY_2));
KeyMap.push_back(SKeyMap(SDLK_3, IRR_KEY_IRR_KEY_3));
KeyMap.push_back(SKeyMap(SDLK_4, IRR_KEY_IRR_KEY_4));
KeyMap.push_back(SKeyMap(SDLK_5, IRR_KEY_IRR_KEY_5));
KeyMap.push_back(SKeyMap(SDLK_6, IRR_KEY_IRR_KEY_6));
KeyMap.push_back(SKeyMap(SDLK_7, IRR_KEY_IRR_KEY_7));
KeyMap.push_back(SKeyMap(SDLK_8, IRR_KEY_IRR_KEY_8));
KeyMap.push_back(SKeyMap(SDLK_9, IRR_KEY_IRR_KEY_9));
KeyMap.push_back(SKeyMap(SDLK_a, KEY_KEY_A));
KeyMap.push_back(SKeyMap(SDLK_b, KEY_KEY_B));
KeyMap.push_back(SKeyMap(SDLK_c, KEY_KEY_C));
KeyMap.push_back(SKeyMap(SDLK_d, KEY_KEY_D));
KeyMap.push_back(SKeyMap(SDLK_e, KEY_KEY_E));
KeyMap.push_back(SKeyMap(SDLK_f, KEY_KEY_F));
KeyMap.push_back(SKeyMap(SDLK_g, KEY_KEY_G));
KeyMap.push_back(SKeyMap(SDLK_h, KEY_KEY_H));
KeyMap.push_back(SKeyMap(SDLK_i, KEY_KEY_I));
KeyMap.push_back(SKeyMap(SDLK_j, KEY_KEY_J));
KeyMap.push_back(SKeyMap(SDLK_k, KEY_KEY_K));
KeyMap.push_back(SKeyMap(SDLK_l, KEY_KEY_L));
KeyMap.push_back(SKeyMap(SDLK_m, KEY_KEY_M));
KeyMap.push_back(SKeyMap(SDLK_n, KEY_KEY_N));
KeyMap.push_back(SKeyMap(SDLK_o, KEY_KEY_O));
KeyMap.push_back(SKeyMap(SDLK_p, KEY_KEY_P));
KeyMap.push_back(SKeyMap(SDLK_q, KEY_KEY_Q));
KeyMap.push_back(SKeyMap(SDLK_r, KEY_KEY_R));
KeyMap.push_back(SKeyMap(SDLK_s, KEY_KEY_S));
KeyMap.push_back(SKeyMap(SDLK_t, KEY_KEY_T));
KeyMap.push_back(SKeyMap(SDLK_u, KEY_KEY_U));
KeyMap.push_back(SKeyMap(SDLK_v, KEY_KEY_V));
KeyMap.push_back(SKeyMap(SDLK_w, KEY_KEY_W));
KeyMap.push_back(SKeyMap(SDLK_x, KEY_KEY_X));
KeyMap.push_back(SKeyMap(SDLK_y, KEY_KEY_Y));
KeyMap.push_back(SKeyMap(SDLK_z, KEY_KEY_Z));
KeyMap.push_back(SKeyMap(SDLK_a, IRR_KEY_IRR_KEY_A));
KeyMap.push_back(SKeyMap(SDLK_b, IRR_KEY_IRR_KEY_B));
KeyMap.push_back(SKeyMap(SDLK_c, IRR_KEY_IRR_KEY_C));
KeyMap.push_back(SKeyMap(SDLK_d, IRR_KEY_IRR_KEY_D));
KeyMap.push_back(SKeyMap(SDLK_e, IRR_KEY_IRR_KEY_E));
KeyMap.push_back(SKeyMap(SDLK_f, IRR_KEY_IRR_KEY_F));
KeyMap.push_back(SKeyMap(SDLK_g, IRR_KEY_IRR_KEY_G));
KeyMap.push_back(SKeyMap(SDLK_h, IRR_KEY_IRR_KEY_H));
KeyMap.push_back(SKeyMap(SDLK_i, IRR_KEY_IRR_KEY_I));
KeyMap.push_back(SKeyMap(SDLK_j, IRR_KEY_IRR_KEY_J));
KeyMap.push_back(SKeyMap(SDLK_k, IRR_KEY_IRR_KEY_K));
KeyMap.push_back(SKeyMap(SDLK_l, IRR_KEY_IRR_KEY_L));
KeyMap.push_back(SKeyMap(SDLK_m, IRR_KEY_IRR_KEY_M));
KeyMap.push_back(SKeyMap(SDLK_n, IRR_KEY_IRR_KEY_N));
KeyMap.push_back(SKeyMap(SDLK_o, IRR_KEY_IRR_KEY_O));
KeyMap.push_back(SKeyMap(SDLK_p, IRR_KEY_IRR_KEY_P));
KeyMap.push_back(SKeyMap(SDLK_q, IRR_KEY_IRR_KEY_Q));
KeyMap.push_back(SKeyMap(SDLK_r, IRR_KEY_IRR_KEY_R));
KeyMap.push_back(SKeyMap(SDLK_s, IRR_KEY_IRR_KEY_S));
KeyMap.push_back(SKeyMap(SDLK_t, IRR_KEY_IRR_KEY_T));
KeyMap.push_back(SKeyMap(SDLK_u, IRR_KEY_IRR_KEY_U));
KeyMap.push_back(SKeyMap(SDLK_v, IRR_KEY_IRR_KEY_V));
KeyMap.push_back(SKeyMap(SDLK_w, IRR_KEY_IRR_KEY_W));
KeyMap.push_back(SKeyMap(SDLK_x, IRR_KEY_IRR_KEY_X));
KeyMap.push_back(SKeyMap(SDLK_y, IRR_KEY_IRR_KEY_Y));
KeyMap.push_back(SKeyMap(SDLK_z, IRR_KEY_IRR_KEY_Z));
KeyMap.push_back(SKeyMap(SDLK_LSUPER, KEY_LWIN));
KeyMap.push_back(SKeyMap(SDLK_RSUPER, KEY_RWIN));
KeyMap.push_back(SKeyMap(SDLK_LSUPER, IRR_KEY_LWIN));
KeyMap.push_back(SKeyMap(SDLK_RSUPER, IRR_KEY_RWIN));
// apps missing
KeyMap.push_back(SKeyMap(SDLK_POWER, KEY_SLEEP)); //??
KeyMap.push_back(SKeyMap(SDLK_POWER, IRR_KEY_SLEEP)); //??
KeyMap.push_back(SKeyMap(SDLK_KP0, KEY_NUMPAD0));
KeyMap.push_back(SKeyMap(SDLK_KP1, KEY_NUMPAD1));
KeyMap.push_back(SKeyMap(SDLK_KP2, KEY_NUMPAD2));
KeyMap.push_back(SKeyMap(SDLK_KP3, KEY_NUMPAD3));
KeyMap.push_back(SKeyMap(SDLK_KP4, KEY_NUMPAD4));
KeyMap.push_back(SKeyMap(SDLK_KP5, KEY_NUMPAD5));
KeyMap.push_back(SKeyMap(SDLK_KP6, KEY_NUMPAD6));
KeyMap.push_back(SKeyMap(SDLK_KP7, KEY_NUMPAD7));
KeyMap.push_back(SKeyMap(SDLK_KP8, KEY_NUMPAD8));
KeyMap.push_back(SKeyMap(SDLK_KP9, KEY_NUMPAD9));
KeyMap.push_back(SKeyMap(SDLK_KP_MULTIPLY, KEY_MULTIPLY));
KeyMap.push_back(SKeyMap(SDLK_KP_PLUS, KEY_ADD));
// KeyMap.push_back(SKeyMap(SDLK_KP_, KEY_SEPARATOR));
KeyMap.push_back(SKeyMap(SDLK_KP_MINUS, KEY_SUBTRACT));
KeyMap.push_back(SKeyMap(SDLK_KP_PERIOD, KEY_DECIMAL));
KeyMap.push_back(SKeyMap(SDLK_KP_DIVIDE, KEY_DIVIDE));
KeyMap.push_back(SKeyMap(SDLK_KP0, IRR_KEY_NUMPAD0));
KeyMap.push_back(SKeyMap(SDLK_KP1, IRR_KEY_NUMPAD1));
KeyMap.push_back(SKeyMap(SDLK_KP2, IRR_KEY_NUMPAD2));
KeyMap.push_back(SKeyMap(SDLK_KP3, IRR_KEY_NUMPAD3));
KeyMap.push_back(SKeyMap(SDLK_KP4, IRR_KEY_NUMPAD4));
KeyMap.push_back(SKeyMap(SDLK_KP5, IRR_KEY_NUMPAD5));
KeyMap.push_back(SKeyMap(SDLK_KP6, IRR_KEY_NUMPAD6));
KeyMap.push_back(SKeyMap(SDLK_KP7, IRR_KEY_NUMPAD7));
KeyMap.push_back(SKeyMap(SDLK_KP8, IRR_KEY_NUMPAD8));
KeyMap.push_back(SKeyMap(SDLK_KP9, IRR_KEY_NUMPAD9));
KeyMap.push_back(SKeyMap(SDLK_KP_MULTIPLY, IRR_KEY_MULTIPLY));
KeyMap.push_back(SKeyMap(SDLK_KP_PLUS, IRR_KEY_ADD));
// KeyMap.push_back(SKeyMap(SDLK_KP_, IRR_KEY_SEPARATOR));
KeyMap.push_back(SKeyMap(SDLK_KP_MINUS, IRR_KEY_SUBTRACT));
KeyMap.push_back(SKeyMap(SDLK_KP_PERIOD, IRR_KEY_DECIMAL));
KeyMap.push_back(SKeyMap(SDLK_KP_DIVIDE, IRR_KEY_DIVIDE));
KeyMap.push_back(SKeyMap(SDLK_F1, KEY_F1));
KeyMap.push_back(SKeyMap(SDLK_F2, KEY_F2));
KeyMap.push_back(SKeyMap(SDLK_F3, KEY_F3));
KeyMap.push_back(SKeyMap(SDLK_F4, KEY_F4));
KeyMap.push_back(SKeyMap(SDLK_F5, KEY_F5));
KeyMap.push_back(SKeyMap(SDLK_F6, KEY_F6));
KeyMap.push_back(SKeyMap(SDLK_F7, KEY_F7));
KeyMap.push_back(SKeyMap(SDLK_F8, KEY_F8));
KeyMap.push_back(SKeyMap(SDLK_F9, KEY_F9));
KeyMap.push_back(SKeyMap(SDLK_F10, KEY_F10));
KeyMap.push_back(SKeyMap(SDLK_F11, KEY_F11));
KeyMap.push_back(SKeyMap(SDLK_F12, KEY_F12));
KeyMap.push_back(SKeyMap(SDLK_F13, KEY_F13));
KeyMap.push_back(SKeyMap(SDLK_F14, KEY_F14));
KeyMap.push_back(SKeyMap(SDLK_F15, KEY_F15));
KeyMap.push_back(SKeyMap(SDLK_F1, IRR_KEY_F1));
KeyMap.push_back(SKeyMap(SDLK_F2, IRR_KEY_F2));
KeyMap.push_back(SKeyMap(SDLK_F3, IRR_KEY_F3));
KeyMap.push_back(SKeyMap(SDLK_F4, IRR_KEY_F4));
KeyMap.push_back(SKeyMap(SDLK_F5, IRR_KEY_F5));
KeyMap.push_back(SKeyMap(SDLK_F6, IRR_KEY_F6));
KeyMap.push_back(SKeyMap(SDLK_F7, IRR_KEY_F7));
KeyMap.push_back(SKeyMap(SDLK_F8, IRR_KEY_F8));
KeyMap.push_back(SKeyMap(SDLK_F9, IRR_KEY_F9));
KeyMap.push_back(SKeyMap(SDLK_F10, IRR_KEY_F10));
KeyMap.push_back(SKeyMap(SDLK_F11, IRR_KEY_F11));
KeyMap.push_back(SKeyMap(SDLK_F12, IRR_KEY_F12));
KeyMap.push_back(SKeyMap(SDLK_F13, IRR_KEY_F13));
KeyMap.push_back(SKeyMap(SDLK_F14, IRR_KEY_F14));
KeyMap.push_back(SKeyMap(SDLK_F15, IRR_KEY_F15));
// no higher F-keys
KeyMap.push_back(SKeyMap(SDLK_NUMLOCK, KEY_NUMLOCK));
KeyMap.push_back(SKeyMap(SDLK_SCROLLOCK, KEY_SCROLL));
KeyMap.push_back(SKeyMap(SDLK_LSHIFT, KEY_LSHIFT));
KeyMap.push_back(SKeyMap(SDLK_RSHIFT, KEY_RSHIFT));
KeyMap.push_back(SKeyMap(SDLK_LCTRL, KEY_LCONTROL));
KeyMap.push_back(SKeyMap(SDLK_RCTRL, KEY_RCONTROL));
KeyMap.push_back(SKeyMap(SDLK_LALT, KEY_LMENU));
KeyMap.push_back(SKeyMap(SDLK_RALT, KEY_RMENU));
KeyMap.push_back(SKeyMap(SDLK_NUMLOCK, IRR_KEY_NUMLOCK));
KeyMap.push_back(SKeyMap(SDLK_SCROLLOCK, IRR_KEY_SCROLL));
KeyMap.push_back(SKeyMap(SDLK_LSHIFT, IRR_KEY_LSHIFT));
KeyMap.push_back(SKeyMap(SDLK_RSHIFT, IRR_KEY_RSHIFT));
KeyMap.push_back(SKeyMap(SDLK_LCTRL, IRR_KEY_LCONTROL));
KeyMap.push_back(SKeyMap(SDLK_RCTRL, IRR_KEY_RCONTROL));
KeyMap.push_back(SKeyMap(SDLK_LALT, IRR_KEY_LMENU));
KeyMap.push_back(SKeyMap(SDLK_RALT, IRR_KEY_RMENU));
KeyMap.push_back(SKeyMap(SDLK_PLUS, KEY_PLUS));
KeyMap.push_back(SKeyMap(SDLK_COMMA, KEY_COMMA));
KeyMap.push_back(SKeyMap(SDLK_MINUS, KEY_MINUS));
KeyMap.push_back(SKeyMap(SDLK_PERIOD, KEY_PERIOD));
KeyMap.push_back(SKeyMap(SDLK_PLUS, IRR_KEY_PLUS));
KeyMap.push_back(SKeyMap(SDLK_COMMA, IRR_KEY_COMMA));
KeyMap.push_back(SKeyMap(SDLK_MINUS, IRR_KEY_MINUS));
KeyMap.push_back(SKeyMap(SDLK_PERIOD, IRR_KEY_PERIOD));
// some special keys missing

View File

@ -44,6 +44,9 @@ namespace irr
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text);
//! sets the class of the window
virtual void setWindowClass(const char* text) {}
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,345 @@
//
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2016-2017 Dawid Gan
//
// 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 3
// of the License, or (at your option) 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef CIRRDEVICEWAYLAND_H
#define CIRRDEVICEWAYLAND_H
#include "IrrCompileConfig.h"
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
#include "CIrrDeviceStub.h"
#include "IImagePresenter.h"
#include "ICursorControl.h"
#include <wayland-client.h>
#include <wayland-cursor.h>
#include <wayland-egl.h>
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-compose.h>
#include <map>
#include <vector>
class ContextManagerEGL;
namespace irr
{
class CIrrDeviceWayland : public CIrrDeviceStub,
public video::IImagePresenter
{
public:
friend class WaylandCallbacks;
//! constructor
CIrrDeviceWayland(const SIrrlichtCreationParameters& param);
//! destructor
virtual ~CIrrDeviceWayland();
//! runs the device. Returns false if device wants to be deleted
virtual bool run();
//! Cause the device to temporarily pause execution and let other
//! processes to run. This should bring down processor usage without
//! major performance loss for Irrlicht
virtual void yield();
//! Pause execution and let other processes to run for a specified
//! amount of time.
virtual void sleep(u32 timeMs, bool pauseTimer);
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text);
//! sets the class of the window
virtual void setWindowClass(const char* text);
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const;
//! returns if window has focus.
virtual bool isWindowFocused() const;
//! returns if window is minimized.
virtual bool isWindowMinimized() const;
//! returns color format of the window.
virtual video::ECOLOR_FORMAT getColorFormat() const;
//! presents a surface in the client area
virtual bool present(video::IImage* surface, void* windowId=0,
core::rect<s32>* src=0);
//! notifies the device that it should close itself
virtual void closeDevice();
//! \return Returns a pointer to a list with all video modes
//! supported by the gfx adapter.
video::IVideoModeList* getVideoModeList();
//! Sets if the window should be resizable in windowed mode.
virtual void setResizable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
//! Maximizes the window.
virtual void maximizeWindow();
//! Restores the window size.
virtual void restoreWindow();
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo);
//! Set the current Gamma Value for the Display
virtual bool setGammaRamp(f32 red, f32 green, f32 blue,
f32 brightness, f32 contrast);
//! Get the current Gamma Value for the Display
virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
f32 &brightness, f32 &contrast);
//! gets text from the clipboard
//! \return Returns 0 if no string is in there.
virtual const c8* getTextFromClipboard() const;
//! copies text to the clipboard
virtual void copyToClipboard(const c8* text) const;
//! Remove all messages pending in the system message loop
virtual void clearSystemMessages();
//! Get the device type
virtual E_DEVICE_TYPE getType() const
{
return EIDT_WAYLAND;
}
static bool isWaylandDeviceWorking();
ContextManagerEGL* getEGLContext() {return m_egl_context;}
void updateCursor();
unsigned int getWidth() {return m_width;}
unsigned int getHeight() {return m_height;}
private:
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
struct JoystickInfo
{
int fd;
int axes;
int buttons;
SEvent persistentData;
JoystickInfo() : fd(-1), axes(0), buttons(0) { }
};
core::array<JoystickInfo> m_active_joysticks;
#endif
wl_compositor* m_compositor;
wl_cursor* m_cursor;
wl_cursor_theme* m_cursor_theme;
wl_display* m_display;
wl_egl_window* m_egl_window;
wl_keyboard* m_keyboard;
wl_output* m_output;
wl_pointer* m_pointer;
wl_registry* m_registry;
wl_seat* m_seat;
wl_shell* m_shell;
wl_shell_surface* m_shell_surface;
wl_shm* m_shm;
wl_surface* m_cursor_surface;
wl_surface* m_surface;
uint32_t m_enter_serial;
xkb_context* m_xkb_context;
xkb_compose_table* m_xkb_compose_table;
xkb_compose_state* m_xkb_compose_state;
xkb_keymap* m_xkb_keymap;
xkb_state* m_xkb_state;
xkb_mod_mask_t m_xkb_alt_mask;
xkb_mod_mask_t m_xkb_ctrl_mask;
xkb_mod_mask_t m_xkb_shift_mask;
bool m_xkb_alt_pressed;
bool m_xkb_ctrl_pressed;
bool m_xkb_shift_pressed;
bool m_repeat_enabled;
SEvent m_repeat_event;
uint32_t m_repeat_time;
uint32_t m_repeat_rate;
uint32_t m_repeat_delay;
uint32_t m_mouse_button_states;
unsigned int m_width;
unsigned int m_height;
bool m_window_has_focus;
bool m_window_minimized;
mutable core::stringc m_clipboard;
std::map<int, EKEY_CODE> m_key_map;
std::vector<SEvent> m_events;
std::vector<core::dimension2du> m_modes;
ContextManagerEGL* m_egl_context;
void createDriver();
void createKeyMap();
bool createWindow();
bool initEGL();
void signalEvent(const SEvent&);
void pollJoysticks();
void closeJoysticks();
};
//! Implementation of the linux cursor control
class CCursorControl : public gui::ICursorControl
{
public:
CCursorControl(CIrrDeviceWayland* device) : m_device(device),
m_is_visible(true), m_use_reference_rect(false) {};
~CCursorControl() {};
//! Changes the visible state of the mouse cursor.
virtual void setVisible(bool visible)
{
if (visible == m_is_visible)
return;
m_is_visible = visible;
m_device->updateCursor();
}
//! Returns if the cursor is currently visible.
virtual bool isVisible() const
{
return m_is_visible;
}
//! Sets the new position of the cursor.
virtual void setPosition(const core::position2d<f32> &pos)
{
setPosition(pos.X, pos.Y);
}
//! Sets the new position of the cursor.
virtual void setPosition(f32 x, f32 y)
{
setPosition((s32)(x * m_device->getWidth()),
(s32)(y * m_device->getHeight()));
}
//! Sets the new position of the cursor.
virtual void setPosition(const core::position2d<s32> &pos)
{
setPosition(pos.X, pos.Y);
}
//! Sets the new position of the cursor.
virtual void setPosition(s32 x, s32 y)
{
m_cursor_pos.X = x;
m_cursor_pos.Y = y;
}
//! Returns the current position of the mouse cursor.
virtual const core::position2d<s32>& getPosition()
{
return m_cursor_pos;
}
virtual core::position2d<f32> getRelativePosition()
{
if (!m_use_reference_rect)
{
return core::position2d<f32>(
m_cursor_pos.X / (f32)m_device->getWidth(),
m_cursor_pos.Y / (f32)m_device->getHeight());
}
return core::position2d<f32>(
m_cursor_pos.X / (f32)m_reference_rect.getWidth(),
m_cursor_pos.Y / (f32)m_reference_rect.getHeight());
}
virtual void setReferenceRect(core::rect<s32>* rect=0)
{
m_use_reference_rect = false;
if (rect)
{
m_reference_rect = *rect;
m_use_reference_rect = true;
// prevent division through zero and uneven sizes
if (m_reference_rect.getHeight() == 0 ||
m_reference_rect.getHeight() % 2)
m_reference_rect.LowerRightCorner.Y += 1;
if (m_reference_rect.getWidth() == 0 ||
m_reference_rect.getWidth() % 2)
m_reference_rect.LowerRightCorner.X += 1;
}
}
//! Sets the active cursor icon
virtual void setActiveIcon(gui::ECURSOR_ICON iconId) {};
//! Gets the currently active icon
virtual gui::ECURSOR_ICON getActiveIcon() const
{
return gui::ECI_NORMAL;
}
//! Add a custom sprite as cursor icon.
virtual gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon)
{
return gui::ECI_NORMAL;
}
//! replace the given cursor icon.
virtual void changeIcon(gui::ECURSOR_ICON iconId,
const gui::SCursorSprite& icon) {}
/** Return a system-specific size which is supported for cursors.
Larger icons will fail, smaller icons might work. */
virtual core::dimension2di getSupportedIconSize() const
{
return core::dimension2di(0, 0);
}
private:
CIrrDeviceWayland* m_device;
core::position2d<s32> m_cursor_pos;
core::rect<s32> m_reference_rect;
bool m_is_visible;
bool m_use_reference_rect;
};
} // end namespace irr
#endif
#endif // CIRRDEVICEWAYLAND_H

File diff suppressed because it is too large Load Diff

View File

@ -51,6 +51,9 @@ namespace irr
//! sets the caption of the window
virtual void setWindowCaption(const wchar_t* text);
//! sets the class of the window
virtual void setWindowClass(const char* text) {}
//! returns if window is active. if not, nothing need to be drawn
virtual bool isWindowActive() const;

View File

@ -17,6 +17,7 @@
#include "COGLES2NormalMapRenderer.h"
#include "COGLES2ParallaxMapRenderer.h"
#include "COGLES2Renderer2D.h"
#include "CContextEGL.h"
#include "CImage.h"
#include "os.h"
@ -24,7 +25,6 @@
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#else
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#endif
@ -45,15 +45,16 @@ namespace video
BridgeCalls(0), CurrentRenderMode(ERM_NONE), ResetRenderStates(true),
Transformation3DChanged(true), AntiAlias(params.AntiAlias),
RenderTargetTexture(0), CurrentRendertargetSize(0, 0), ColorFormat(ECF_R8G8B8)
#ifdef EGL_VERSION_1_0
, EglDisplay(EGL_NO_DISPLAY)
#endif
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
, HDc(0)
#if defined(_IRR_COMPILE_WITH_EGL_)
, EglContext(0)
, EglContextExternal(false)
#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
, ViewFramebuffer(0)
, ViewRenderbuffer(0)
, ViewDepthRenderbuffer(0)
#endif
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
, HDc(0)
#endif
, Params(params)
{
@ -61,248 +62,50 @@ namespace video
setDebugName("COGLES2Driver");
#endif
ExposedData = data;
#if defined(_IRR_COMPILE_WITH_EGL_)
EglContext = new ContextManagerEGL();
ContextEGLParams egl_params;
egl_params.opengl_api = CEGL_API_OPENGL_ES;
egl_params.surface_type = CEGL_SURFACE_WINDOW;
egl_params.force_legacy_device = Params.ForceLegacyDevice;
egl_params.with_alpha_channel = Params.WithAlphaChannel;
egl_params.vsync_enabled = Params.Vsync;
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
EglWindow = (NativeWindowType)data.OpenGLWin32.HWnd;
HDc = GetDC((HWND)EglWindow);
EglDisplay = eglGetDisplay((NativeDisplayType)HDc);
egl_params.window = (EGLNativeWindowType)(data.OpenGLWin32.HWnd);
HDc = GetDC(data.OpenGLWin32.HWnd);
egl_params.display = (NativeDisplayType)(HDc);
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
EglWindow = (NativeWindowType)ExposedData.OpenGLLinux.X11Window;
EglDisplay = eglGetDisplay((NativeDisplayType)ExposedData.OpenGLLinux.X11Display);
#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
Device = device;
egl_params.window = (EGLNativeWindowType)(data.OpenGLLinux.X11Window);
egl_params.display = (EGLNativeDisplayType)(data.OpenGLLinux.X11Display);
#elif defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
EglWindow = ((struct android_app *)(params.PrivateData))->window;
EglDisplay = EGL_NO_DISPLAY;
egl_params.window = ((struct android_app *)(params.PrivateData))->window;
egl_params.display = NULL;
#endif
#ifdef EGL_VERSION_1_0
if (EglDisplay == EGL_NO_DISPLAY)
{
os::Printer::log("Getting OpenGL-ES2 display.");
EglDisplay = eglGetDisplay((NativeDisplayType) EGL_DEFAULT_DISPLAY);
}
if (EglDisplay == EGL_NO_DISPLAY)
{
os::Printer::log("Could not get OpenGL-ES2 display.");
}
EGLint majorVersion, minorVersion;
if (!eglInitialize(EglDisplay, &majorVersion, &minorVersion))
{
os::Printer::log("Could not initialize OpenGL-ES2 display.");
}
else
{
char text[64];
sprintf(text, "EglDisplay initialized. Egl version %d.%d\n", majorVersion, minorVersion);
os::Printer::log(text);
}
EGLint attribs[] =
{
#if defined( _IRR_COMPILE_WITH_ANDROID_DEVICE_ )
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_BLUE_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_RED_SIZE, 8,
EGL_DEPTH_SIZE, 16,
EGL_NONE
#else
EGL_RED_SIZE, 5,
EGL_GREEN_SIZE, 5,
EGL_BLUE_SIZE, 5,
EGL_ALPHA_SIZE, params.WithAlphaChannel ? 1 : 0,
EGL_BUFFER_SIZE, params.Bits,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
//EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER,
EGL_DEPTH_SIZE, params.ZBufferBits,
EGL_STENCIL_SIZE, params.Stencilbuffer,
EGL_SAMPLE_BUFFERS, params.AntiAlias ? 1 : 0,
EGL_SAMPLES, params.AntiAlias,
#ifdef EGL_VERSION_1_3
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
#endif
EGL_NONE, 0
#endif
};
EGLint num_configs;
u32 steps=5;
while (!eglChooseConfig(EglDisplay, attribs, &EglConfig, 1, &num_configs) || !num_configs)
{
switch (steps)
{
case 5: // samples
if (attribs[19]>2)
{
--attribs[19];
}
else
{
attribs[17]=0;
attribs[19]=0;
--steps;
}
break;
case 4: // alpha
if (attribs[7])
{
attribs[7]=0;
if (params.AntiAlias)
{
attribs[17]=1;
attribs[19]=params.AntiAlias;
steps=5;
}
}
else
--steps;
break;
case 3: // stencil
if (attribs[15])
{
attribs[15]=0;
if (params.AntiAlias)
{
attribs[17]=1;
attribs[19]=params.AntiAlias;
steps=5;
}
}
else
--steps;
break;
case 2: // depth size
if (attribs[13]>16)
{
attribs[13]-=8;
}
else
--steps;
break;
case 1: // buffer size
if (attribs[9]>16)
{
attribs[9]-=8;
}
else
--steps;
break;
default:
os::Printer::log("Could not get config for OpenGL-ES2 display.");
return;
}
}
if (params.AntiAlias && !attribs[17])
os::Printer::log("No multisampling.");
if (params.WithAlphaChannel && !attribs[7])
os::Printer::log("No alpha.");
if (params.Stencilbuffer && !attribs[15])
os::Printer::log("No stencil buffer.");
if (params.ZBufferBits > attribs[13])
os::Printer::log("No full depth buffer.");
if (params.Bits > attribs[9])
os::Printer::log("No full color buffer.");
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
/* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
* guaranteed to be accepted by ANativeWindow_setBuffersGeometry().
* As soon as we picked a EGLConfig, we can safely reconfigure the
* ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */
EGLint format;
eglGetConfigAttrib(EglDisplay, EglConfig, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry(EglWindow, 0, 0, format);
#endif
os::Printer::log(" Creating EglSurface with nativeWindow...");
EglSurface = eglCreateWindowSurface(EglDisplay, EglConfig, EglWindow, NULL);
if (EGL_NO_SURFACE == EglSurface)
{
os::Printer::log("FAILED\n");
EglSurface = eglCreateWindowSurface(EglDisplay, EglConfig, 0, NULL);
os::Printer::log("Creating EglSurface without nativeWindows...");
}
else
os::Printer::log("SUCCESS\n");
if (EGL_NO_SURFACE == EglSurface)
{
os::Printer::log("FAILED\n");
os::Printer::log("Could not create surface for OpenGL-ES2 display.");
}
else
os::Printer::log("SUCCESS\n");
#ifdef EGL_VERSION_1_2
if (minorVersion>1)
eglBindAPI(EGL_OPENGL_ES_API);
#endif
os::Printer::log("Creating EglContext...");
EglContext = EGL_NO_CONTEXT;
if (!Params.ForceLegacyDevice)
{
os::Printer::log("Trying to create Context for OpenGL-ES3.");
EGLint contextAttrib[] =
{
#ifdef EGL_VERSION_1_3
EGL_CONTEXT_CLIENT_VERSION, 3,
#endif
EGL_NONE, 0
};
EglContext = eglCreateContext(EglDisplay, EglConfig, EGL_NO_CONTEXT, contextAttrib);
}
if (EGL_NO_CONTEXT == EglContext)
{
os::Printer::log("Trying to create Context for OpenGL-ES2.");
useCoreContext = false;
EGLint contextAttrib[] =
{
#ifdef EGL_VERSION_1_3
EGL_CONTEXT_CLIENT_VERSION, 2,
#endif
EGL_NONE, 0
};
EglContext = eglCreateContext(EglDisplay, EglConfig, EGL_NO_CONTEXT, contextAttrib);
if (EGL_NO_CONTEXT == EglContext)
{
os::Printer::log("FAILED\n");
os::Printer::log("Could not create Context for OpenGL-ES2 display.");
}
}
eglMakeCurrent(EglDisplay, EglSurface, EglSurface, EglContext);
if (testEGLError())
{
os::Printer::log("Could not make Context current for OpenGL-ES2 display.");
}
EglContext->init(egl_params);
useCoreContext = !EglContext->isLegacyDevice();
genericDriverInit(params.WindowSize, params.Stencilbuffer);
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
int backingWidth;
int backingHeight;
eglQuerySurface(EglDisplay, EglSurface, EGL_WIDTH, &backingWidth);
eglQuerySurface(EglDisplay, EglSurface, EGL_HEIGHT, &backingHeight);
core::dimension2d<u32> WindowSize(backingWidth, backingHeight);
CNullDriver::ScreenSize = WindowSize;
int width = 0;
int height = 0;
EglContext->getSurfaceDimensions(&width, &height);
CNullDriver::ScreenSize = core::dimension2d<u32>(width, height);
#endif
#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
Device = device;
// set vsync
if (params.Vsync)
eglSwapInterval(EglDisplay, 1);
#elif defined(GL_ES_VERSION_2_0)
glGenFramebuffers(1, &ViewFramebuffer);
glGenRenderbuffers(1, &ViewRenderbuffer);
glBindRenderbuffer(GL_RENDERBUFFER, ViewRenderbuffer);
#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
ExposedData.OGLESIPhone.AppDelegate = Device;
Device->displayInitialize(&ExposedData.OGLESIPhone.Context, &ExposedData.OGLESIPhone.View);
#endif
GLint backingWidth;
GLint backingHeight;
@ -331,6 +134,22 @@ namespace video
#endif
}
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
COGLES2Driver::COGLES2Driver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io, CIrrDeviceWayland* device)
: CNullDriver(io, params.WindowSize), COGLES2ExtensionHandler(),
BridgeCalls(0), CurrentRenderMode(ERM_NONE), ResetRenderStates(true),
Transformation3DChanged(true), AntiAlias(params.AntiAlias),
RenderTargetTexture(0), CurrentRendertargetSize(0, 0),
ColorFormat(ECF_R8G8B8), EglContext(0), EglContextExternal(false),
Params(params)
{
EglContext = device->getEGLContext();
EglContextExternal = true;
genericDriverInit(params.WindowSize, params.Stencilbuffer);
}
#endif
//! destructor
COGLES2Driver::~COGLES2Driver()
@ -342,32 +161,17 @@ namespace video
if (BridgeCalls)
delete BridgeCalls;
#if defined(EGL_VERSION_1_0)
eglMakeCurrent(EglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (EglContext != EGL_NO_CONTEXT)
{
eglDestroyContext(EglDisplay, EglContext);
EglContext = EGL_NO_CONTEXT;
}
if (EglSurface != EGL_NO_SURFACE)
{
eglDestroySurface(EglDisplay, EglSurface);
EglSurface = EGL_NO_SURFACE;
}
if (EglDisplay != EGL_NO_DISPLAY)
{
eglTerminate(EglDisplay);
EglDisplay = EGL_NO_DISPLAY;
}
#if defined(_IRR_COMPILE_WITH_EGL_)
if (!EglContextExternal)
delete EglContext;
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
if (HDc)
ReleaseDC((HWND)EglWindow, HDc);
ReleaseDC((ExposedData.OpenGLWin32.HWnd, HDc);
#endif
#elif defined(GL_ES_VERSION_2_0)
#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
if (0 != ViewFramebuffer)
{
glDeleteFramebuffers(1,&ViewFramebuffer);
@ -390,41 +194,12 @@ namespace video
// METHODS
// -----------------------------------------------------------------------
void COGLES2Driver::reloadEGLSurface(void* window)
{
os::Printer::log("Reload EGL surface.");
#ifdef EGL_VERSION_1_0
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
EglWindow = (ANativeWindow*)window;
#endif
if (!EglWindow)
os::Printer::log("Invalid Egl window.");
eglMakeCurrent(EglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroySurface(EglDisplay, EglSurface);
EglSurface = eglCreateWindowSurface(EglDisplay, EglConfig, EglWindow, 0);
if (EGL_NO_SURFACE == EglSurface)
os::Printer::log("Could not create EGL surface.");
eglMakeCurrent(EglDisplay, EglSurface, EglSurface, EglContext);
#endif
}
bool COGLES2Driver::genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer)
{
Name = glGetString(GL_VERSION);
printVersion();
#if defined(EGL_VERSION_1_0)
os::Printer::log(eglQueryString(EglDisplay, EGL_CLIENT_APIS));
#endif
// print renderer information
vendorName = glGetString(GL_VENDOR);
os::Printer::log(vendorName.c_str(), ELL_INFORMATION);
@ -433,11 +208,7 @@ namespace video
for (i = 0; i < MATERIAL_MAX_TEXTURES; ++i)
CurrentTexture[i] = 0;
// load extensions
initExtensions(this,
#if defined(EGL_VERSION_1_0)
EglDisplay,
#endif
stencilBuffer);
initExtensions(this, stencilBuffer);
if (!BridgeCalls)
BridgeCalls = new COGLES2CallBridge(this);
@ -661,6 +432,13 @@ namespace video
addAndDropMaterialRenderer(new COGLES2ParallaxMapRenderer(PMVSData, PMFSData, EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA, this));
addAndDropMaterialRenderer(new COGLES2FixedPipelineRenderer(FPVSData, FPFSData, EMT_ONETEXTURE_BLEND, this));
delete[] FPVSData;
delete[] FPFSData;
delete[] NMVSData;
delete[] NMFSData;
delete[] PMVSData;
delete[] PMFSData;
// Create 2D material renderer.
@ -705,34 +483,29 @@ namespace video
R2DFSFile->drop();
MaterialRenderer2D = new COGLES2Renderer2D(R2DVSData, R2DFSData, this);
delete[] R2DVSData;
delete[] R2DFSData;
}
//! presents the rendered scene on the screen, returns false if failed
bool COGLES2Driver::endScene()
{
CNullDriver::endScene();
CNullDriver::endScene();
#if defined(EGL_VERSION_1_0)
eglSwapBuffers(EglDisplay, EglSurface);
EGLint g = eglGetError();
if (EGL_SUCCESS != g)
#if defined(_IRR_COMPILE_WITH_EGL_)
bool res = EglContext->swapBuffers();
if (!res)
{
if (EGL_CONTEXT_LOST == g)
{
// o-oh, ogl-es has lost contexts...
os::Printer::log("Context lost, please restart your app.");
}
else
os::Printer::log("Could not swap buffers for OpenGL-ES2 driver.");
os::Printer::log("Could not swap buffers for OpenGL-ES2 driver.");
return false;
}
#elif defined(GL_ES_VERSION_2_0)
glFlush();
glBindRenderbuffer(GL_RENDERBUFFER, ViewRenderbuffer);
#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
Device->displayEnd();
#endif
#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
glFlush();
glBindRenderbuffer(GL_RENDERBUFFER, ViewRenderbuffer);
Device->displayEnd();
#endif
return true;
@ -1896,65 +1669,6 @@ namespace video
#endif
}
//! prints error if an error happened.
bool COGLES2Driver::testEGLError()
{
#if defined(EGL_VERSION_1_0) && defined(_DEBUG)
EGLint g = eglGetError();
switch (g)
{
case EGL_SUCCESS:
return false;
case EGL_NOT_INITIALIZED :
os::Printer::log("Not Initialized", ELL_ERROR);
break;
case EGL_BAD_ACCESS:
os::Printer::log("Bad Access", ELL_ERROR);
break;
case EGL_BAD_ALLOC:
os::Printer::log("Bad Alloc", ELL_ERROR);
break;
case EGL_BAD_ATTRIBUTE:
os::Printer::log("Bad Attribute", ELL_ERROR);
break;
case EGL_BAD_CONTEXT:
os::Printer::log("Bad Context", ELL_ERROR);
break;
case EGL_BAD_CONFIG:
os::Printer::log("Bad Config", ELL_ERROR);
break;
case EGL_BAD_CURRENT_SURFACE:
os::Printer::log("Bad Current Surface", ELL_ERROR);
break;
case EGL_BAD_DISPLAY:
os::Printer::log("Bad Display", ELL_ERROR);
break;
case EGL_BAD_SURFACE:
os::Printer::log("Bad Surface", ELL_ERROR);
break;
case EGL_BAD_MATCH:
os::Printer::log("Bad Match", ELL_ERROR);
break;
case EGL_BAD_PARAMETER:
os::Printer::log("Bad Parameter", ELL_ERROR);
break;
case EGL_BAD_NATIVE_PIXMAP:
os::Printer::log("Bad Native Pixmap", ELL_ERROR);
break;
case EGL_BAD_NATIVE_WINDOW:
os::Printer::log("Bad Native Window", ELL_ERROR);
break;
case EGL_CONTEXT_LOST:
os::Printer::log("Context Lost", ELL_ERROR);
break;
};
return true;
#else
return false;
#endif
}
void COGLES2Driver::setRenderStates3DMode()
{
if (useCoreContext)
@ -3183,6 +2897,22 @@ namespace video
}
#endif
// -----------------------------------
// WAYLAND VERSION
// -----------------------------------
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io, CIrrDeviceWayland* device)
{
#ifdef _IRR_COMPILE_WITH_OGLES2_
return new COGLES2Driver(params, io, device);
#else
return 0;
#endif // _IRR_COMPILE_WITH_OGLES2_
}
#endif
// -----------------------------------
// MACOSX VERSION
// -----------------------------------

View File

@ -10,16 +10,12 @@
#include "IrrCompileConfig.h"
#if defined(_IRR_WINDOWS_API_)
// include windows headers for HWND
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#if defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#include "MacOSX/CIrrDeviceMacOSX.h"
#elif defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
#include "iOS/CIrrDeviceiOS.h"
#elif _IRR_COMPILE_WITH_WAYLAND_DEVICE_
#include "CIrrDeviceWayland.h"
#endif
#include "SIrrCreationParameters.h"
@ -30,11 +26,8 @@
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#elif defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include "android_native_app_glue.h"
#else
#include <EGL/eglplatform.h>
#endif
#include "CNullDriver.h"
@ -43,11 +36,12 @@
#include "fast_atof.h"
#ifdef _MSC_VER
#pragma comment(lib, "libEGL.lib")
#pragma comment(lib, "libGLESv2.lib")
#endif
#include "COGLES2ExtensionHandler.h"
class ContextManagerEGL;
namespace irr
{
namespace video
@ -71,6 +65,11 @@ namespace video
io::IFileSystem* io);
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
COGLES2Driver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io, CIrrDeviceWayland* device);
#endif
#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
COGLES2Driver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io, CIrrDeviceMacOSX *device);
@ -340,9 +339,6 @@ namespace video
//! checks if an OpenGL error has happend and prints it
bool testGLError();
//! checks if an OGLES1 error has happend and prints it
bool testEGLError();
//! Set/unset a clipping plane.
virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable = false);
@ -381,8 +377,10 @@ namespace video
//! Get bridge calls.
COGLES2CallBridge* getBridgeCalls() const;
void reloadEGLSurface(void* window);
#if defined(_IRR_COMPILE_WITH_EGL_)
ContextManagerEGL* getEGLContext() {return EglContext;}
#endif
private:
// Bridge calls.
@ -466,21 +464,19 @@ namespace video
SColorf AmbientLight;
COGLES2Renderer2D* MaterialRenderer2D;
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
HDC HDc;
#if defined(_IRR_COMPILE_WITH_EGL_)
ContextManagerEGL* EglContext;
bool EglContextExternal;
#endif
#if defined(_IRR_COMPILE_WITH_IPHONE_DEVICE_)
CIrrDeviceIPhone* Device;
GLuint ViewFramebuffer;
GLuint ViewRenderbuffer;
GLuint ViewDepthRenderbuffer;
#else
NativeWindowType EglWindow;
void* EglDisplay;
void* EglSurface;
void* EglContext;
EGLConfig EglConfig;
#endif
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
HDC HDc;
#endif
SIrrlichtCreationParameters Params;

View File

@ -158,7 +158,7 @@ namespace video
};
COGLES2ExtensionHandler::COGLES2ExtensionHandler() :
EGLVersion(0), Version(0), MaxTextureUnits(0), MaxSupportedTextures(0),
Version(0), MaxTextureUnits(0), MaxSupportedTextures(0),
MaxAnisotropy(1), MaxIndices(0xffff), MaxTextureSize(1),
MaxTextureLODBias(0.f),
StencilBuffer(false)
@ -176,17 +176,8 @@ namespace video
void COGLES2ExtensionHandler::initExtensions(COGLES2Driver* driver,
#ifdef EGL_VERSION_1_0
EGLDisplay display,
#endif
bool withStencil)
{
#ifdef EGL_VERSION_1_0
const f32 egl_ver = core::fast_atof(reinterpret_cast<const c8*>(eglQueryString(display, EGL_VERSION)));
EGLVersion = static_cast<u16>(core::floor32(egl_ver)*100+core::round32(core::fract(egl_ver)*10.0f));
core::stringc eglExtensions = eglQueryString(display, EGL_EXTENSIONS);
os::Printer::log(eglExtensions.c_str());
#endif
const core::stringc stringVer(glGetString(GL_VERSION));
const f32 ogl_ver = core::fast_atof(stringVer.c_str() + 10);
Version = static_cast<u16>(core::floor32(ogl_ver) * 100 + core::round32(core::fract(ogl_ver) * 10.0f));

View File

@ -14,7 +14,6 @@
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#else
#include <EGL/egl.h>
#include <GLES2/gl2.h>
// seems to be missing...
typedef char GLchar;
@ -232,13 +231,9 @@ namespace video
void dump() const;
void initExtensions(COGLES2Driver* driver,
#ifdef EGL_VERSION_1_0
EGLDisplay display,
#endif
bool withStencil);
protected:
u16 EGLVersion;
u16 Version;
u8 MaxTextureUnits;
u8 MaxSupportedTextures;

View File

@ -93,7 +93,7 @@ COGLES2MaterialRenderer::~COGLES2MaterialRenderer()
if (Program)
{
GLuint shaders[8];
GLint count;
GLint count = 0;
glGetAttachedShaders(Program, 8, &count, shaders);
count=core::min_(count,8);

View File

@ -22,9 +22,15 @@
#endif
#endif
#include <cassert>
#include "IrrlichtDevice.h"
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#include "CIrrDeviceLinux.h"
#endif
#if defined(_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
#include "CIrrDeviceWayland.h"
#endif
#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
#include "MacOSX/OSXClipboard.h"
#endif
@ -32,16 +38,16 @@
namespace irr
{
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
// constructor linux
COSOperator::COSOperator(const core::stringc& osVersion, CIrrDeviceLinux* device)
: OperatingSystem(osVersion), IrrDeviceLinux(device)
COSOperator::COSOperator(const core::stringc& osVersion, IrrlichtDevice* device)
: OperatingSystem(osVersion), IrrDevice(device)
{
}
#endif
// constructor
COSOperator::COSOperator(const core::stringc& osVersion) : OperatingSystem(osVersion)
COSOperator::COSOperator(const core::stringc& osVersion)
: OperatingSystem(osVersion), IrrDevice(NULL)
{
#ifdef _DEBUG
setDebugName("COSOperator");
@ -117,10 +123,29 @@ void COSOperator::copyToClipboard(const c8* text) const
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
OSXCopyToClipboard(text);
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if ( IrrDeviceLinux )
IrrDeviceLinux->copyToClipboard(text);
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
if (IrrDevice != NULL)
{
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if (IrrDevice->getType() == EIDT_X11)
{
CIrrDeviceLinux* device = dynamic_cast<CIrrDeviceLinux*>(IrrDevice);
assert(device);
device->copyToClipboard(text);
}
#endif
#if defined(_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
if (IrrDevice->getType() == EIDT_WAYLAND)
{
CIrrDeviceWayland* device = dynamic_cast<CIrrDeviceWayland*>(IrrDevice);
assert(device);
device->copyToClipboard(text);
}
#endif
}
#else
#endif
@ -171,11 +196,32 @@ const c8* COSOperator::getTextFromClipboard() const
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
return (OSXCopyFromClipboard());
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if ( IrrDeviceLinux )
return IrrDeviceLinux->getTextFromClipboard();
return 0;
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
if (IrrDevice != NULL)
{
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
if (IrrDevice->getType() == EIDT_X11)
{
CIrrDeviceLinux* device = dynamic_cast<CIrrDeviceLinux*>(IrrDevice);
assert(device);
return device->getTextFromClipboard();
}
#endif
#if defined(_IRR_COMPILE_WITH_WAYLAND_DEVICE_)
if (IrrDevice->getType() == EIDT_WAYLAND)
{
CIrrDeviceWayland* device = dynamic_cast<CIrrDeviceWayland*>(IrrDevice);
assert(device);
return device->getTextFromClipboard();
}
#endif
}
return 0;
#else

View File

@ -10,7 +10,7 @@
namespace irr
{
class CIrrDeviceLinux;
class IrrlichtDevice;
//! The Operating system operator provides operation system specific methods and informations.
class COSOperator : public IOSOperator
@ -18,9 +18,7 @@ class COSOperator : public IOSOperator
public:
// constructor
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
COSOperator(const core::stringc& osversion, CIrrDeviceLinux* device);
#endif
COSOperator(const core::stringc& osversion, IrrlichtDevice* device);
COSOperator(const core::stringc& osversion);
//! returns the current operation system version as string.
@ -55,10 +53,7 @@ public:
private:
core::stringc OperatingSystem;
#if defined(_IRR_COMPILE_WITH_X11_DEVICE_)
CIrrDeviceLinux * IrrDeviceLinux;
#endif
IrrlichtDevice* IrrDevice;
};

View File

@ -26,6 +26,11 @@ extern bool GLContextDebugBit;
#include "MacOSX/CIrrDeviceMacOSX.h"
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
#include "CIrrDeviceWayland.h"
#include "CContextEGL.h"
#endif
namespace irr
{
namespace video
@ -677,6 +682,51 @@ bool COpenGLDriver::initDriver(CIrrDeviceLinux* device)
#endif // _IRR_COMPILE_WITH_X11_DEVICE_
// -----------------------------------------------------------------------
// Wayland CONSTRUCTOR
// -----------------------------------------------------------------------
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
//! Linux constructor and init code
COpenGLDriver::COpenGLDriver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io, CIrrDeviceWayland* device)
: CNullDriver(io, params.WindowSize), COpenGLExtensionHandler(),
CurrentRenderMode(ERM_NONE), ResetRenderStates(true),
Transformation3DChanged(true), AntiAlias(params.AntiAlias),
RenderTargetTexture(0), CurrentRendertargetSize(0, 0), ColorFormat(ECF_R8G8B8),
CurrentTarget(ERT_FRAME_BUFFER), Params(params),
wl_device(device), DeviceType(EIDT_WAYLAND)
{
#ifdef _DEBUG
setDebugName("COpenGLDriver");
#endif
}
bool COpenGLDriver::changeRenderContext(const SExposedVideoData& videoData,
CIrrDeviceWayland* device)
{
if (!device->getEGLContext()->makeCurrent())
{
os::Printer::log("Render Context switch failed.");
return false;
}
return true;
}
//! inits the open gl driver
bool COpenGLDriver::initDriver(CIrrDeviceWayland* device)
{
genericDriverInit();
return true;
}
#endif // _IRR_COMPILE_WITH_WAYLAND_DEVICE
// -----------------------------------------------------------------------
// SDL CONSTRUCTOR
// -----------------------------------------------------------------------
@ -929,6 +979,14 @@ bool COpenGLDriver::endScene()
}
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
if (DeviceType == EIDT_WAYLAND)
{
wl_device->getEGLContext()->swapBuffers();
return true;
}
#endif
#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
if (DeviceType == EIDT_OSX)
{
@ -996,6 +1054,11 @@ bool COpenGLDriver::beginScene(bool backBuffer, bool zBuffer, SColor color,
case EIDT_X11:
changeRenderContext(videoData, X11Device);
break;
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
case EIDT_WAYLAND:
changeRenderContext(videoData, wl_device);
break;
#endif
default:
changeRenderContext(videoData, (void*)0);
@ -4928,6 +4991,28 @@ IVideoDriver* createOpenGLDriver(const SIrrlichtCreationParameters& params,
#endif // _IRR_COMPILE_WITH_X11_DEVICE_
// -----------------------------------
// Wayland VERSION
// -----------------------------------
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
IVideoDriver* createOpenGLDriver(const SIrrlichtCreationParameters& params,
io::IFileSystem* io, CIrrDeviceWayland* device)
{
#ifdef _IRR_COMPILE_WITH_OPENGL_
COpenGLDriver* ogl = new COpenGLDriver(params, io, device);
if (!ogl->initDriver(device))
{
ogl->drop();
ogl = 0;
}
return ogl;
#else
return 0;
#endif // _IRR_COMPILE_WITH_OPENGL_
}
#endif // _IRR_COMPILE_WITH_WAYLAND_DEVICE
// -----------------------------------
// SDL VERSION
// -----------------------------------

View File

@ -13,6 +13,7 @@ namespace irr
{
class CIrrDeviceWin32;
class CIrrDeviceLinux;
class CIrrDeviceWayland;
class CIrrDeviceSDL;
class CIrrDeviceMacOSX;
}
@ -44,6 +45,13 @@ namespace video
bool changeRenderContext(const SExposedVideoData& videoData, CIrrDeviceWin32* device);
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
COpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, CIrrDeviceWayland* device);
//! inits the EGL specific parts of the open gl driver
bool initDriver(CIrrDeviceWayland* device);
bool changeRenderContext(const SExposedVideoData& videoData, CIrrDeviceWayland* device);
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
COpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, CIrrDeviceLinux* device);
//! inits the GLX specific parts of the open gl driver
@ -587,6 +595,9 @@ namespace video
Display* X11Display;
CIrrDeviceLinux *X11Device;
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
CIrrDeviceWayland *wl_device;
#endif
#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
CIrrDeviceMacOSX *OSXDevice;
#endif

View File

@ -37,11 +37,11 @@ CSceneNodeAnimatorCameraFPS::CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cu
if (!keyMapArray || !keyMapSize)
{
// create default key map
KeyMap.push_back(SKeyMap(EKA_MOVE_FORWARD, irr::KEY_UP));
KeyMap.push_back(SKeyMap(EKA_MOVE_BACKWARD, irr::KEY_DOWN));
KeyMap.push_back(SKeyMap(EKA_STRAFE_LEFT, irr::KEY_LEFT));
KeyMap.push_back(SKeyMap(EKA_STRAFE_RIGHT, irr::KEY_RIGHT));
KeyMap.push_back(SKeyMap(EKA_JUMP_UP, irr::KEY_KEY_J));
KeyMap.push_back(SKeyMap(EKA_MOVE_FORWARD, irr::IRR_KEY_UP));
KeyMap.push_back(SKeyMap(EKA_MOVE_BACKWARD, irr::IRR_KEY_DOWN));
KeyMap.push_back(SKeyMap(EKA_STRAFE_LEFT, irr::IRR_KEY_LEFT));
KeyMap.push_back(SKeyMap(EKA_STRAFE_RIGHT, irr::IRR_KEY_RIGHT));
KeyMap.push_back(SKeyMap(EKA_JUMP_UP, irr::IRR_KEY_J));
}
else
{

File diff suppressed because it is too large Load Diff

View File

@ -26,6 +26,10 @@
#include "CIrrDeviceWinCE.h"
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
#include "CIrrDeviceWayland.h"
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
#include "CIrrDeviceLinux.h"
#endif
@ -47,6 +51,8 @@
#include <android/log.h>
#endif
#include <stdio.h>
namespace irr
{
//! stub for calling createDeviceEx
@ -68,53 +74,129 @@ namespace irr
return createDeviceEx(p);
}
static void overrideDeviceType(E_DEVICE_TYPE& device_type)
{
const char* irr_device_type = getenv("IRR_DEVICE_TYPE");
if (irr_device_type == NULL)
return;
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
if (strcmp(irr_device_type, "win32") == 0)
{
device_type = EIDT_WIN32;
}
#endif
#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
if (strcmp(irr_device_type, "osx") == 0)
{
device_type = EIDT_OSX;
}
#endif
#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_
if (strcmp(irr_device_type, "wince") == 0)
{
device_type = EIDT_WINCE;
}
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
if (strcmp(irr_device_type, "wayland") == 0)
{
device_type = EIDT_WAYLAND;
}
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
if (strcmp(irr_device_type, "x11") == 0)
{
device_type = EIDT_X11;
}
#endif
#ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
if (strcmp(irr_device_type, "sdl") == 0)
{
device_type = EIDT_SDL;
}
#endif
#ifdef _IRR_COMPILE_WITH_FB_DEVICE_
if (strcmp(irr_device_type, "framebuffer") == 0)
{
device_type = EIDT_FRAMEBUFFER;
}
#endif
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
if (strcmp(irr_device_type, "android") == 0)
{
device_type = EIDT_ANDROID;
}
#endif
#ifdef _IRR_COMPILE_WITH_CONSOLE_DEVICE_
if (strcmp(irr_device_type, "console") == 0)
{
device_type = EIDT_CONSOLE;
}
#endif
}
extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(const SIrrlichtCreationParameters& params)
{
IrrlichtDevice* dev = 0;
SIrrlichtCreationParameters creation_params = params;
overrideDeviceType(creation_params.DeviceType);
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceWin32(params);
if (creation_params.DeviceType == EIDT_WIN32 || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceWin32(creation_params);
#endif
#ifdef _IRR_COMPILE_WITH_OSX_DEVICE_
if (params.DeviceType == EIDT_OSX || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceMacOSX(params);
if (creation_params.DeviceType == EIDT_OSX || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceMacOSX(creation_params);
#endif
#ifdef _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_
if (params.DeviceType == EIDT_WINCE || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceWinCE(params);
if (creation_params.DeviceType == EIDT_WINCE || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceWinCE(creation_params);
#endif
#ifdef _IRR_COMPILE_WITH_WAYLAND_DEVICE_
if (creation_params.DeviceType == EIDT_WAYLAND || (!dev && creation_params.DeviceType == EIDT_BEST))
{
if (CIrrDeviceWayland::isWaylandDeviceWorking())
{
dev = new CIrrDeviceWayland(creation_params);
}
}
#endif
#ifdef _IRR_COMPILE_WITH_X11_DEVICE_
if (params.DeviceType == EIDT_X11 || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceLinux(params);
if (creation_params.DeviceType == EIDT_X11 || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceLinux(creation_params);
#endif
#ifdef _IRR_COMPILE_WITH_SDL_DEVICE_
if (params.DeviceType == EIDT_SDL || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceSDL(params);
if (creation_params.DeviceType == EIDT_SDL || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceSDL(creation_params);
#endif
#ifdef _IRR_COMPILE_WITH_FB_DEVICE_
if (params.DeviceType == EIDT_FRAMEBUFFER || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceFB(params);
if (creation_params.DeviceType == EIDT_FRAMEBUFFER || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceFB(creation_params);
#endif
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceAndroid(params);
if (creation_params.DeviceType == EIDT_ANDROID || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceAndroid(creation_params);
#endif
#ifdef _IRR_COMPILE_WITH_CONSOLE_DEVICE_
if (params.DeviceType == EIDT_CONSOLE || (!dev && params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceConsole(params);
if (creation_params.DeviceType == EIDT_CONSOLE || (!dev && creation_params.DeviceType == EIDT_BEST))
dev = new CIrrDeviceConsole(creation_params);
#endif
if (dev && !dev->getVideoDriver() && params.DriverType != video::EDT_NULL)
if (dev && !dev->getVideoDriver() && creation_params.DriverType != video::EDT_NULL)
{
dev->closeDevice(); // destroy window
dev->run(); // consume quit message

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht10.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release - Fast FPU|Win32 = Release - Fast FPU|Win32
Release - Fast FPU|x64 = Release - Fast FPU|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Static lib - Debug|Win32 = Static lib - Debug|Win32
Static lib - Debug|x64 = Static lib - Debug|x64
Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32
Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64
Static lib - Release|Win32 = Static lib - Release|Win32
Static lib - Release|x64 = Static lib - Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,50 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht11.0.vcxproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release - Fast FPU|Win32 = Release - Fast FPU|Win32
Release - Fast FPU|x64 = Release - Fast FPU|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Static lib - Debug|Win32 = Static lib - Debug|Win32
Static lib - Debug|x64 = Static lib - Debug|x64
Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32
Static lib - Release - Fast FPU|x64 = Static lib - Release - Fast FPU|x64
Static lib - Release|Win32 = Static lib - Release|Win32
Static lib - Release|x64 = Static lib - Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.ActiveCfg = Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|x64.Build.0 = Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.ActiveCfg = Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|x64.Build.0 = Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.ActiveCfg = Release|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|x64.Build.0 = Release|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.ActiveCfg = Static lib - Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|x64.Build.0 = Static lib - Debug|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.ActiveCfg = Static lib - Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|x64.Build.0 = Static lib - Release - Fast FPU|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.ActiveCfg = Static lib - Release|x64
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|x64.Build.0 = Static lib - Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht8.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
Static lib - Debug|Win32 = Static lib - Debug|Win32
Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32
Static lib - Release|Win32 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht9.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release - Fast FPU|Win32 = Release - Fast FPU|Win32
Release|Win32 = Release|Win32
Static lib - Debug|Win32 = Static lib - Debug|Win32
Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32
Static lib - Release|Win32 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "Irrlicht_mobile6.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I)
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 8.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht_xbox", "Irrlicht_xbox.vcproj", "{2440E601-7438-4C6B-B4AF-BBFE9735875E}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
Profile = Profile
Profile_FastCap = Profile_FastCap
Release = Release
Release_LTCG = Release_LTCG
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Debug.ActiveCfg = Debug|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Debug.Build.0 = Debug|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile.ActiveCfg = Profile|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile.Build.0 = Profile|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile_FastCap.ActiveCfg = Profile_FastCap|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Profile_FastCap.Build.0 = Profile_FastCap|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release.ActiveCfg = Release|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release.Build.0 = Release|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release_LTCG.ActiveCfg = Release_LTCG|Xbox
{2440E601-7438-4C6B-B4AF-BBFE9735875E}.Release_LTCG.Build.0 = Release_LTCG|Xbox
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

Some files were not shown because too many files have changed in this diff Show More