Merge pull request #434 from raysan5/testing_uwp
Integration of UWP support
This commit is contained in:
commit
6f73008007
31 changed files with 6705 additions and 42 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -90,12 +90,17 @@ DerivedData/
|
||||||
# Visual Studio project
|
# Visual Studio project
|
||||||
project/vs2015/*.db
|
project/vs2015/*.db
|
||||||
project/vs2015/*.opendb
|
project/vs2015/*.opendb
|
||||||
|
project/vs2015.UWP/packages
|
||||||
|
project/vs2015.UWP/*.db
|
||||||
!project/vs2015/raylib.sln
|
!project/vs2015/raylib.sln
|
||||||
!project/vs2015/raylib/*.vcxproj
|
!project/vs2015/raylib/*.vcxproj
|
||||||
!project/vs2015/examples/*.vcxproj
|
!project/vs2015/examples/*.vcxproj
|
||||||
!project/vs2017/raylib.sln
|
!project/vs2017/raylib.sln
|
||||||
!project/vs2017/raylib/*.vcxproj
|
!project/vs2017/raylib/*.vcxproj
|
||||||
!project/vs2017/examples/*.vcxproj
|
!project/vs2017/examples/*.vcxproj
|
||||||
|
!project/vs2015.UWP/raylib/*.vcxproj
|
||||||
|
!project/vs2015.UWP/*.sln
|
||||||
|
!project/vs2015.UWP/raylib.App.UWP/*.vcxproj
|
||||||
|
|
||||||
# Web examples
|
# Web examples
|
||||||
docs/examples/web/*.html
|
docs/examples/web/*.html
|
||||||
|
|
|
||||||
558
project/vs2015.UWP/raylib.App.UWP/App.cpp
Normal file
558
project/vs2015.UWP/raylib.App.UWP/App.cpp
Normal file
|
|
@ -0,0 +1,558 @@
|
||||||
|
#include "pch.h"
|
||||||
|
#include "app.h"
|
||||||
|
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
using namespace Windows::ApplicationModel::Core;
|
||||||
|
using namespace Windows::ApplicationModel::Activation;
|
||||||
|
using namespace Windows::UI::Core;
|
||||||
|
using namespace Windows::UI::Input;
|
||||||
|
using namespace Windows::Devices::Input;
|
||||||
|
using namespace Windows::Foundation;
|
||||||
|
using namespace Windows::Foundation::Collections;
|
||||||
|
using namespace Windows::Gaming::Input;
|
||||||
|
using namespace Windows::Graphics::Display;
|
||||||
|
using namespace Microsoft::WRL;
|
||||||
|
using namespace Platform;
|
||||||
|
|
||||||
|
using namespace raylibUWP;
|
||||||
|
|
||||||
|
/*
|
||||||
|
To-do list
|
||||||
|
- Cache reference to our CoreWindow?
|
||||||
|
- Implement gestures
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* INPUT CODE */
|
||||||
|
// Stand-ins for "core.c" variables
|
||||||
|
#define MAX_GAMEPADS 4 // Max number of gamepads supported
|
||||||
|
#define MAX_GAMEPAD_BUTTONS 32 // Max bumber of buttons supported (per gamepad)
|
||||||
|
#define MAX_GAMEPAD_AXIS 8 // Max number of axis supported (per gamepad)
|
||||||
|
static bool gamepadReady[MAX_GAMEPADS] = { false }; // Flag to know if gamepad is ready
|
||||||
|
static float gamepadAxisState[MAX_GAMEPADS][MAX_GAMEPAD_AXIS]; // Gamepad axis state
|
||||||
|
static char previousGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Previous gamepad buttons state
|
||||||
|
static char currentGamepadState[MAX_GAMEPADS][MAX_GAMEPAD_BUTTONS]; // Current gamepad buttons state
|
||||||
|
|
||||||
|
static char previousKeyState[512] = { 0 }; // Contains previous frame keyboard state
|
||||||
|
static char currentKeyState[512] = { 0 }; // Contains current frame keyboard state
|
||||||
|
|
||||||
|
//...
|
||||||
|
static char previousMouseState[3] = { 0 }; // Registers previous mouse button state
|
||||||
|
static char currentMouseState[3] = { 0 }; // Registers current mouse button state
|
||||||
|
static int previousMouseWheelY = 0; // Registers previous mouse wheel variation
|
||||||
|
static int currentMouseWheelY = 0; // Registers current mouse wheel variation
|
||||||
|
|
||||||
|
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
|
||||||
|
static bool cursorHidden = false; // Track if cursor is hidden
|
||||||
|
|
||||||
|
static Vector2 mousePosition;
|
||||||
|
static Vector2 mouseDelta; // NOTE: Added to keep track of mouse movement while the cursor is locked - no equivalent in "core.c"
|
||||||
|
static bool toggleCursorLock;
|
||||||
|
|
||||||
|
CoreCursor ^regularCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); // The "visible arrow" cursor type
|
||||||
|
|
||||||
|
// Helper to process key events
|
||||||
|
void ProcessKeyEvent(Windows::System::VirtualKey key, int action)
|
||||||
|
{
|
||||||
|
using Windows::System::VirtualKey;
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case VirtualKey::Space: currentKeyState[KEY_SPACE] = action; break;
|
||||||
|
case VirtualKey::Escape: currentKeyState[KEY_ESCAPE] = action; break;
|
||||||
|
case VirtualKey::Enter: currentKeyState[KEY_ENTER] = action; break;
|
||||||
|
case VirtualKey::Delete: currentKeyState[KEY_BACKSPACE] = action; break;
|
||||||
|
case VirtualKey::Right: currentKeyState[KEY_RIGHT] = action; break;
|
||||||
|
case VirtualKey::Left: currentKeyState[KEY_LEFT] = action; break;
|
||||||
|
case VirtualKey::Down: currentKeyState[KEY_DOWN] = action; break;
|
||||||
|
case VirtualKey::Up: currentKeyState[KEY_UP] = action; break;
|
||||||
|
case VirtualKey::F1: currentKeyState[KEY_F1] = action; break;
|
||||||
|
case VirtualKey::F2: currentKeyState[KEY_F2] = action; break;
|
||||||
|
case VirtualKey::F3: currentKeyState[KEY_F4] = action; break;
|
||||||
|
case VirtualKey::F4: currentKeyState[KEY_F5] = action; break;
|
||||||
|
case VirtualKey::F5: currentKeyState[KEY_F6] = action; break;
|
||||||
|
case VirtualKey::F6: currentKeyState[KEY_F7] = action; break;
|
||||||
|
case VirtualKey::F7: currentKeyState[KEY_F8] = action; break;
|
||||||
|
case VirtualKey::F8: currentKeyState[KEY_F9] = action; break;
|
||||||
|
case VirtualKey::F9: currentKeyState[KEY_F10] = action; break;
|
||||||
|
case VirtualKey::F10: currentKeyState[KEY_F11] = action; break;
|
||||||
|
case VirtualKey::F11: currentKeyState[KEY_F12] = action; break;
|
||||||
|
case VirtualKey::LeftShift: currentKeyState[KEY_LEFT_SHIFT] = action; break;
|
||||||
|
case VirtualKey::LeftControl: currentKeyState[KEY_LEFT_CONTROL] = action; break;
|
||||||
|
case VirtualKey::LeftMenu: currentKeyState[KEY_LEFT_ALT] = action; break; // NOTE: Potential UWP bug with Alt key: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/9bebfb0a-7637-400e-8bda-e55620091407/unexpected-behavior-in-windowscoreuicorephysicalkeystatusismenukeydown
|
||||||
|
case VirtualKey::RightShift: currentKeyState[KEY_RIGHT_SHIFT] = action; break;
|
||||||
|
case VirtualKey::RightControl: currentKeyState[KEY_RIGHT_CONTROL] = action; break;
|
||||||
|
case VirtualKey::RightMenu: currentKeyState[KEY_RIGHT_ALT] = action; break;
|
||||||
|
case VirtualKey::Number0: currentKeyState[KEY_ZERO] = action; break;
|
||||||
|
case VirtualKey::Number1: currentKeyState[KEY_ONE] = action; break;
|
||||||
|
case VirtualKey::Number2: currentKeyState[KEY_TWO] = action; break;
|
||||||
|
case VirtualKey::Number3: currentKeyState[KEY_THREE] = action; break;
|
||||||
|
case VirtualKey::Number4: currentKeyState[KEY_FOUR] = action; break;
|
||||||
|
case VirtualKey::Number5: currentKeyState[KEY_FIVE] = action; break;
|
||||||
|
case VirtualKey::Number6: currentKeyState[KEY_SIX] = action; break;
|
||||||
|
case VirtualKey::Number7: currentKeyState[KEY_SEVEN] = action; break;
|
||||||
|
case VirtualKey::Number8: currentKeyState[KEY_EIGHT] = action; break;
|
||||||
|
case VirtualKey::Number9: currentKeyState[KEY_NINE] = action; break;
|
||||||
|
case VirtualKey::A: currentKeyState[KEY_A] = action; break;
|
||||||
|
case VirtualKey::B: currentKeyState[KEY_B] = action; break;
|
||||||
|
case VirtualKey::C: currentKeyState[KEY_C] = action; break;
|
||||||
|
case VirtualKey::D: currentKeyState[KEY_D] = action; break;
|
||||||
|
case VirtualKey::E: currentKeyState[KEY_E] = action; break;
|
||||||
|
case VirtualKey::F: currentKeyState[KEY_F] = action; break;
|
||||||
|
case VirtualKey::G: currentKeyState[KEY_G] = action; break;
|
||||||
|
case VirtualKey::H: currentKeyState[KEY_H] = action; break;
|
||||||
|
case VirtualKey::I: currentKeyState[KEY_I] = action; break;
|
||||||
|
case VirtualKey::J: currentKeyState[KEY_J] = action; break;
|
||||||
|
case VirtualKey::K: currentKeyState[KEY_K] = action; break;
|
||||||
|
case VirtualKey::L: currentKeyState[KEY_L] = action; break;
|
||||||
|
case VirtualKey::M: currentKeyState[KEY_M] = action; break;
|
||||||
|
case VirtualKey::N: currentKeyState[KEY_N] = action; break;
|
||||||
|
case VirtualKey::O: currentKeyState[KEY_O] = action; break;
|
||||||
|
case VirtualKey::P: currentKeyState[KEY_P] = action; break;
|
||||||
|
case VirtualKey::Q: currentKeyState[KEY_Q] = action; break;
|
||||||
|
case VirtualKey::R: currentKeyState[KEY_R] = action; break;
|
||||||
|
case VirtualKey::S: currentKeyState[KEY_S] = action; break;
|
||||||
|
case VirtualKey::T: currentKeyState[KEY_T] = action; break;
|
||||||
|
case VirtualKey::U: currentKeyState[KEY_U] = action; break;
|
||||||
|
case VirtualKey::V: currentKeyState[KEY_V] = action; break;
|
||||||
|
case VirtualKey::W: currentKeyState[KEY_W] = action; break;
|
||||||
|
case VirtualKey::X: currentKeyState[KEY_X] = action; break;
|
||||||
|
case VirtualKey::Y: currentKeyState[KEY_Y] = action; break;
|
||||||
|
case VirtualKey::Z: currentKeyState[KEY_Z] = action; break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* CALLBACKS */
|
||||||
|
void App::PointerPressed(CoreWindow^ window, PointerEventArgs^ args)
|
||||||
|
{
|
||||||
|
if (args->CurrentPoint->Properties->IsLeftButtonPressed)
|
||||||
|
{
|
||||||
|
currentMouseState[MOUSE_LEFT_BUTTON] = 1;
|
||||||
|
}
|
||||||
|
if (args->CurrentPoint->Properties->IsRightButtonPressed)
|
||||||
|
{
|
||||||
|
currentMouseState[MOUSE_RIGHT_BUTTON] = 1;
|
||||||
|
}
|
||||||
|
if (args->CurrentPoint->Properties->IsMiddleButtonPressed)
|
||||||
|
{
|
||||||
|
currentMouseState[MOUSE_MIDDLE_BUTTON] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::PointerReleased(CoreWindow ^window, PointerEventArgs^ args)
|
||||||
|
{
|
||||||
|
if (!(args->CurrentPoint->Properties->IsLeftButtonPressed))
|
||||||
|
{
|
||||||
|
currentMouseState[MOUSE_LEFT_BUTTON] = 0;
|
||||||
|
}
|
||||||
|
if (!(args->CurrentPoint->Properties->IsRightButtonPressed))
|
||||||
|
{
|
||||||
|
currentMouseState[MOUSE_RIGHT_BUTTON] = 0;
|
||||||
|
}
|
||||||
|
if (!(args->CurrentPoint->Properties->IsMiddleButtonPressed))
|
||||||
|
{
|
||||||
|
currentMouseState[MOUSE_MIDDLE_BUTTON] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::PointerWheelChanged(CoreWindow ^window, PointerEventArgs^ args)
|
||||||
|
{
|
||||||
|
// TODO: Scale the MouseWheelDelta to match GLFW's mouse wheel sensitivity.
|
||||||
|
currentMouseWheelY += args->CurrentPoint->Properties->MouseWheelDelta;
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args)
|
||||||
|
{
|
||||||
|
mouseDelta.x += args->MouseDelta.X;
|
||||||
|
mouseDelta.y += args->MouseDelta.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::OnKeyDown(CoreWindow ^ sender, KeyEventArgs ^ args)
|
||||||
|
{
|
||||||
|
ProcessKeyEvent(args->VirtualKey, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::OnKeyUp(CoreWindow ^ sender, KeyEventArgs ^ args)
|
||||||
|
{
|
||||||
|
ProcessKeyEvent(args->VirtualKey, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* REIMPLEMENTED FROM CORE.C */
|
||||||
|
// Get one key state
|
||||||
|
static bool GetKeyStatus(int key)
|
||||||
|
{
|
||||||
|
return currentKeyState[key];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show mouse cursor
|
||||||
|
void UWPShowCursor()
|
||||||
|
{
|
||||||
|
CoreWindow::GetForCurrentThread()->PointerCursor = regularCursor;
|
||||||
|
cursorHidden = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hides mouse cursor
|
||||||
|
void UWPHideCursor()
|
||||||
|
{
|
||||||
|
CoreWindow::GetForCurrentThread()->PointerCursor = nullptr;
|
||||||
|
cursorHidden = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set mouse position XY
|
||||||
|
void UWPSetMousePosition(Vector2 position)
|
||||||
|
{
|
||||||
|
CoreWindow ^window = CoreWindow::GetForCurrentThread();
|
||||||
|
Point mousePosScreen = Point(position.x + window->Bounds.X, position.y + window->Bounds.Y);
|
||||||
|
window->PointerPosition = mousePosScreen;
|
||||||
|
mousePosition = position;
|
||||||
|
}
|
||||||
|
// Enables cursor (unlock cursor)
|
||||||
|
void UWPEnableCursor()
|
||||||
|
{
|
||||||
|
UWPShowCursor();
|
||||||
|
UWPSetMousePosition(mousePosition); // The mouse is hidden in the center of the screen - move it to where it should appear
|
||||||
|
toggleCursorLock = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disables cursor (lock cursor)
|
||||||
|
void UWPDisableCursor()
|
||||||
|
{
|
||||||
|
UWPHideCursor();
|
||||||
|
toggleCursorLock = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get one mouse button state
|
||||||
|
static bool UWPGetMouseButtonStatus(int button)
|
||||||
|
{
|
||||||
|
return currentMouseState[button];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Poll (store) all input events
|
||||||
|
void UWP_PollInput()
|
||||||
|
{
|
||||||
|
// Register previous keyboard state
|
||||||
|
for (int k = 0; k < 512; k++) previousKeyState[k] = currentKeyState[k];
|
||||||
|
|
||||||
|
// Process Mouse
|
||||||
|
{
|
||||||
|
// Register previous mouse states
|
||||||
|
for (int i = 0; i < 3; i++) previousMouseState[i] = currentMouseState[i];
|
||||||
|
previousMouseWheelY = currentMouseWheelY;
|
||||||
|
currentMouseWheelY = 0;
|
||||||
|
|
||||||
|
CoreWindow ^window = CoreWindow::GetForCurrentThread();
|
||||||
|
if (toggleCursorLock)
|
||||||
|
{
|
||||||
|
// Track cursor movement delta, recenter it on the client
|
||||||
|
mousePosition.x += mouseDelta.x;
|
||||||
|
mousePosition.y += mouseDelta.y;
|
||||||
|
|
||||||
|
// Why we're not using UWPSetMousePosition here...
|
||||||
|
// UWPSetMousePosition changes the "mousePosition" variable to match where the cursor actually is.
|
||||||
|
// Our cursor is locked to the middle of screen, and we don't want that reflected in "mousePosition"
|
||||||
|
Vector2 centerClient = { (float)(GetScreenWidth() / 2), (float)(GetScreenHeight() / 2) };
|
||||||
|
window->PointerPosition = Point(centerClient.x + window->Bounds.X, centerClient.y + window->Bounds.Y);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Record the cursor's position relative to the client
|
||||||
|
mousePosition.x = window->PointerPosition.X - window->Bounds.X;
|
||||||
|
mousePosition.y = window->PointerPosition.Y - window->Bounds.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
mouseDelta = { 0 ,0 };
|
||||||
|
}
|
||||||
|
|
||||||
|
// Process Gamepads
|
||||||
|
{
|
||||||
|
// Check if gamepads are ready
|
||||||
|
for (int i = 0; i < MAX_GAMEPADS; i++)
|
||||||
|
{
|
||||||
|
// HACK: UWP keeps a contiguous list of gamepads. For the interest of time I'm just doing a 1:1 mapping of
|
||||||
|
// connected gamepads with their spot in the list, but this has serious robustness problems
|
||||||
|
// e.g. player 1, 2, and 3 are playing a game - if player2 disconnects, p3's controller would now be mapped to p2's character since p3 is now second in the list.
|
||||||
|
|
||||||
|
gamepadReady[i] = (i < Gamepad::Gamepads->Size);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get current gamepad state
|
||||||
|
for (int i = 0; i < MAX_GAMEPADS; i++)
|
||||||
|
{
|
||||||
|
if (gamepadReady[i])
|
||||||
|
{
|
||||||
|
// Register previous gamepad states
|
||||||
|
for (int k = 0; k < MAX_GAMEPAD_BUTTONS; k++) previousGamepadState[i][k] = currentGamepadState[i][k];
|
||||||
|
|
||||||
|
// Get current gamepad state
|
||||||
|
auto gamepad = Gamepad::Gamepads->GetAt(i);
|
||||||
|
GamepadReading reading = gamepad->GetCurrentReading();
|
||||||
|
|
||||||
|
// NOTE: Maybe it would be wiser to redefine the gamepad button mappings in "raylib.h" for the UWP platform instead of remapping them manually
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_A] = ((reading.Buttons & GamepadButtons::A) == GamepadButtons::A);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_B] = ((reading.Buttons & GamepadButtons::B) == GamepadButtons::B);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_X] = ((reading.Buttons & GamepadButtons::X) == GamepadButtons::X);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_Y] = ((reading.Buttons & GamepadButtons::Y) == GamepadButtons::Y);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_LB] = ((reading.Buttons & GamepadButtons::LeftShoulder) == GamepadButtons::LeftShoulder);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_RB] = ((reading.Buttons & GamepadButtons::RightShoulder) == GamepadButtons::RightShoulder);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_SELECT] = ((reading.Buttons & GamepadButtons::View) == GamepadButtons::View); // Changed for XB1 Controller
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_START] = ((reading.Buttons & GamepadButtons::Menu) == GamepadButtons::Menu); // Changed for XB1 Controller
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_UP] = ((reading.Buttons & GamepadButtons::DPadUp) == GamepadButtons::DPadUp);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_RIGHT] = ((reading.Buttons & GamepadButtons::DPadRight) == GamepadButtons::DPadRight);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_DOWN] = ((reading.Buttons & GamepadButtons::DPadLeft) == GamepadButtons::DPadDown);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_LEFT] = ((reading.Buttons & GamepadButtons::DPadDown) == GamepadButtons::DPadLeft);
|
||||||
|
currentGamepadState[i][GAMEPAD_XBOX_BUTTON_HOME] = false; // Home button not supported by UWP
|
||||||
|
|
||||||
|
// Get current axis state
|
||||||
|
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LEFT_X] = reading.LeftThumbstickX;
|
||||||
|
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LEFT_Y] = reading.LeftThumbstickY;
|
||||||
|
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RIGHT_X] = reading.RightThumbstickX;
|
||||||
|
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RIGHT_Y] = reading.RightThumbstickY;
|
||||||
|
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_LT] = reading.LeftTrigger;
|
||||||
|
gamepadAxisState[i][GAMEPAD_XBOX_AXIS_RT] = reading.RightTrigger;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// The following functions were ripped from core.c and have *no additional work done on them*
|
||||||
|
// Detect if a key has been pressed once
|
||||||
|
bool UWPIsKeyPressed(int key)
|
||||||
|
{
|
||||||
|
bool pressed = false;
|
||||||
|
|
||||||
|
if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 1))
|
||||||
|
pressed = true;
|
||||||
|
else pressed = false;
|
||||||
|
|
||||||
|
return pressed;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect if a key is being pressed (key held down)
|
||||||
|
bool UWPIsKeyDown(int key)
|
||||||
|
{
|
||||||
|
if (GetKeyStatus(key) == 1) return true;
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect if a key has been released once
|
||||||
|
bool UWPIsKeyReleased(int key)
|
||||||
|
{
|
||||||
|
bool released = false;
|
||||||
|
|
||||||
|
if ((currentKeyState[key] != previousKeyState[key]) && (currentKeyState[key] == 0)) released = true;
|
||||||
|
else released = false;
|
||||||
|
|
||||||
|
return released;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect if a key is NOT being pressed (key not held down)
|
||||||
|
bool UWPIsKeyUp(int key)
|
||||||
|
{
|
||||||
|
if (GetKeyStatus(key) == 0) return true;
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* OTHER CODE */
|
||||||
|
|
||||||
|
// Helper to convert a length in device-independent pixels (DIPs) to a length in physical pixels.
|
||||||
|
inline float ConvertDipsToPixels(float dips, float dpi)
|
||||||
|
{
|
||||||
|
static const float dipsPerInch = 96.0f;
|
||||||
|
return floor(dips * dpi / dipsPerInch + 0.5f); // Round to nearest integer.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implementation of the IFrameworkViewSource interface, necessary to run our app.
|
||||||
|
ref class SimpleApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView()
|
||||||
|
{
|
||||||
|
return ref new App();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// The main function creates an IFrameworkViewSource for our app, and runs the app.
|
||||||
|
[Platform::MTAThread]
|
||||||
|
int main(Platform::Array<Platform::String^>^)
|
||||||
|
{
|
||||||
|
auto simpleApplicationSource = ref new SimpleApplicationSource();
|
||||||
|
CoreApplication::Run(simpleApplicationSource);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
App::App() :
|
||||||
|
mWindowClosed(false),
|
||||||
|
mWindowVisible(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// The first method called when the IFrameworkView is being created.
|
||||||
|
void App::Initialize(CoreApplicationView^ applicationView)
|
||||||
|
{
|
||||||
|
// Register event handlers for app lifecycle. This example includes Activated, so that we
|
||||||
|
// can make the CoreWindow active and start rendering on the window.
|
||||||
|
applicationView->Activated += ref new TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &App::OnActivated);
|
||||||
|
|
||||||
|
// Logic for other event handlers could go here.
|
||||||
|
// Information about the Suspending and Resuming event handlers can be found here:
|
||||||
|
// http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh994930.aspx
|
||||||
|
|
||||||
|
CoreApplication::Resuming += ref new EventHandler<Platform::Object^>(this, &App::OnResuming);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called when the CoreWindow object is created (or re-created).
|
||||||
|
void App::SetWindow(CoreWindow^ window)
|
||||||
|
{
|
||||||
|
window->SizeChanged += ref new TypedEventHandler<CoreWindow^, WindowSizeChangedEventArgs^>(this, &App::OnWindowSizeChanged);
|
||||||
|
window->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
|
||||||
|
window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
|
||||||
|
|
||||||
|
window->PointerPressed += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::PointerPressed);
|
||||||
|
window->PointerReleased += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::PointerReleased);
|
||||||
|
window->PointerWheelChanged += ref new TypedEventHandler<CoreWindow^, PointerEventArgs^>(this, &App::PointerWheelChanged);
|
||||||
|
window->KeyDown += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &App::OnKeyDown);
|
||||||
|
window->KeyUp += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(this, &App::OnKeyUp);
|
||||||
|
|
||||||
|
Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += ref new TypedEventHandler<MouseDevice^, MouseEventArgs^>(this, &App::MouseMoved);
|
||||||
|
|
||||||
|
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
|
||||||
|
currentDisplayInformation->DpiChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnDpiChanged);
|
||||||
|
currentDisplayInformation->OrientationChanged += ref new TypedEventHandler<DisplayInformation^, Object^>(this, &App::OnOrientationChanged);
|
||||||
|
|
||||||
|
// The CoreWindow has been created, so EGL can be initialized.
|
||||||
|
InitWindow(800, 450, (EGLNativeWindowType)window);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Initializes scene resources
|
||||||
|
void App::Load(Platform::String^ entryPoint)
|
||||||
|
{
|
||||||
|
// InitWindow() --> rlglInit()
|
||||||
|
}
|
||||||
|
|
||||||
|
static int posX = 100;
|
||||||
|
static int posY = 100;
|
||||||
|
static int time = 0;
|
||||||
|
// This method is called after the window becomes active.
|
||||||
|
void App::Run()
|
||||||
|
{
|
||||||
|
while (!mWindowClosed)
|
||||||
|
{
|
||||||
|
if (mWindowVisible)
|
||||||
|
{
|
||||||
|
// Draw
|
||||||
|
BeginDrawing();
|
||||||
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
|
||||||
|
posX += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_X] * 5;
|
||||||
|
posY += gamepadAxisState[GAMEPAD_PLAYER1][GAMEPAD_XBOX_AXIS_LEFT_Y] * -5;
|
||||||
|
DrawRectangle(posX, posY, 400, 100, RED);
|
||||||
|
|
||||||
|
DrawLine(0, 0, GetScreenWidth(), GetScreenHeight(), BLUE);
|
||||||
|
|
||||||
|
DrawCircle(mousePosition.x, mousePosition.y, 40, BLUE);
|
||||||
|
|
||||||
|
if(UWPIsKeyDown(KEY_S))
|
||||||
|
{
|
||||||
|
DrawCircle(100, 100, 100, BLUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(UWPIsKeyPressed(KEY_A))
|
||||||
|
{
|
||||||
|
posX -= 50;
|
||||||
|
UWPEnableCursor();
|
||||||
|
}
|
||||||
|
if (UWPIsKeyPressed(KEY_D))
|
||||||
|
{
|
||||||
|
posX += 50;
|
||||||
|
|
||||||
|
UWPDisableCursor();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(currentKeyState[KEY_LEFT_ALT])
|
||||||
|
DrawRectangle(250, 250, 20, 20, BLACK);
|
||||||
|
if (currentKeyState[KEY_BACKSPACE])
|
||||||
|
DrawRectangle(280, 250, 20, 20, BLACK);
|
||||||
|
|
||||||
|
if (currentMouseState[MOUSE_LEFT_BUTTON])
|
||||||
|
DrawRectangle(280, 250, 20, 20, BLACK);
|
||||||
|
|
||||||
|
static int pos = 0;
|
||||||
|
pos -= currentMouseWheelY;
|
||||||
|
DrawRectangle(280, pos + 50, 20, 20, BLACK);
|
||||||
|
|
||||||
|
DrawRectangle(250, 280 + (time++ % 60), 10, 10, PURPLE);
|
||||||
|
|
||||||
|
EndDrawing();
|
||||||
|
UWP_PollInput();
|
||||||
|
|
||||||
|
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
|
||||||
|
// class is torn down while the app is in the foreground.
|
||||||
|
void App::Uninitialize()
|
||||||
|
{
|
||||||
|
// CloseWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Application lifecycle event handler.
|
||||||
|
void App::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
|
||||||
|
{
|
||||||
|
// Run() won't start until the CoreWindow is activated.
|
||||||
|
CoreWindow::GetForCurrentThread()->Activate();
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::OnResuming(Object^ sender, Object^ args)
|
||||||
|
{
|
||||||
|
// Restore any data or state that was unloaded on suspend. By default, data
|
||||||
|
// and state are persisted when resuming from suspend. Note that this event
|
||||||
|
// does not occur if the app was previously terminated.
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::OnWindowSizeChanged(CoreWindow^ sender, WindowSizeChangedEventArgs^ args)
|
||||||
|
{
|
||||||
|
// TODO: Update window and render area size
|
||||||
|
//m_deviceResources->SetLogicalSize(Size(sender->Bounds.Width, sender->Bounds.Height));
|
||||||
|
//m_main->UpdateForWindowSizeChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Window event handlers.
|
||||||
|
void App::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
|
||||||
|
{
|
||||||
|
mWindowVisible = args->Visible;
|
||||||
|
|
||||||
|
// raylib core has the variable windowMinimized to register state,
|
||||||
|
// it should be modifyed by this event...
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
|
||||||
|
{
|
||||||
|
mWindowClosed = true;
|
||||||
|
|
||||||
|
// raylib core has the variable windowShouldClose to register state,
|
||||||
|
// it should be modifyed by this event...
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::OnDpiChanged(DisplayInformation^ sender, Object^ args)
|
||||||
|
{
|
||||||
|
//m_deviceResources->SetDpi(sender->LogicalDpi);
|
||||||
|
//m_main->UpdateForWindowSizeChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
void App::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
|
||||||
|
{
|
||||||
|
//m_deviceResources->SetCurrentOrientation(sender->CurrentOrientation);
|
||||||
|
//m_main->UpdateForWindowSizeChange();
|
||||||
|
}
|
||||||
49
project/vs2015.UWP/raylib.App.UWP/App.h
Normal file
49
project/vs2015.UWP/raylib.App.UWP/App.h
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
|
namespace raylibUWP
|
||||||
|
{
|
||||||
|
ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
App();
|
||||||
|
|
||||||
|
// IFrameworkView Methods.
|
||||||
|
virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
|
||||||
|
virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
|
||||||
|
virtual void Load(Platform::String^ entryPoint);
|
||||||
|
virtual void Run();
|
||||||
|
virtual void Uninitialize();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Application lifecycle event handlers.
|
||||||
|
void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
|
||||||
|
void OnResuming(Platform::Object^ sender, Platform::Object^ args);
|
||||||
|
|
||||||
|
// Window event handlers.
|
||||||
|
void OnWindowSizeChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ args);
|
||||||
|
void OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args);
|
||||||
|
void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
|
||||||
|
|
||||||
|
// DisplayInformation event handlers.
|
||||||
|
void OnDpiChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
||||||
|
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
|
||||||
|
|
||||||
|
// Input event handlers
|
||||||
|
void PointerPressed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::PointerEventArgs^ args);
|
||||||
|
void PointerReleased(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args);
|
||||||
|
void PointerWheelChanged(Windows::UI::Core::CoreWindow ^sender, Windows::UI::Core::PointerEventArgs^ args);
|
||||||
|
void MouseMoved(Windows::Devices::Input::MouseDevice^ mouseDevice, Windows::Devices::Input::MouseEventArgs^ args);
|
||||||
|
void OnKeyDown(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args);
|
||||||
|
void OnKeyUp(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::KeyEventArgs ^ args);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
bool mWindowClosed;
|
||||||
|
bool mWindowVisible;
|
||||||
|
};
|
||||||
|
}
|
||||||
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png
Normal file
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/Logo.scale-100.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 801 B |
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png
Normal file
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/SmallLogo.scale-100.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 329 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png
Normal file
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/StoreLogo.scale-100.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 429 B |
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png
Normal file
BIN
project/vs2015.UWP/raylib.App.UWP/Assets/WideLogo.scale-100.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
48
project/vs2015.UWP/raylib.App.UWP/Package.appxmanifest
Normal file
48
project/vs2015.UWP/raylib.App.UWP/Package.appxmanifest
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<Package
|
||||||
|
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
IgnorableNamespaces="uap mp">
|
||||||
|
|
||||||
|
<Identity
|
||||||
|
Name="b842558c-c034-4e4b-9457-a286f26e83cc"
|
||||||
|
Publisher="CN=Alumno"
|
||||||
|
Version="1.0.0.0" />
|
||||||
|
|
||||||
|
<mp:PhoneIdentity PhoneProductId="56d2ca94-c361-4e9f-9a33-bacd751552fa" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
|
<Properties>
|
||||||
|
<DisplayName>UWP_OpenGLES2</DisplayName>
|
||||||
|
<PublisherDisplayName>Alumno</PublisherDisplayName>
|
||||||
|
<Logo>Assets\StoreLogo.png</Logo>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Dependencies>
|
||||||
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||||
|
</Dependencies>
|
||||||
|
|
||||||
|
<Resources>
|
||||||
|
<Resource Language="x-generate"/>
|
||||||
|
</Resources>
|
||||||
|
|
||||||
|
<Applications>
|
||||||
|
<Application Id="App"
|
||||||
|
Executable="$targetnametoken$.exe"
|
||||||
|
EntryPoint="UWP_OpenGLES2_WindowsUniversal_Application.App">
|
||||||
|
<uap:VisualElements
|
||||||
|
DisplayName="UWP_OpenGLES2"
|
||||||
|
Square150x150Logo="Assets\Logo.png"
|
||||||
|
Square44x44Logo="Assets\SmallLogo.png"
|
||||||
|
Description="UWP_OpenGLES2"
|
||||||
|
BackgroundColor="#464646">
|
||||||
|
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||||
|
</uap:VisualElements>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
|
||||||
|
<Capabilities>
|
||||||
|
<Capability Name="internetClient" />
|
||||||
|
</Capabilities>
|
||||||
|
</Package>
|
||||||
4
project/vs2015.UWP/raylib.App.UWP/packages.config
Normal file
4
project/vs2015.UWP/raylib.App.UWP/packages.config
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="ANGLE.WindowsStore" version="2.1.13" targetFramework="native" />
|
||||||
|
</packages>
|
||||||
1
project/vs2015.UWP/raylib.App.UWP/pch.cpp
Normal file
1
project/vs2015.UWP/raylib.App.UWP/pch.cpp
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
#include "pch.h"
|
||||||
16
project/vs2015.UWP/raylib.App.UWP/pch.h
Normal file
16
project/vs2015.UWP/raylib.App.UWP/pch.h
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <wrl.h>
|
||||||
|
|
||||||
|
// OpenGL ES includes
|
||||||
|
#include <GLES2/gl2.h>
|
||||||
|
#include <GLES2/gl2ext.h>
|
||||||
|
|
||||||
|
// EGL includes
|
||||||
|
#include <EGL/egl.h>
|
||||||
|
#include <EGL/eglext.h>
|
||||||
|
#include <EGL/eglplatform.h>
|
||||||
|
|
||||||
|
// ANGLE include for Windows Store
|
||||||
|
#include <angle_windowsstore.h>
|
||||||
Binary file not shown.
42
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.filters
Normal file
42
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.filters
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="App.cpp" />
|
||||||
|
<ClCompile Include="pch.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="App.h" />
|
||||||
|
<ClInclude Include="pch.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="Assets\SmallLogo.scale-100.png">
|
||||||
|
<Filter>Assets</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="Assets\SplashScreen.scale-100.png">
|
||||||
|
<Filter>Assets</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="Assets\StoreLogo.scale-100.png">
|
||||||
|
<Filter>Assets</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="Assets\WideLogo.scale-100.png">
|
||||||
|
<Filter>Assets</Filter>
|
||||||
|
</Image>
|
||||||
|
<Image Include="Assets\Logo.scale-100.png">
|
||||||
|
<Filter>Assets</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AppxManifest Include="Package.appxmanifest" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="UWP_OpenGLES2_TemporaryKey.pfx" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="$(angle-BinPath)\libEGL.dll" />
|
||||||
|
<None Include="$(angle-BinPath)\libGLESv2.dll" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Assets">
|
||||||
|
<UniqueIdentifier>{d16954bb-de54-472b-ac10-ecab10d3fdc8}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
4
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.user
Normal file
4
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.user
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
||||||
145
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj
Normal file
145
project/vs2015.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj
Normal file
|
|
@ -0,0 +1,145 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|ARM">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|ARM">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{b842558c-c034-4e4b-9457-a286f26e83cc}</ProjectGuid>
|
||||||
|
<RootNamespace>raylibUWP</RootNamespace>
|
||||||
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
|
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||||
|
<AppContainerApplication>true</AppContainerApplication>
|
||||||
|
<ApplicationType>Windows Store</ApplicationType>
|
||||||
|
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
|
||||||
|
<WindowsTargetPlatformMinVersion>10.0.10586.0</WindowsTargetPlatformMinVersion>
|
||||||
|
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||||
|
<ProjectName>raylib.App.UWP</ProjectName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<PackageCertificateKeyFile>raylib.App.UWP.TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
|
<IncludePath>C:\Users\Sam\Documents\GitHub\raylib\release\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>C:\Users\Sam\Documents\GitHub\raylib\project\vs2015.UWP\raylib\Debug;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\arm;$(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>$(SolutionDir)raylib\Debug;%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>mincore.lib;raylib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
<AdditionalLibraryDirectories>C:\Users\Sam\Documents\GitHub\raylib\project\vs2015.UWP\x64\Debug;C:\Users\Alumno\Downloads\angle\UWP_OpenGLES2\raylib;%(AdditionalLibraryDirectories);$(VCInstallDir)\lib\store\amd64;$(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</ClCompile>
|
||||||
|
<ProjectReference>
|
||||||
|
<LinkLibraryDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkLibraryDependencies>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<CompileAs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Default</CompileAs>
|
||||||
|
<OmitDefaultLibName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</OmitDefaultLibName>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="Assets\Logo.scale-100.png" />
|
||||||
|
<Image Include="Assets\SmallLogo.scale-100.png" />
|
||||||
|
<Image Include="Assets\StoreLogo.scale-100.png" />
|
||||||
|
<Image Include="Assets\SplashScreen.scale-100.png" />
|
||||||
|
<Image Include="Assets\WideLogo.scale-100.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="App.h" />
|
||||||
|
<ClInclude Include="pch.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="App.cpp" />
|
||||||
|
<ClCompile Include="pch.cpp">
|
||||||
|
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AppxManifest Include="Package.appxmanifest">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</AppxManifest>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
<None Include="raylib.App.UWP.TemporaryKey.pfx" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
<Import Project="..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets" Condition="Exists('..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets')" />
|
||||||
|
</ImportGroup>
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\ANGLE.WindowsStore.2.1.13\build\native\ANGLE.WindowsStore.targets'))" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
50
project/vs2015.UWP/raylib.UWP.sln
Normal file
50
project/vs2015.UWP/raylib.UWP.sln
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 14
|
||||||
|
VisualStudioVersion = 14.0.25420.1
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib.App.UWP", "raylib.App.UWP\raylib.App.UWP.vcxproj", "{B842558C-C034-4E4B-9457-A286F26E83CC}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raylib", "raylib\raylib.vcxproj", "{E89D61AC-55DE-4482-AFD4-DF7242EBC859}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|ARM = Debug|ARM
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|ARM = Release|ARM
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x64.Deploy.0 = Debug|x64
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Debug|x86.Deploy.0 = Debug|Win32
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|ARM.Deploy.0 = Release|ARM
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Build.0 = Release|x64
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x64.Deploy.0 = Release|x64
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{B842558C-C034-4E4B-9457-A286F26E83CC}.Release|x86.Deploy.0 = Release|Win32
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|ARM.ActiveCfg = Debug|Win32
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|ARM.ActiveCfg = Release|Win32
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x64.ActiveCfg = Release|Win32
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{E89D61AC-55DE-4482-AFD4-DF7242EBC859}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
186
project/vs2015.UWP/raylib/raylib.vcxproj
Normal file
186
project/vs2015.UWP/raylib/raylib.vcxproj
Normal file
|
|
@ -0,0 +1,186 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{E89D61AC-55DE-4482-AFD4-DF7242EBC859}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>raylib</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<OutDir>$(SolutionDir)$(ProjectName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(SolutionDir)$(ProjectName)\$(Configuration)\temp</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\include\ANGLE</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
</Link>
|
||||||
|
<Lib>
|
||||||
|
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\release\include;$(SolutionDir)..\..\src\external\include\ANGLE</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
</Link>
|
||||||
|
<Lib>
|
||||||
|
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
|
</Lib>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src\external\include\ANGLE;$(SolutionDir)..\..\release\include</AdditionalIncludeDirectories>
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions);GRAPHICS_API_OPENGL_ES2;PLATFORM_UWP</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(SolutionDir)..\..\src\external\include\ANGLE;$(SolutionDir)..\..\release\include</AdditionalIncludeDirectories>
|
||||||
|
<CompileAs>CompileAsC</CompileAs>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Text Include="ReadMe.txt" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\..\src\audio.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\core.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\external\stb_vorbis.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\models.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\rlgl.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\shapes.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\text.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\textures.c" />
|
||||||
|
<ClCompile Include="..\..\..\src\utils.c" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\..\src\camera.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\glad.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\jar_mod.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\jar_xm.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\stb_image.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\stb_image_resize.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\stb_image_write.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\stb_rect_pack.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\stb_truetype.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\external\stb_vorbis.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\gestures.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\raylib.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\raymath.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\rlgl.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\shader_distortion.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\shader_standard.h" />
|
||||||
|
<ClInclude Include="..\..\..\src\utils.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
222
src/core.c
222
src/core.c
|
|
@ -3,14 +3,14 @@
|
||||||
* raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms
|
* raylib.core - Basic functions to manage windows, OpenGL context and input on multiple platforms
|
||||||
*
|
*
|
||||||
* PLATFORMS SUPPORTED:
|
* PLATFORMS SUPPORTED:
|
||||||
* PLATFORM_DESKTOP: Windows (Win32, Win64)
|
* - PLATFORM_DESKTOP: Windows (Win32, Win64)
|
||||||
* PLATFORM_DESKTOP: Linux (32 and 64 bit)
|
* - PLATFORM_DESKTOP: Linux (X11 desktop mode)
|
||||||
* PLATFORM_DESKTOP: OSX/macOS
|
* - PLATFORM_DESKTOP: FreeBSD (X11 desktop)
|
||||||
* PLATFORM_DESKTOP: FreeBSD
|
* - PLATFORM_DESKTOP: OSX/macOS
|
||||||
* PLATFORM_ANDROID: Android (ARM, ARM64)
|
* - PLATFORM_ANDROID: Android 4.0 (ARM, ARM64)
|
||||||
* PLATFORM_RPI: Raspberry Pi (Raspbian)
|
* - PLATFORM_RPI: Raspberry Pi 0,1,2,3 (Raspbian)
|
||||||
* PLATFORM_WEB: HTML5 (Chrome, Firefox)
|
* - PLATFORM_WEB: HTML5 with asm.js (Chrome, Firefox)
|
||||||
* PLATFORM_UWP: Universal Windows Platform
|
* - PLATFORM_UWP: Windows 10 App, Windows Phone, Xbox One
|
||||||
*
|
*
|
||||||
* CONFIGURATION:
|
* CONFIGURATION:
|
||||||
*
|
*
|
||||||
|
|
@ -30,6 +30,10 @@
|
||||||
* Windowing and input system configured for HTML5 (run on browser), code converted from C to asm.js
|
* Windowing and input system configured for HTML5 (run on browser), code converted from C to asm.js
|
||||||
* using emscripten compiler. OpenGL ES 2.0 required for direct translation to WebGL equivalent code.
|
* using emscripten compiler. OpenGL ES 2.0 required for direct translation to WebGL equivalent code.
|
||||||
*
|
*
|
||||||
|
* #define PLATFORM_UWP
|
||||||
|
* Universal Windows Platform support, using OpenGL ES 2.0 through ANGLE on multiple Windows platforms,
|
||||||
|
* including Windows 10 App, Windows Phone and Xbox One platforms.
|
||||||
|
*
|
||||||
* #define SUPPORT_DEFAULT_FONT (default)
|
* #define SUPPORT_DEFAULT_FONT (default)
|
||||||
* Default font is loaded on window initialization to be available for the user to render simple text.
|
* Default font is loaded on window initialization to be available for the user to render simple text.
|
||||||
* NOTE: If enabled, uses external module functions to load default raylib font (module: text)
|
* NOTE: If enabled, uses external module functions to load default raylib font (module: text)
|
||||||
|
|
@ -185,6 +189,12 @@
|
||||||
#include "GLES2/gl2.h" // Khronos OpenGL ES 2.0 library
|
#include "GLES2/gl2.h" // Khronos OpenGL ES 2.0 library
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(PLATFORM_UWP)
|
||||||
|
#include "EGL/egl.h" // Khronos EGL library - Native platform display device control functions
|
||||||
|
#include "EGL/eglext.h" // Khronos EGL library - Extensions
|
||||||
|
#include "GLES2/gl2.h" // Khronos OpenGL ES 2.0 library
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(PLATFORM_WEB)
|
#if defined(PLATFORM_WEB)
|
||||||
#include <emscripten/emscripten.h>
|
#include <emscripten/emscripten.h>
|
||||||
#include <emscripten/html5.h>
|
#include <emscripten/html5.h>
|
||||||
|
|
@ -224,9 +234,10 @@
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||||
static GLFWwindow *window; // Native window (graphic device)
|
static GLFWwindow *window; // Native window (graphic device)
|
||||||
static bool windowMinimized = false;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool windowMinimized = false;
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID)
|
#if defined(PLATFORM_ANDROID)
|
||||||
static struct android_app *app; // Android activity
|
static struct android_app *app; // Android activity
|
||||||
static struct android_poll_source *source; // Android events polling source
|
static struct android_poll_source *source; // Android events polling source
|
||||||
|
|
@ -262,13 +273,17 @@ static pthread_t gamepadThreadId; // Gamepad reading thread id
|
||||||
static char gamepadName[64]; // Gamepad name holder
|
static char gamepadName[64]; // Gamepad name holder
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
|
||||||
static EGLDisplay display; // Native display device (physical screen connection)
|
static EGLDisplay display; // Native display device (physical screen connection)
|
||||||
static EGLSurface surface; // Surface to draw on, framebuffers (connected to context)
|
static EGLSurface surface; // Surface to draw on, framebuffers (connected to context)
|
||||||
static EGLContext context; // Graphic context, mode in which drawing can be done
|
static EGLContext context; // Graphic context, mode in which drawing can be done
|
||||||
static EGLConfig config; // Graphic config
|
static EGLConfig config; // Graphic config
|
||||||
static uint64_t baseTime; // Base time measure for hi-res timer
|
static uint64_t baseTime; // Base time measure for hi-res timer
|
||||||
static bool windowShouldClose = false; // Flag to set window for closing
|
static bool windowShouldClose = false; // Flag to set window for closing
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PLATFORM_UWP)
|
||||||
|
static EGLNativeWindowType uwpWindow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Display size-related data
|
// Display size-related data
|
||||||
|
|
@ -280,10 +295,9 @@ static int renderOffsetY = 0; // Offset Y from render area (must b
|
||||||
static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP)
|
static bool fullscreen = false; // Fullscreen mode (useful only for PLATFORM_DESKTOP)
|
||||||
static Matrix downscaleView; // Matrix to downscale view (in case screen size bigger than display size)
|
static Matrix downscaleView; // Matrix to downscale view (in case screen size bigger than display size)
|
||||||
|
|
||||||
static bool cursorHidden = false; // Track if cursor is hidden
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP)
|
||||||
|
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB)
|
|
||||||
static const char *windowTitle = NULL; // Window text title...
|
static const char *windowTitle = NULL; // Window text title...
|
||||||
|
static bool cursorHidden = false; // Track if cursor is hidden
|
||||||
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
|
static bool cursorOnScreen = false; // Tracks if cursor is inside client area
|
||||||
static int screenshotCounter = 0; // Screenshots counter
|
static int screenshotCounter = 0; // Screenshots counter
|
||||||
|
|
||||||
|
|
@ -400,6 +414,10 @@ static void InitGamepad(void); // Init raw gamepad inpu
|
||||||
static void *GamepadThread(void *arg); // Mouse reading thread
|
static void *GamepadThread(void *arg); // Mouse reading thread
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(PLATFORM_UWP)
|
||||||
|
// Define functions required to manage inputs
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
// NOTE: We include Sleep() function signature here to avoid windows.h inclusion
|
// NOTE: We include Sleep() function signature here to avoid windows.h inclusion
|
||||||
void __stdcall Sleep(unsigned long msTimeout); // Required for Wait()
|
void __stdcall Sleep(unsigned long msTimeout); // Required for Wait()
|
||||||
|
|
@ -408,15 +426,20 @@ static void *GamepadThread(void *arg); // Mouse reading thread
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Module Functions Definition - Window and OpenGL Context Functions
|
// Module Functions Definition - Window and OpenGL Context Functions
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP)
|
||||||
// Initialize window and OpenGL context
|
// Initialize window and OpenGL context
|
||||||
// NOTE: data parameter could be used to pass any kind of required data to the initialization
|
// NOTE: data parameter could be used to pass any kind of required data to the initialization
|
||||||
void InitWindow(int width, int height, void *data)
|
void InitWindow(int width, int height, void *data)
|
||||||
{
|
{
|
||||||
TraceLog(LOG_INFO, "Initializing raylib (v1.9-dev)");
|
TraceLog(LOG_INFO, "Initializing raylib (v1.9-dev)");
|
||||||
|
|
||||||
// Input data is window title char data
|
#if defined(PLATFORM_DESKTOP)
|
||||||
windowTitle = (char *)data;
|
windowTitle = (char *)data;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PLATFORM_UWP)
|
||||||
|
uwpWindow = (EGLNativeWindowType)data;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Init graphics device (display device and OpenGL context)
|
// Init graphics device (display device and OpenGL context)
|
||||||
InitGraphicsDevice(width, height);
|
InitGraphicsDevice(width, height);
|
||||||
|
|
@ -561,7 +584,7 @@ void CloseWindow(void)
|
||||||
timeEndPeriod(1); // Restore time period
|
timeEndPeriod(1); // Restore time period
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
|
||||||
// Close surface, context and display
|
// Close surface, context and display
|
||||||
if (display != EGL_NO_DISPLAY)
|
if (display != EGL_NO_DISPLAY)
|
||||||
{
|
{
|
||||||
|
|
@ -609,7 +632,7 @@ bool WindowShouldClose(void)
|
||||||
return (glfwWindowShouldClose(window));
|
return (glfwWindowShouldClose(window));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
|
||||||
return windowShouldClose;
|
return windowShouldClose;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
@ -617,7 +640,7 @@ bool WindowShouldClose(void)
|
||||||
// Check if window has been minimized (or lost focus)
|
// Check if window has been minimized (or lost focus)
|
||||||
bool IsWindowMinimized(void)
|
bool IsWindowMinimized(void)
|
||||||
{
|
{
|
||||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) || defined(PLATFORM_UWP)
|
||||||
return windowMinimized;
|
return windowMinimized;
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -684,7 +707,7 @@ void SetWindowMonitor(int monitor)
|
||||||
|
|
||||||
if ((monitor >= 0) && (monitor < monitorCount))
|
if ((monitor >= 0) && (monitor < monitorCount))
|
||||||
{
|
{
|
||||||
glfwSetWindowMonitor(window, monitors[monitor], 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE);
|
//glfwSetWindowMonitor(window, monitors[monitor], 0, 0, screenWidth, screenHeight, GLFW_DONT_CARE);
|
||||||
TraceLog(LOG_INFO, "Selected fullscreen monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor]));
|
TraceLog(LOG_INFO, "Selected fullscreen monitor: [%i] %s", monitor, glfwGetMonitorName(monitors[monitor]));
|
||||||
}
|
}
|
||||||
else TraceLog(LOG_WARNING, "Selected monitor not found");
|
else TraceLog(LOG_WARNING, "Selected monitor not found");
|
||||||
|
|
@ -1860,7 +1883,7 @@ static void InitGraphicsDevice(int width, int height)
|
||||||
}
|
}
|
||||||
#endif // defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
#endif // defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
|
||||||
fullscreen = true;
|
fullscreen = true;
|
||||||
|
|
||||||
// Screen size security check
|
// Screen size security check
|
||||||
|
|
@ -1903,12 +1926,151 @@ static void InitGraphicsDevice(int width, int height)
|
||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
EGLint contextAttribs[] =
|
const EGLint contextAttribs[] =
|
||||||
{
|
{
|
||||||
EGL_CONTEXT_CLIENT_VERSION, 2,
|
EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||||
EGL_NONE
|
EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if defined(PLATFORM_UWP)
|
||||||
|
const EGLint surfaceAttributes[] =
|
||||||
|
{
|
||||||
|
// EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER is part of the same optimization as EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER (see above).
|
||||||
|
// If you have compilation issues with it then please update your Visual Studio templates.
|
||||||
|
EGL_ANGLE_SURFACE_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||||
|
EGL_NONE
|
||||||
|
};
|
||||||
|
|
||||||
|
const EGLint defaultDisplayAttributes[] =
|
||||||
|
{
|
||||||
|
// These are the default display attributes, used to request ANGLE's D3D11 renderer.
|
||||||
|
// eglInitialize will only succeed with these attributes if the hardware supports D3D11 Feature Level 10_0+.
|
||||||
|
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||||
|
|
||||||
|
// EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is an optimization that can have large performance benefits on mobile devices.
|
||||||
|
// Its syntax is subject to change, though. Please update your Visual Studio templates if you experience compilation issues with it.
|
||||||
|
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||||
|
|
||||||
|
// EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE is an option that enables ANGLE to automatically call
|
||||||
|
// the IDXGIDevice3::Trim method on behalf of the application when it gets suspended.
|
||||||
|
// Calling IDXGIDevice3::Trim when an application is suspended is a Windows Store application certification requirement.
|
||||||
|
EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
|
||||||
|
EGL_NONE,
|
||||||
|
};
|
||||||
|
|
||||||
|
const EGLint fl9_3DisplayAttributes[] =
|
||||||
|
{
|
||||||
|
// These can be used to request ANGLE's D3D11 renderer, with D3D11 Feature Level 9_3.
|
||||||
|
// These attributes are used if the call to eglInitialize fails with the default display attributes.
|
||||||
|
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||||
|
EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
|
||||||
|
EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
|
||||||
|
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||||
|
EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
|
||||||
|
EGL_NONE,
|
||||||
|
};
|
||||||
|
|
||||||
|
const EGLint warpDisplayAttributes[] =
|
||||||
|
{
|
||||||
|
// These attributes can be used to request D3D11 WARP.
|
||||||
|
// They are used if eglInitialize fails with both the default display attributes and the 9_3 display attributes.
|
||||||
|
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
|
||||||
|
EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE,
|
||||||
|
EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
|
||||||
|
EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
|
||||||
|
EGL_NONE,
|
||||||
|
};
|
||||||
|
|
||||||
|
EGLConfig config = NULL;
|
||||||
|
|
||||||
|
// eglGetPlatformDisplayEXT is an alternative to eglGetDisplay. It allows us to pass in display attributes, used to configure D3D11.
|
||||||
|
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)(eglGetProcAddress("eglGetPlatformDisplayEXT"));
|
||||||
|
if (!eglGetPlatformDisplayEXT) TraceLog(LOG_ERROR, "Failed to get function eglGetPlatformDisplayEXT");
|
||||||
|
|
||||||
|
//
|
||||||
|
// To initialize the display, we make three sets of calls to eglGetPlatformDisplayEXT and eglInitialize, with varying
|
||||||
|
// parameters passed to eglGetPlatformDisplayEXT:
|
||||||
|
// 1) The first calls uses "defaultDisplayAttributes" as a parameter. This corresponds to D3D11 Feature Level 10_0+.
|
||||||
|
// 2) If eglInitialize fails for step 1 (e.g. because 10_0+ isn't supported by the default GPU), then we try again
|
||||||
|
// using "fl9_3DisplayAttributes". This corresponds to D3D11 Feature Level 9_3.
|
||||||
|
// 3) If eglInitialize fails for step 2 (e.g. because 9_3+ isn't supported by the default GPU), then we try again
|
||||||
|
// using "warpDisplayAttributes". This corresponds to D3D11 Feature Level 11_0 on WARP, a D3D11 software rasterizer.
|
||||||
|
//
|
||||||
|
|
||||||
|
// This tries to initialize EGL to D3D11 Feature Level 10_0+. See above comment for details.
|
||||||
|
display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes);
|
||||||
|
if (display == EGL_NO_DISPLAY) TraceLog(LOG_ERROR, "Failed to get EGL display");
|
||||||
|
|
||||||
|
if (eglInitialize(display, NULL, NULL) == EGL_FALSE)
|
||||||
|
{
|
||||||
|
// This tries to initialize EGL to D3D11 Feature Level 9_3, if 10_0+ is unavailable (e.g. on some mobile devices).
|
||||||
|
display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes);
|
||||||
|
if (display == EGL_NO_DISPLAY) TraceLog(LOG_ERROR, "Failed to get EGL display");
|
||||||
|
|
||||||
|
if (eglInitialize(display, NULL, NULL) == EGL_FALSE)
|
||||||
|
{
|
||||||
|
// This initializes EGL to D3D11 Feature Level 11_0 on WARP, if 9_3+ is unavailable on the default GPU.
|
||||||
|
display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes);
|
||||||
|
if (display == EGL_NO_DISPLAY) TraceLog(LOG_ERROR, "Failed to get EGL display");
|
||||||
|
|
||||||
|
if (eglInitialize(display, NULL, NULL) == EGL_FALSE)
|
||||||
|
{
|
||||||
|
// If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred.
|
||||||
|
TraceLog(LOG_ERROR, "Failed to initialize EGL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//SetupFramebufferSize(displayWidth, displayHeight);
|
||||||
|
|
||||||
|
EGLint numConfigs = 0;
|
||||||
|
if ((eglChooseConfig(display, framebufferAttribs, &config, 1, &numConfigs) == EGL_FALSE) || (numConfigs == 0))
|
||||||
|
{
|
||||||
|
TraceLog(LOG_ERROR, "Failed to choose first EGLConfig");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a PropertySet and initialize with the EGLNativeWindowType.
|
||||||
|
//PropertySet^ surfaceCreationProperties = ref new PropertySet();
|
||||||
|
//surfaceCreationProperties->Insert(ref new String(EGLNativeWindowTypeProperty), window); // CoreWindow^ window
|
||||||
|
|
||||||
|
// You can configure the surface to render at a lower resolution and be scaled up to
|
||||||
|
// the full window size. The scaling is often free on mobile hardware.
|
||||||
|
//
|
||||||
|
// One way to configure the SwapChainPanel is to specify precisely which resolution it should render at.
|
||||||
|
// Size customRenderSurfaceSize = Size(800, 600);
|
||||||
|
// surfaceCreationProperties->Insert(ref new String(EGLRenderSurfaceSizeProperty), PropertyValue::CreateSize(customRenderSurfaceSize));
|
||||||
|
//
|
||||||
|
// Another way is to tell the SwapChainPanel to render at a certain scale factor compared to its size.
|
||||||
|
// e.g. if the SwapChainPanel is 1920x1280 then setting a factor of 0.5f will make the app render at 960x640
|
||||||
|
// float customResolutionScale = 0.5f;
|
||||||
|
// surfaceCreationProperties->Insert(ref new String(EGLRenderResolutionScaleProperty), PropertyValue::CreateSingle(customResolutionScale));
|
||||||
|
|
||||||
|
|
||||||
|
// eglCreateWindowSurface() requires a EGLNativeWindowType parameter,
|
||||||
|
// In Windows platform: typedef HWND EGLNativeWindowType;
|
||||||
|
|
||||||
|
|
||||||
|
// Property: EGLNativeWindowTypeProperty
|
||||||
|
// Type: IInspectable
|
||||||
|
// Description: Set this property to specify the window type to use for creating a surface.
|
||||||
|
// If this property is missing, surface creation will fail.
|
||||||
|
//
|
||||||
|
//const wchar_t EGLNativeWindowTypeProperty[] = L"EGLNativeWindowTypeProperty";
|
||||||
|
|
||||||
|
//https://stackoverflow.com/questions/46550182/how-to-create-eglsurface-using-c-winrt-and-angle
|
||||||
|
|
||||||
|
//surface = eglCreateWindowSurface(display, config, reinterpret_cast<IInspectable*>(surfaceCreationProperties), surfaceAttributes);
|
||||||
|
surface = eglCreateWindowSurface(display, config, uwpWindow, surfaceAttributes);
|
||||||
|
if (surface == EGL_NO_SURFACE) TraceLog(LOG_ERROR, "Failed to create EGL fullscreen surface");
|
||||||
|
|
||||||
|
context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs);
|
||||||
|
if (context == EGL_NO_CONTEXT) TraceLog(LOG_ERROR, "Failed to create EGL context");
|
||||||
|
|
||||||
|
// Get EGL display window size
|
||||||
|
eglQuerySurface(display, surface, EGL_WIDTH, &screenWidth);
|
||||||
|
eglQuerySurface(display, surface, EGL_HEIGHT, &screenHeight);
|
||||||
|
|
||||||
|
#else // PLATFORM_ANDROID, PLATFORM_RPI
|
||||||
EGLint numConfigs;
|
EGLint numConfigs;
|
||||||
|
|
||||||
// Get an EGL display connection
|
// Get an EGL display connection
|
||||||
|
|
@ -1925,6 +2087,7 @@ static void InitGraphicsDevice(int width, int height)
|
||||||
|
|
||||||
// Create an EGL rendering context
|
// Create an EGL rendering context
|
||||||
context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs);
|
context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Create an EGL window surface
|
// Create an EGL window surface
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
|
|
@ -2008,6 +2171,9 @@ static void InitGraphicsDevice(int width, int height)
|
||||||
}
|
}
|
||||||
#endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
#endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
||||||
|
|
||||||
|
renderWidth = screenWidth;
|
||||||
|
renderHeight = screenHeight;
|
||||||
|
|
||||||
// Initialize OpenGL context (states and resources)
|
// Initialize OpenGL context (states and resources)
|
||||||
// NOTE: screenWidth and screenHeight not used, just stored as globals
|
// NOTE: screenWidth and screenHeight not used, just stored as globals
|
||||||
rlglInit(screenWidth, screenHeight);
|
rlglInit(screenWidth, screenHeight);
|
||||||
|
|
@ -2376,7 +2542,7 @@ static void SwapBuffers(void)
|
||||||
glfwSwapBuffers(window);
|
glfwSwapBuffers(window);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
|
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
|
||||||
eglSwapBuffers(display, surface);
|
eglSwapBuffers(display, surface);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
303
src/external/include/ANGLE/EGL/egl.h
vendored
Normal file
303
src/external/include/ANGLE/EGL/egl.h
vendored
Normal file
|
|
@ -0,0 +1,303 @@
|
||||||
|
#ifndef __egl_h_
|
||||||
|
#define __egl_h_ 1
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Copyright (c) 2013-2014 The Khronos Group Inc.
|
||||||
|
**
|
||||||
|
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
** copy of this software and/or associated documentation files (the
|
||||||
|
** "Materials"), to deal in the Materials without restriction, including
|
||||||
|
** without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||||
|
** permit persons to whom the Materials are furnished to do so, subject to
|
||||||
|
** the following conditions:
|
||||||
|
**
|
||||||
|
** The above copyright notice and this permission notice shall be included
|
||||||
|
** in all copies or substantial portions of the Materials.
|
||||||
|
**
|
||||||
|
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||||
|
** API Registry. The current version of the Registry, generator scripts
|
||||||
|
** used to make the header, and the header can be found at
|
||||||
|
** http://www.opengl.org/registry/
|
||||||
|
**
|
||||||
|
** Khronos $Revision: 29318 $ on $Date: 2015-01-02 03:16:10 -0800 (Fri, 02 Jan 2015) $
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <EGL/eglplatform.h>
|
||||||
|
|
||||||
|
/* Generated on date 20150102 */
|
||||||
|
|
||||||
|
/* Generated C header for:
|
||||||
|
* API: egl
|
||||||
|
* Versions considered: .*
|
||||||
|
* Versions emitted: .*
|
||||||
|
* Default extensions included: None
|
||||||
|
* Additional extensions included: _nomatch_^
|
||||||
|
* Extensions removed: _nomatch_^
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EGL_VERSION_1_0
|
||||||
|
#define EGL_VERSION_1_0 1
|
||||||
|
typedef unsigned int EGLBoolean;
|
||||||
|
typedef void *EGLDisplay;
|
||||||
|
#include <KHR/khrplatform.h>
|
||||||
|
#include <EGL/eglplatform.h>
|
||||||
|
typedef void *EGLConfig;
|
||||||
|
typedef void *EGLSurface;
|
||||||
|
typedef void *EGLContext;
|
||||||
|
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
||||||
|
#define EGL_ALPHA_SIZE 0x3021
|
||||||
|
#define EGL_BAD_ACCESS 0x3002
|
||||||
|
#define EGL_BAD_ALLOC 0x3003
|
||||||
|
#define EGL_BAD_ATTRIBUTE 0x3004
|
||||||
|
#define EGL_BAD_CONFIG 0x3005
|
||||||
|
#define EGL_BAD_CONTEXT 0x3006
|
||||||
|
#define EGL_BAD_CURRENT_SURFACE 0x3007
|
||||||
|
#define EGL_BAD_DISPLAY 0x3008
|
||||||
|
#define EGL_BAD_MATCH 0x3009
|
||||||
|
#define EGL_BAD_NATIVE_PIXMAP 0x300A
|
||||||
|
#define EGL_BAD_NATIVE_WINDOW 0x300B
|
||||||
|
#define EGL_BAD_PARAMETER 0x300C
|
||||||
|
#define EGL_BAD_SURFACE 0x300D
|
||||||
|
#define EGL_BLUE_SIZE 0x3022
|
||||||
|
#define EGL_BUFFER_SIZE 0x3020
|
||||||
|
#define EGL_CONFIG_CAVEAT 0x3027
|
||||||
|
#define EGL_CONFIG_ID 0x3028
|
||||||
|
#define EGL_CORE_NATIVE_ENGINE 0x305B
|
||||||
|
#define EGL_DEPTH_SIZE 0x3025
|
||||||
|
#define EGL_DONT_CARE ((EGLint)-1)
|
||||||
|
#define EGL_DRAW 0x3059
|
||||||
|
#define EGL_EXTENSIONS 0x3055
|
||||||
|
#define EGL_FALSE 0
|
||||||
|
#define EGL_GREEN_SIZE 0x3023
|
||||||
|
#define EGL_HEIGHT 0x3056
|
||||||
|
#define EGL_LARGEST_PBUFFER 0x3058
|
||||||
|
#define EGL_LEVEL 0x3029
|
||||||
|
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
|
||||||
|
#define EGL_MAX_PBUFFER_PIXELS 0x302B
|
||||||
|
#define EGL_MAX_PBUFFER_WIDTH 0x302C
|
||||||
|
#define EGL_NATIVE_RENDERABLE 0x302D
|
||||||
|
#define EGL_NATIVE_VISUAL_ID 0x302E
|
||||||
|
#define EGL_NATIVE_VISUAL_TYPE 0x302F
|
||||||
|
#define EGL_NONE 0x3038
|
||||||
|
#define EGL_NON_CONFORMANT_CONFIG 0x3051
|
||||||
|
#define EGL_NOT_INITIALIZED 0x3001
|
||||||
|
#define EGL_NO_CONTEXT ((EGLContext)0)
|
||||||
|
#define EGL_NO_DISPLAY ((EGLDisplay)0)
|
||||||
|
#define EGL_NO_SURFACE ((EGLSurface)0)
|
||||||
|
#define EGL_PBUFFER_BIT 0x0001
|
||||||
|
#define EGL_PIXMAP_BIT 0x0002
|
||||||
|
#define EGL_READ 0x305A
|
||||||
|
#define EGL_RED_SIZE 0x3024
|
||||||
|
#define EGL_SAMPLES 0x3031
|
||||||
|
#define EGL_SAMPLE_BUFFERS 0x3032
|
||||||
|
#define EGL_SLOW_CONFIG 0x3050
|
||||||
|
#define EGL_STENCIL_SIZE 0x3026
|
||||||
|
#define EGL_SUCCESS 0x3000
|
||||||
|
#define EGL_SURFACE_TYPE 0x3033
|
||||||
|
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
|
||||||
|
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
|
||||||
|
#define EGL_TRANSPARENT_RED_VALUE 0x3037
|
||||||
|
#define EGL_TRANSPARENT_RGB 0x3052
|
||||||
|
#define EGL_TRANSPARENT_TYPE 0x3034
|
||||||
|
#define EGL_TRUE 1
|
||||||
|
#define EGL_VENDOR 0x3053
|
||||||
|
#define EGL_VERSION 0x3054
|
||||||
|
#define EGL_WIDTH 0x3057
|
||||||
|
#define EGL_WINDOW_BIT 0x0004
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||||
|
EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||||
|
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||||
|
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
|
||||||
|
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||||
|
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void);
|
||||||
|
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw);
|
||||||
|
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id);
|
||||||
|
EGLAPI EGLint EGLAPIENTRY eglGetError (void);
|
||||||
|
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
|
||||||
|
EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
|
||||||
|
#endif /* EGL_VERSION_1_0 */
|
||||||
|
|
||||||
|
#ifndef EGL_VERSION_1_1
|
||||||
|
#define EGL_VERSION_1_1 1
|
||||||
|
#define EGL_BACK_BUFFER 0x3084
|
||||||
|
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
|
||||||
|
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
|
||||||
|
#define EGL_CONTEXT_LOST 0x300E
|
||||||
|
#define EGL_MIN_SWAP_INTERVAL 0x303B
|
||||||
|
#define EGL_MAX_SWAP_INTERVAL 0x303C
|
||||||
|
#define EGL_MIPMAP_TEXTURE 0x3082
|
||||||
|
#define EGL_MIPMAP_LEVEL 0x3083
|
||||||
|
#define EGL_NO_TEXTURE 0x305C
|
||||||
|
#define EGL_TEXTURE_2D 0x305F
|
||||||
|
#define EGL_TEXTURE_FORMAT 0x3080
|
||||||
|
#define EGL_TEXTURE_RGB 0x305D
|
||||||
|
#define EGL_TEXTURE_RGBA 0x305E
|
||||||
|
#define EGL_TEXTURE_TARGET 0x3081
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
|
||||||
|
#endif /* EGL_VERSION_1_1 */
|
||||||
|
|
||||||
|
#ifndef EGL_VERSION_1_2
|
||||||
|
#define EGL_VERSION_1_2 1
|
||||||
|
typedef unsigned int EGLenum;
|
||||||
|
typedef void *EGLClientBuffer;
|
||||||
|
#define EGL_ALPHA_FORMAT 0x3088
|
||||||
|
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
|
||||||
|
#define EGL_ALPHA_FORMAT_PRE 0x308C
|
||||||
|
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||||
|
#define EGL_BUFFER_PRESERVED 0x3094
|
||||||
|
#define EGL_BUFFER_DESTROYED 0x3095
|
||||||
|
#define EGL_CLIENT_APIS 0x308D
|
||||||
|
#define EGL_COLORSPACE 0x3087
|
||||||
|
#define EGL_COLORSPACE_sRGB 0x3089
|
||||||
|
#define EGL_COLORSPACE_LINEAR 0x308A
|
||||||
|
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||||
|
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||||
|
#define EGL_DISPLAY_SCALING 10000
|
||||||
|
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||||
|
#define EGL_LUMINANCE_BUFFER 0x308F
|
||||||
|
#define EGL_LUMINANCE_SIZE 0x303D
|
||||||
|
#define EGL_OPENGL_ES_BIT 0x0001
|
||||||
|
#define EGL_OPENVG_BIT 0x0002
|
||||||
|
#define EGL_OPENGL_ES_API 0x30A0
|
||||||
|
#define EGL_OPENVG_API 0x30A1
|
||||||
|
#define EGL_OPENVG_IMAGE 0x3096
|
||||||
|
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||||
|
#define EGL_RENDERABLE_TYPE 0x3040
|
||||||
|
#define EGL_RENDER_BUFFER 0x3086
|
||||||
|
#define EGL_RGB_BUFFER 0x308E
|
||||||
|
#define EGL_SINGLE_BUFFER 0x3085
|
||||||
|
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||||
|
#define EGL_UNKNOWN ((EGLint)-1)
|
||||||
|
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
|
||||||
|
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
|
||||||
|
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
|
||||||
|
#endif /* EGL_VERSION_1_2 */
|
||||||
|
|
||||||
|
#ifndef EGL_VERSION_1_3
|
||||||
|
#define EGL_VERSION_1_3 1
|
||||||
|
#define EGL_CONFORMANT 0x3042
|
||||||
|
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||||
|
#define EGL_MATCH_NATIVE_PIXMAP 0x3041
|
||||||
|
#define EGL_OPENGL_ES2_BIT 0x0004
|
||||||
|
#define EGL_VG_ALPHA_FORMAT 0x3088
|
||||||
|
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
|
||||||
|
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C
|
||||||
|
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
|
||||||
|
#define EGL_VG_COLORSPACE 0x3087
|
||||||
|
#define EGL_VG_COLORSPACE_sRGB 0x3089
|
||||||
|
#define EGL_VG_COLORSPACE_LINEAR 0x308A
|
||||||
|
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
|
||||||
|
#endif /* EGL_VERSION_1_3 */
|
||||||
|
|
||||||
|
#ifndef EGL_VERSION_1_4
|
||||||
|
#define EGL_VERSION_1_4 1
|
||||||
|
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
||||||
|
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
|
||||||
|
#define EGL_MULTISAMPLE_RESOLVE 0x3099
|
||||||
|
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
|
||||||
|
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
|
||||||
|
#define EGL_OPENGL_API 0x30A2
|
||||||
|
#define EGL_OPENGL_BIT 0x0008
|
||||||
|
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
|
||||||
|
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
|
||||||
|
#endif /* EGL_VERSION_1_4 */
|
||||||
|
|
||||||
|
#ifndef EGL_VERSION_1_5
|
||||||
|
#define EGL_VERSION_1_5 1
|
||||||
|
typedef void *EGLSync;
|
||||||
|
typedef intptr_t EGLAttrib;
|
||||||
|
typedef khronos_utime_nanoseconds_t EGLTime;
|
||||||
|
typedef void *EGLImage;
|
||||||
|
#define EGL_CONTEXT_MAJOR_VERSION 0x3098
|
||||||
|
#define EGL_CONTEXT_MINOR_VERSION 0x30FB
|
||||||
|
#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
|
||||||
|
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
|
||||||
|
#define EGL_NO_RESET_NOTIFICATION 0x31BE
|
||||||
|
#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF
|
||||||
|
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
|
||||||
|
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
|
||||||
|
#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0
|
||||||
|
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
|
||||||
|
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
|
||||||
|
#define EGL_OPENGL_ES3_BIT 0x00000040
|
||||||
|
#define EGL_CL_EVENT_HANDLE 0x309C
|
||||||
|
#define EGL_SYNC_CL_EVENT 0x30FE
|
||||||
|
#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
|
||||||
|
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
|
||||||
|
#define EGL_SYNC_TYPE 0x30F7
|
||||||
|
#define EGL_SYNC_STATUS 0x30F1
|
||||||
|
#define EGL_SYNC_CONDITION 0x30F8
|
||||||
|
#define EGL_SIGNALED 0x30F2
|
||||||
|
#define EGL_UNSIGNALED 0x30F3
|
||||||
|
#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
|
||||||
|
#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull
|
||||||
|
#define EGL_TIMEOUT_EXPIRED 0x30F5
|
||||||
|
#define EGL_CONDITION_SATISFIED 0x30F6
|
||||||
|
#define EGL_NO_SYNC ((EGLSync)0)
|
||||||
|
#define EGL_SYNC_FENCE 0x30F9
|
||||||
|
#define EGL_GL_COLORSPACE 0x309D
|
||||||
|
#define EGL_GL_COLORSPACE_SRGB 0x3089
|
||||||
|
#define EGL_GL_COLORSPACE_LINEAR 0x308A
|
||||||
|
#define EGL_GL_RENDERBUFFER 0x30B9
|
||||||
|
#define EGL_GL_TEXTURE_2D 0x30B1
|
||||||
|
#define EGL_GL_TEXTURE_LEVEL 0x30BC
|
||||||
|
#define EGL_GL_TEXTURE_3D 0x30B2
|
||||||
|
#define EGL_GL_TEXTURE_ZOFFSET 0x30BD
|
||||||
|
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
|
||||||
|
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
|
||||||
|
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
|
||||||
|
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
|
||||||
|
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
|
||||||
|
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
|
||||||
|
#define EGL_IMAGE_PRESERVED 0x30D2
|
||||||
|
#define EGL_NO_IMAGE ((EGLImage)0)
|
||||||
|
EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
|
||||||
|
EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
|
||||||
|
EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image);
|
||||||
|
EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
|
||||||
|
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||||
|
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||||
|
#endif /* EGL_VERSION_1_5 */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue