Update libs versions and camera fixes.
Camera scale now works mostly fine. Bump SDL2 to 2.28.2. Bump Dear ImGui to 1.89.8. Bump JSON lib to 3.10.2.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <json/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using json = nlohmann::ordered_json;
|
using json = nlohmann::ordered_json;
|
||||||
|
|
||||||
#include <SDL_rect.h>
|
#include <SDL_rect.h>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <json/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using json = nlohmann::ordered_json;
|
using json = nlohmann::ordered_json;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include <json/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
using json = nlohmann::ordered_json;
|
using json = nlohmann::ordered_json;
|
||||||
|
|
||||||
SDL_Rect UE::Texture::GetTextureRect(int i)
|
SDL_Rect UE::Texture::GetTextureRect(int i)
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ namespace UE
|
|||||||
//Cargamos el Renderer.
|
//Cargamos el Renderer.
|
||||||
//Hay que implementar un sistema de flags o
|
//Hay que implementar un sistema de flags o
|
||||||
// una struct de configuración para la inicialización del renderer.
|
// una struct de configuración para la inicialización del renderer.
|
||||||
_renderer = new UE::Renderer(640, 480, 5);
|
_renderer = new UE::Renderer(640, 640, 5);
|
||||||
if(_renderer->InitRenderer() < 0)
|
if(_renderer->InitRenderer() < 0)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -5,18 +5,50 @@
|
|||||||
|
|
||||||
namespace UE
|
namespace UE
|
||||||
{
|
{
|
||||||
|
|
||||||
|
void Camera::UpdateScreenSize(int newWidth, int newHeight)
|
||||||
|
{
|
||||||
|
screenSize.x = newWidth;
|
||||||
|
screenSize.y = newHeight;
|
||||||
|
|
||||||
|
CalculateCamScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Camera::CalculateCamScale()
|
||||||
|
{
|
||||||
|
//Calcular la altura de un pixel.
|
||||||
|
|
||||||
|
camScale.x = screenSize.x / _size.x;
|
||||||
|
camScale.y = screenSize.y / _size.y;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Camera::SetCamSize(int width, int heigth)
|
||||||
|
{
|
||||||
|
SetSize(width, heigth);
|
||||||
|
CalculateCamScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Camera::SetCamSize(glm::vec2 newCamSize)
|
||||||
|
{
|
||||||
|
SetSize(newCamSize);
|
||||||
|
CalculateCamScale();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
glm::vec2 Camera::WorldToSreenCoords(glm::vec<2, float> worldCoord)
|
glm::vec2 Camera::WorldToSreenCoords(glm::vec<2, float> worldCoord)
|
||||||
{
|
{
|
||||||
//Convertimos las coordenas de WorldCoords a ScreenCoords relativas a la camPosition.
|
//Convertimos las coordenas de WorldCoords a ScreenCoords relativas a la camPosition.
|
||||||
glm::ivec2 fPos = worldCoord - _pos;
|
glm::vec2 fPos = worldCoord - _pos;
|
||||||
|
fPos = fPos * camScale;
|
||||||
return fPos;
|
return fPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec2 Camera::ScreenToWorldCoords(glm::vec<2, float> screenCoord)
|
glm::vec2 Camera::ScreenToWorldCoords(glm::vec<2, float> screenCoord)
|
||||||
{
|
{
|
||||||
//Convertimos las coordenas de ScreenCoords a WorldCoords relativas a la camPosition.
|
//Convertimos las coordenas de ScreenCoords a WorldCoords relativas a la camPosition.
|
||||||
glm::ivec2 fPos = screenCoord + _pos;
|
glm::vec2 fPos = screenCoord / camScale;
|
||||||
|
fPos = fPos + _pos;
|
||||||
|
|
||||||
return fPos;
|
return fPos;
|
||||||
}
|
}
|
||||||
@@ -25,10 +57,10 @@ namespace UE
|
|||||||
{
|
{
|
||||||
glm::ivec2 worldCoords = glm::ivec2(worldRect.x, worldRect.y);
|
glm::ivec2 worldCoords = glm::ivec2(worldRect.x, worldRect.y);
|
||||||
glm::ivec2 screenCoords = WorldToSreenCoords(worldCoords);
|
glm::ivec2 screenCoords = WorldToSreenCoords(worldCoords);
|
||||||
SDL_Rect screenRect = worldRect;
|
glm::ivec2 screenRectSize = glm::ivec2(worldRect.w * camScale.x, worldRect.h * camScale.y);
|
||||||
screenRect.x = screenCoords.x;
|
|
||||||
screenRect.y = screenCoords.y;
|
|
||||||
|
|
||||||
|
SDL_Rect screenRect {screenCoords.x, screenCoords.y, screenRectSize.x, screenRectSize.y};
|
||||||
|
|
||||||
return screenRect;
|
return screenRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,10 +68,10 @@ namespace UE
|
|||||||
{
|
{
|
||||||
glm::ivec2 screenCoords = glm::ivec2(screenRect.x, screenRect.y);
|
glm::ivec2 screenCoords = glm::ivec2(screenRect.x, screenRect.y);
|
||||||
glm::ivec2 worldCoords = ScreenToWorldCoords(screenCoords);
|
glm::ivec2 worldCoords = ScreenToWorldCoords(screenCoords);
|
||||||
SDL_Rect worldRect = screenRect;
|
glm::ivec2 worldRectSize = glm::ivec2(screenRect.w / camScale.x, screenRect.h / camScale.y);
|
||||||
worldRect.x = worldCoords.x;
|
|
||||||
worldRect.y = worldCoords.y;
|
|
||||||
|
|
||||||
|
SDL_Rect worldRect{ worldCoords.x, worldCoords.y, worldRectSize.x, worldRectSize.y };
|
||||||
|
|
||||||
return worldRect;
|
return worldRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,21 @@ namespace UE
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/*
|
||||||
|
Métodos para controlar el tamaño de la cam.
|
||||||
|
*/
|
||||||
|
void UpdateScreenSize(int newWidth, int newHeight);
|
||||||
|
|
||||||
|
void CalculateCamScale();
|
||||||
|
|
||||||
|
|
||||||
|
void SetCamSize(int width, int heigth);
|
||||||
|
|
||||||
|
void SetCamSize(glm::vec2 newCamSize);
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
@@ -53,7 +68,11 @@ namespace UE
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//glm::ivec2 camSize { 0, 0 };
|
glm::ivec2 screenSize { 0, 0 };
|
||||||
|
|
||||||
|
glm::vec2 camScale { 1, 1 };
|
||||||
|
|
||||||
|
float pixel_h;
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <ImGui/imgui.h>
|
#include <ImGui/imgui.h>
|
||||||
#include <ImGui/imgui_impl_sdl.h>
|
#include <ImGui/imgui_impl_sdl2.h>
|
||||||
#include <ImGui/imgui_impl_sdlrenderer.h>
|
#include <ImGui/imgui_impl_sdlrenderer2.h>
|
||||||
//#include <ImGui/imgui_impl_opengl3.h>
|
//#include <ImGui/imgui_impl_opengl3.h>
|
||||||
|
|
||||||
#include <SDL_opengl.h>
|
#include <SDL_opengl.h>
|
||||||
@@ -47,7 +47,7 @@ namespace UE
|
|||||||
ImGui::StyleColorsDark();
|
ImGui::StyleColorsDark();
|
||||||
|
|
||||||
ImGui_ImplSDL2_InitForSDLRenderer(_window, main_Renderer);
|
ImGui_ImplSDL2_InitForSDLRenderer(_window, main_Renderer);
|
||||||
ImGui_ImplSDLRenderer_Init(main_Renderer);
|
ImGui_ImplSDLRenderer2_Init(main_Renderer);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ namespace UE
|
|||||||
void Renderer::CleanRenderer()
|
void Renderer::CleanRenderer()
|
||||||
{
|
{
|
||||||
//Limpiamos ImGui
|
//Limpiamos ImGui
|
||||||
ImGui_ImplSDLRenderer_Shutdown();
|
ImGui_ImplSDLRenderer2_Shutdown();
|
||||||
ImGui_ImplSDL2_Shutdown();
|
ImGui_ImplSDL2_Shutdown();
|
||||||
ImGui::DestroyContext();
|
ImGui::DestroyContext();
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ namespace UE
|
|||||||
{
|
{
|
||||||
SDL_RenderClear(main_Renderer);
|
SDL_RenderClear(main_Renderer);
|
||||||
|
|
||||||
ImGui_ImplSDLRenderer_NewFrame();
|
ImGui_ImplSDLRenderer2_NewFrame();
|
||||||
ImGui_ImplSDL2_NewFrame();
|
ImGui_ImplSDL2_NewFrame();
|
||||||
ImGui::NewFrame();
|
ImGui::NewFrame();
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ namespace UE
|
|||||||
//Renderizado de ImGui.
|
//Renderizado de ImGui.
|
||||||
//TODO: Mover a otro método para cambiar el nombre a RenderDrawables.
|
//TODO: Mover a otro método para cambiar el nombre a RenderDrawables.
|
||||||
ImGui::Render();
|
ImGui::Render();
|
||||||
ImGui_ImplSDLRenderer_RenderDrawData(ImGui::GetDrawData());
|
ImGui_ImplSDLRenderer2_RenderDrawData(ImGui::GetDrawData());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,6 +218,7 @@ namespace UE
|
|||||||
glViewport(0, 0, newWidth, newHeight);
|
glViewport(0, 0, newWidth, newHeight);
|
||||||
|
|
||||||
defaultCam.SetSize(newWidth, newHeight);
|
defaultCam.SetSize(newWidth, newHeight);
|
||||||
|
activeCam->UpdateScreenSize(newWidth, newHeight);
|
||||||
|
|
||||||
UE_LOG_TRACE("Screen size chaged to: {0}x{1}", newWidth, newHeight);
|
UE_LOG_TRACE("Screen size chaged to: {0}x{1}", newWidth, newHeight);
|
||||||
}
|
}
|
||||||
@@ -228,6 +229,18 @@ namespace UE
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Renderer::SetCamera(Camera* newCam)
|
||||||
|
{
|
||||||
|
activeCam = newCam;
|
||||||
|
activeCam->UpdateScreenSize(screenSize.x, screenSize.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Renderer::ResetCamera()
|
||||||
|
{
|
||||||
|
SetCamera(&defaultCam);
|
||||||
|
}
|
||||||
|
|
||||||
bool Renderer::IsObjectVisible(SDL_Rect* objectRect)
|
bool Renderer::IsObjectVisible(SDL_Rect* objectRect)
|
||||||
{
|
{
|
||||||
return SDL_HasIntersection(objectRect, &activeCamRect);
|
return SDL_HasIntersection(objectRect, &activeCamRect);
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ namespace UE
|
|||||||
/*
|
/*
|
||||||
* Set the active cámera.
|
* Set the active cámera.
|
||||||
*/
|
*/
|
||||||
inline void SetCamera(Camera* newCam) { activeCam = newCam; }
|
void SetCamera(Camera* newCam);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get a ptr to the active camera.
|
* Get a ptr to the active camera.
|
||||||
@@ -146,7 +146,7 @@ namespace UE
|
|||||||
* Cambia la cámara activa a la cámara por defecto.
|
* Cambia la cámara activa a la cámara por defecto.
|
||||||
* Utilizado el eliminar una cámara o cuando la activeCam ya no existe.
|
* Utilizado el eliminar una cámara o cuando la activeCam ya no existe.
|
||||||
*/
|
*/
|
||||||
inline void ResetCamera() { activeCam = &defaultCam; }
|
void ResetCamera();
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014-2022 Omar Cornut
|
Copyright (c) 2014-2023 Omar Cornut
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
Vendored
+17
-13
@@ -1,5 +1,5 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// COMPILE-TIME OPTIONS FOR DEAR IMGUI
|
// DEAR IMGUI COMPILE-TIME OPTIONS
|
||||||
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
|
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
|
||||||
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
|
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
|
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
|
||||||
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
|
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
|
||||||
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
|
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
|
||||||
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
|
// Call IMGUI_CHECKVERSION() from your .cpp file to verify that the data structures your files are using are matching the ones imgui.cpp is using.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
//#define IMGUI_API __declspec( dllexport )
|
//#define IMGUI_API __declspec( dllexport )
|
||||||
//#define IMGUI_API __declspec( dllimport )
|
//#define IMGUI_API __declspec( dllimport )
|
||||||
|
|
||||||
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
|
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
|
||||||
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
|
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
|
||||||
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
|
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
|
||||||
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
|
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
|
||||||
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
|
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
|
||||||
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
|
||||||
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
|
||||||
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
|
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
|
||||||
@@ -62,9 +62,10 @@
|
|||||||
// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
|
// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
|
||||||
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
|
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
|
||||||
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
|
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
|
||||||
//#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if enabled
|
//#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if IMGUI_USE_STB_SPRINTF is defined.
|
||||||
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
|
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
|
||||||
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
|
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
|
||||||
|
//#define IMGUI_DISABLE_STB_SPRINTF_IMPLEMENTATION // only disabled if IMGUI_USE_STB_SPRINTF is defined.
|
||||||
|
|
||||||
//---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
|
//---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
|
||||||
// Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h.
|
// Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h.
|
||||||
@@ -75,6 +76,12 @@
|
|||||||
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
|
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
|
||||||
//#define IMGUI_ENABLE_FREETYPE
|
//#define IMGUI_ENABLE_FREETYPE
|
||||||
|
|
||||||
|
//---- Use FreeType+lunasvg library to render OpenType SVG fonts (SVGinOT)
|
||||||
|
// Requires lunasvg headers to be available in the include path + program to be linked with the lunasvg library (not provided).
|
||||||
|
// Only works in combination with IMGUI_ENABLE_FREETYPE.
|
||||||
|
// (implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
|
||||||
|
//#define IMGUI_ENABLE_FREETYPE_LUNASVG
|
||||||
|
|
||||||
//---- Use stb_truetype to build and rasterize the font atlas (default)
|
//---- Use stb_truetype to build and rasterize the font atlas (default)
|
||||||
// The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
|
// The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
|
||||||
//#define IMGUI_ENABLE_STB_TRUETYPE
|
//#define IMGUI_ENABLE_STB_TRUETYPE
|
||||||
@@ -90,6 +97,8 @@
|
|||||||
constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
|
constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
|
||||||
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||||
*/
|
*/
|
||||||
|
//---- ...Or use Dear ImGui's own very basic math operators.
|
||||||
|
//#define IMGUI_DEFINE_MATH_OPERATORS
|
||||||
|
|
||||||
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
||||||
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
||||||
@@ -103,23 +112,18 @@
|
|||||||
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
|
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
|
||||||
//#define ImDrawCallback MyImDrawCallback
|
//#define ImDrawCallback MyImDrawCallback
|
||||||
|
|
||||||
//---- Debug Tools: Macro to break in Debugger
|
//---- Debug Tools: Macro to break in Debugger (we provide a default implementation of this in the codebase)
|
||||||
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
|
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
|
||||||
//#define IM_DEBUG_BREAK IM_ASSERT(0)
|
//#define IM_DEBUG_BREAK IM_ASSERT(0)
|
||||||
//#define IM_DEBUG_BREAK __debugbreak()
|
//#define IM_DEBUG_BREAK __debugbreak()
|
||||||
|
|
||||||
//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
|
|
||||||
// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.)
|
|
||||||
// This adds a small runtime cost which is why it is not enabled by default.
|
|
||||||
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
|
|
||||||
|
|
||||||
//---- Debug Tools: Enable slower asserts
|
//---- Debug Tools: Enable slower asserts
|
||||||
//#define IMGUI_DEBUG_PARANOID
|
//#define IMGUI_DEBUG_PARANOID
|
||||||
|
|
||||||
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
|
//---- Tip: You can add extra functions within the ImGui:: namespace from anywhere (e.g. your own sources/header files)
|
||||||
/*
|
/*
|
||||||
namespace ImGui
|
namespace ImGui
|
||||||
{
|
{
|
||||||
void MyFunction(const char* name, const MyMatrix44& v);
|
void MyFunction(const char* name, MyMatrix44* mtx);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|||||||
Vendored
+3244
-1724
File diff suppressed because it is too large
Load Diff
Vendored
+442
-298
File diff suppressed because it is too large
Load Diff
+741
-539
File diff suppressed because it is too large
Load Diff
+181
-111
@@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.88
|
// dear imgui, v1.89.8
|
||||||
// (drawing and font code)
|
// (drawing and font code)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -26,38 +26,24 @@ Index of this file:
|
|||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "imgui.h"
|
|
||||||
#ifndef IMGUI_DISABLE
|
|
||||||
|
|
||||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "imgui.h"
|
||||||
|
#ifndef IMGUI_DISABLE
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
#ifdef IMGUI_ENABLE_FREETYPE
|
#ifdef IMGUI_ENABLE_FREETYPE
|
||||||
#include "misc/freetype/imgui_freetype.h"
|
#include "misc/freetype/imgui_freetype.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdio.h> // vsnprintf, sscanf, printf
|
#include <stdio.h> // vsnprintf, sscanf, printf
|
||||||
#if !defined(alloca)
|
|
||||||
#if defined(__GLIBC__) || defined(__sun) || defined(__APPLE__) || defined(__NEWLIB__)
|
|
||||||
#include <alloca.h> // alloca (glibc uses <alloca.h>. Note that Cygwin may have _WIN32 defined, so the order matters here)
|
|
||||||
#elif defined(_WIN32)
|
|
||||||
#include <malloc.h> // alloca
|
|
||||||
#if !defined(alloca)
|
|
||||||
#define alloca _alloca // for clang with MS Codegen
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#include <stdlib.h> // alloca
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Visual Studio warnings
|
// Visual Studio warnings
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning (disable: 4127) // condition expression is constant
|
#pragma warning (disable: 4127) // condition expression is constant
|
||||||
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
|
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
|
||||||
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
||||||
#pragma warning (disable: 6255) // [Static Analyzer] _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead.
|
|
||||||
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
|
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
|
||||||
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
|
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
|
||||||
#endif
|
#endif
|
||||||
@@ -67,9 +53,6 @@ Index of this file:
|
|||||||
#if __has_warning("-Wunknown-warning-option")
|
#if __has_warning("-Wunknown-warning-option")
|
||||||
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
|
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
|
||||||
#endif
|
#endif
|
||||||
#if __has_warning("-Walloca")
|
|
||||||
#pragma clang diagnostic ignored "-Walloca" // warning: use of function '__builtin_alloca' is discouraged
|
|
||||||
#endif
|
|
||||||
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
|
||||||
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
|
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
|
||||||
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
|
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
|
||||||
@@ -80,6 +63,7 @@ Index of this file:
|
|||||||
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning: macro name is a reserved identifier
|
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning: macro name is a reserved identifier
|
||||||
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
|
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
|
||||||
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
|
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
|
||||||
|
#pragma clang diagnostic ignored "-Wreserved-identifier" // warning: identifier '_Xxx' is reserved because it starts with '_' followed by a capital letter
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||||
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
|
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
|
||||||
@@ -405,6 +389,8 @@ void ImDrawList::_ResetForNewFrame()
|
|||||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
|
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
|
||||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
|
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
|
||||||
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
|
IM_STATIC_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
|
||||||
|
if (_Splitter._Count > 1)
|
||||||
|
_Splitter.Merge(this);
|
||||||
|
|
||||||
CmdBuffer.resize(0);
|
CmdBuffer.resize(0);
|
||||||
IdxBuffer.resize(0);
|
IdxBuffer.resize(0);
|
||||||
@@ -463,11 +449,13 @@ void ImDrawList::AddDrawCmd()
|
|||||||
// Note that this leaves the ImDrawList in a state unfit for further commands, as most code assume that CmdBuffer.Size > 0 && CmdBuffer.back().UserCallback == NULL
|
// Note that this leaves the ImDrawList in a state unfit for further commands, as most code assume that CmdBuffer.Size > 0 && CmdBuffer.back().UserCallback == NULL
|
||||||
void ImDrawList::_PopUnusedDrawCmd()
|
void ImDrawList::_PopUnusedDrawCmd()
|
||||||
{
|
{
|
||||||
if (CmdBuffer.Size == 0)
|
while (CmdBuffer.Size > 0)
|
||||||
return;
|
{
|
||||||
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
|
||||||
if (curr_cmd->ElemCount == 0 && curr_cmd->UserCallback == NULL)
|
if (curr_cmd->ElemCount != 0 || curr_cmd->UserCallback != NULL)
|
||||||
|
return;// break;
|
||||||
CmdBuffer.pop_back();
|
CmdBuffer.pop_back();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
|
void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
|
||||||
@@ -720,7 +708,7 @@ void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, c
|
|||||||
// We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds.
|
// We avoid using the ImVec2 math operators here to reduce cost to a minimum for debug/non-inlined builds.
|
||||||
void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, ImDrawFlags flags, float thickness)
|
void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, ImDrawFlags flags, float thickness)
|
||||||
{
|
{
|
||||||
if (points_count < 2)
|
if (points_count < 2 || (col & IM_COL32_A_MASK) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const bool closed = (flags & ImDrawFlags_Closed) != 0;
|
const bool closed = (flags & ImDrawFlags_Closed) != 0;
|
||||||
@@ -753,7 +741,8 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
|
|||||||
|
|
||||||
// Temporary buffer
|
// Temporary buffer
|
||||||
// The first <points_count> items are normals at each line point, then after that there are either 2 or 4 temp points for each line point
|
// The first <points_count> items are normals at each line point, then after that there are either 2 or 4 temp points for each line point
|
||||||
ImVec2* temp_normals = (ImVec2*)alloca(points_count * ((use_texture || !thick_line) ? 3 : 5) * sizeof(ImVec2)); //-V630
|
_Data->TempBuffer.reserve_discard(points_count * ((use_texture || !thick_line) ? 3 : 5));
|
||||||
|
ImVec2* temp_normals = _Data->TempBuffer.Data;
|
||||||
ImVec2* temp_points = temp_normals + points_count;
|
ImVec2* temp_points = temp_normals + points_count;
|
||||||
|
|
||||||
// Calculate normals (tangents) for each line segment
|
// Calculate normals (tangents) for each line segment
|
||||||
@@ -977,7 +966,7 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
|
|||||||
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
// - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
|
||||||
void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col)
|
void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_count, ImU32 col)
|
||||||
{
|
{
|
||||||
if (points_count < 3)
|
if (points_count < 3 || (col & IM_COL32_A_MASK) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const ImVec2 uv = _Data->TexUvWhitePixel;
|
const ImVec2 uv = _Data->TexUvWhitePixel;
|
||||||
@@ -1001,7 +990,8 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compute normals
|
// Compute normals
|
||||||
ImVec2* temp_normals = (ImVec2*)alloca(points_count * sizeof(ImVec2)); //-V630
|
_Data->TempBuffer.reserve_discard(points_count);
|
||||||
|
ImVec2* temp_normals = _Data->TempBuffer.Data;
|
||||||
for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
|
for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
|
||||||
{
|
{
|
||||||
const ImVec2& p0 = points[i0];
|
const ImVec2& p0 = points[i0];
|
||||||
@@ -1295,6 +1285,7 @@ void ImDrawList::PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, cons
|
|||||||
ImVec2 p1 = _Path.back();
|
ImVec2 p1 = _Path.back();
|
||||||
if (num_segments == 0)
|
if (num_segments == 0)
|
||||||
{
|
{
|
||||||
|
IM_ASSERT(_Data->CurveTessellationTol > 0.0f);
|
||||||
PathBezierCubicCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
|
PathBezierCubicCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1310,6 +1301,7 @@ void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3,
|
|||||||
ImVec2 p1 = _Path.back();
|
ImVec2 p1 = _Path.back();
|
||||||
if (num_segments == 0)
|
if (num_segments == 0)
|
||||||
{
|
{
|
||||||
|
IM_ASSERT(_Data->CurveTessellationTol > 0.0f);
|
||||||
PathBezierQuadraticCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, _Data->CurveTessellationTol, 0);// Auto-tessellated
|
PathBezierQuadraticCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, _Data->CurveTessellationTol, 0);// Auto-tessellated
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1324,6 +1316,7 @@ IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4));
|
|||||||
static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
|
static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
|
||||||
{
|
{
|
||||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
|
// Obsoleted in 1.82 (from February 2021)
|
||||||
// Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All)
|
// Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All)
|
||||||
// ~0 --> ImDrawFlags_RoundCornersAll or 0
|
// ~0 --> ImDrawFlags_RoundCornersAll or 0
|
||||||
if (flags == ~0)
|
if (flags == ~0)
|
||||||
@@ -1816,6 +1809,63 @@ void ImDrawListSplitter::SetCurrentChannel(ImDrawList* draw_list, int idx)
|
|||||||
// [SECTION] ImDrawData
|
// [SECTION] ImDrawData
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void ImDrawData::Clear()
|
||||||
|
{
|
||||||
|
Valid = false;
|
||||||
|
CmdListsCount = TotalIdxCount = TotalVtxCount = 0;
|
||||||
|
CmdLists.resize(0); // The ImDrawList are NOT owned by ImDrawData but e.g. by ImGuiContext, so we don't clear them.
|
||||||
|
DisplayPos = DisplaySize = FramebufferScale = ImVec2(0.0f, 0.0f);
|
||||||
|
OwnerViewport = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Important: 'out_list' is generally going to be draw_data->CmdLists, but may be another temporary list
|
||||||
|
// as long at it is expected that the result will be later merged into draw_data->CmdLists[].
|
||||||
|
void ImGui::AddDrawListToDrawDataEx(ImDrawData* draw_data, ImVector<ImDrawList*>* out_list, ImDrawList* draw_list)
|
||||||
|
{
|
||||||
|
if (draw_list->CmdBuffer.Size == 0)
|
||||||
|
return;
|
||||||
|
if (draw_list->CmdBuffer.Size == 1 && draw_list->CmdBuffer[0].ElemCount == 0 && draw_list->CmdBuffer[0].UserCallback == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
|
||||||
|
// May trigger for you if you are using PrimXXX functions incorrectly.
|
||||||
|
IM_ASSERT(draw_list->VtxBuffer.Size == 0 || draw_list->_VtxWritePtr == draw_list->VtxBuffer.Data + draw_list->VtxBuffer.Size);
|
||||||
|
IM_ASSERT(draw_list->IdxBuffer.Size == 0 || draw_list->_IdxWritePtr == draw_list->IdxBuffer.Data + draw_list->IdxBuffer.Size);
|
||||||
|
if (!(draw_list->Flags & ImDrawListFlags_AllowVtxOffset))
|
||||||
|
IM_ASSERT((int)draw_list->_VtxCurrentIdx == draw_list->VtxBuffer.Size);
|
||||||
|
|
||||||
|
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = unsigned short = 2 bytes = 64K vertices per ImDrawList = per window)
|
||||||
|
// If this assert triggers because you are drawing lots of stuff manually:
|
||||||
|
// - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
|
||||||
|
// Be mindful that the lower-level ImDrawList API doesn't filter vertices. Use the Metrics/Debugger window to inspect draw list contents.
|
||||||
|
// - If you want large meshes with more than 64K vertices, you can either:
|
||||||
|
// (A) Handle the ImDrawCmd::VtxOffset value in your renderer backend, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
|
||||||
|
// Most example backends already support this from 1.71. Pre-1.71 backends won't.
|
||||||
|
// Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them.
|
||||||
|
// (B) Or handle 32-bit indices in your renderer backend, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
|
||||||
|
// Most example backends already support this. For example, the OpenGL example code detect index size at compile-time:
|
||||||
|
// glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
|
||||||
|
// Your own engine or render API may use different parameters or function calls to specify index sizes.
|
||||||
|
// 2 and 4 bytes indices are generally supported by most graphics API.
|
||||||
|
// - If for some reason neither of those solutions works for you, a workaround is to call BeginChild()/EndChild() before reaching
|
||||||
|
// the 64K limit to split your draw commands in multiple draw lists.
|
||||||
|
if (sizeof(ImDrawIdx) == 2)
|
||||||
|
IM_ASSERT(draw_list->_VtxCurrentIdx < (1 << 16) && "Too many vertices in ImDrawList using 16-bit indices. Read comment above");
|
||||||
|
|
||||||
|
// Add to output list + records state in ImDrawData
|
||||||
|
out_list->push_back(draw_list);
|
||||||
|
draw_data->CmdListsCount++;
|
||||||
|
draw_data->TotalVtxCount += draw_list->VtxBuffer.Size;
|
||||||
|
draw_data->TotalIdxCount += draw_list->IdxBuffer.Size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ImDrawData::AddDrawList(ImDrawList* draw_list)
|
||||||
|
{
|
||||||
|
IM_ASSERT(CmdLists.Size == CmdListsCount);
|
||||||
|
draw_list->_PopUnusedDrawCmd();
|
||||||
|
ImGui::AddDrawListToDrawDataEx(this, &CmdLists, draw_list);
|
||||||
|
}
|
||||||
|
|
||||||
// For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
// For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
||||||
void ImDrawData::DeIndexAllBuffers()
|
void ImDrawData::DeIndexAllBuffers()
|
||||||
{
|
{
|
||||||
@@ -1912,7 +1962,7 @@ ImFontConfig::ImFontConfig()
|
|||||||
{
|
{
|
||||||
memset(this, 0, sizeof(*this));
|
memset(this, 0, sizeof(*this));
|
||||||
FontDataOwnedByAtlas = true;
|
FontDataOwnedByAtlas = true;
|
||||||
OversampleH = 3; // FIXME: 2 may be a better default?
|
OversampleH = 2;
|
||||||
OversampleV = 1;
|
OversampleV = 1;
|
||||||
GlyphMaxAdvanceX = FLT_MAX;
|
GlyphMaxAdvanceX = FLT_MAX;
|
||||||
RasterizerMultiply = 1.0f;
|
RasterizerMultiply = 1.0f;
|
||||||
@@ -2298,10 +2348,11 @@ void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], fl
|
|||||||
|
|
||||||
void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride)
|
void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride)
|
||||||
{
|
{
|
||||||
|
IM_ASSERT_PARANOID(w <= stride);
|
||||||
unsigned char* data = pixels + x + y * stride;
|
unsigned char* data = pixels + x + y * stride;
|
||||||
for (int j = h; j > 0; j--, data += stride)
|
for (int j = h; j > 0; j--, data += stride - w)
|
||||||
for (int i = 0; i < w; i++)
|
for (int i = w; i > 0; i--, data++)
|
||||||
data[i] = table[data[i]];
|
*data = table[*data];
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IMGUI_ENABLE_STB_TRUETYPE
|
#ifdef IMGUI_ENABLE_STB_TRUETYPE
|
||||||
@@ -2318,7 +2369,7 @@ struct ImFontBuildSrcData
|
|||||||
int GlyphsHighest; // Highest requested codepoint
|
int GlyphsHighest; // Highest requested codepoint
|
||||||
int GlyphsCount; // Glyph count (excluding missing glyphs and glyphs already set by an earlier source font)
|
int GlyphsCount; // Glyph count (excluding missing glyphs and glyphs already set by an earlier source font)
|
||||||
ImBitVector GlyphsSet; // Glyph bit map (random access, 1-bit per codepoint. This will be a maximum of 8KB)
|
ImBitVector GlyphsSet; // Glyph bit map (random access, 1-bit per codepoint. This will be a maximum of 8KB)
|
||||||
ImVector<int> GlyphsList; // Glyph codepoints list (flattened version of GlyphsMap)
|
ImVector<int> GlyphsList; // Glyph codepoints list (flattened version of GlyphsSet)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Temporary data for one destination ImFont* (multiple source fonts can be merged into one destination ImFont)
|
// Temporary data for one destination ImFont* (multiple source fonts can be merged into one destination ImFont)
|
||||||
@@ -2390,7 +2441,12 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
|
|||||||
ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
|
ImFontBuildDstData& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
|
||||||
src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault();
|
src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault();
|
||||||
for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
|
for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
|
||||||
|
{
|
||||||
|
// Check for valid range. This may also help detect *some* dangling pointers, because a common
|
||||||
|
// user error is to setup ImFontConfig::GlyphRanges with a pointer to data that isn't persistent.
|
||||||
|
IM_ASSERT(src_range[0] <= src_range[1]);
|
||||||
src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]);
|
src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]);
|
||||||
|
}
|
||||||
dst_tmp.SrcCount++;
|
dst_tmp.SrcCount++;
|
||||||
dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest);
|
dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest);
|
||||||
}
|
}
|
||||||
@@ -2555,13 +2611,10 @@ static bool ImFontAtlasBuildWithStbTruetype(ImFontAtlas* atlas)
|
|||||||
// 9. Setup ImFont and glyphs for runtime
|
// 9. Setup ImFont and glyphs for runtime
|
||||||
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
|
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
|
||||||
{
|
{
|
||||||
ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
|
|
||||||
if (src_tmp.GlyphsCount == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// When merging fonts with MergeMode=true:
|
// When merging fonts with MergeMode=true:
|
||||||
// - We can have multiple input fonts writing into a same destination font.
|
// - We can have multiple input fonts writing into a same destination font.
|
||||||
// - dst_font->ConfigData is != from cfg which is our source configuration.
|
// - dst_font->ConfigData is != from cfg which is our source configuration.
|
||||||
|
ImFontBuildSrcData& src_tmp = src_tmp_array[src_i];
|
||||||
ImFontConfig& cfg = atlas->ConfigData[src_i];
|
ImFontConfig& cfg = atlas->ConfigData[src_i];
|
||||||
ImFont* dst_font = cfg.DstFont;
|
ImFont* dst_font = cfg.DstFont;
|
||||||
|
|
||||||
@@ -2625,6 +2678,9 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa
|
|||||||
|
|
||||||
ImVector<ImFontAtlasCustomRect>& user_rects = atlas->CustomRects;
|
ImVector<ImFontAtlasCustomRect>& user_rects = atlas->CustomRects;
|
||||||
IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong.
|
IM_ASSERT(user_rects.Size >= 1); // We expect at least the default custom rects to be registered, else something went wrong.
|
||||||
|
#ifdef __GNUC__
|
||||||
|
if (user_rects.Size < 1) { __builtin_unreachable(); } // Workaround for GCC bug if IM_ASSERT() is defined to conditionally throw (see #5343)
|
||||||
|
#endif
|
||||||
|
|
||||||
ImVector<stbrp_rect> pack_rects;
|
ImVector<stbrp_rect> pack_rects;
|
||||||
pack_rects.resize(user_rects.Size);
|
pack_rects.resize(user_rects.Size);
|
||||||
@@ -2818,6 +2874,17 @@ const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
|
|||||||
return &ranges[0];
|
return &ranges[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImWchar* ImFontAtlas::GetGlyphRangesGreek()
|
||||||
|
{
|
||||||
|
static const ImWchar ranges[] =
|
||||||
|
{
|
||||||
|
0x0020, 0x00FF, // Basic Latin + Latin Supplement
|
||||||
|
0x0370, 0x03FF, // Greek and Coptic
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
return &ranges[0];
|
||||||
|
}
|
||||||
|
|
||||||
const ImWchar* ImFontAtlas::GetGlyphRangesKorean()
|
const ImWchar* ImFontAtlas::GetGlyphRangesKorean()
|
||||||
{
|
{
|
||||||
static const ImWchar ranges[] =
|
static const ImWchar ranges[] =
|
||||||
@@ -2934,19 +3001,19 @@ const ImWchar* ImFontAtlas::GetGlyphRangesJapanese()
|
|||||||
// 2999 ideograms code points for Japanese
|
// 2999 ideograms code points for Japanese
|
||||||
// - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points
|
// - 2136 Joyo (meaning "for regular use" or "for common use") Kanji code points
|
||||||
// - 863 Jinmeiyo (meaning "for personal name") Kanji code points
|
// - 863 Jinmeiyo (meaning "for personal name") Kanji code points
|
||||||
// - Sourced from the character information database of the Information-technology Promotion Agency, Japan
|
// - Sourced from official information provided by the government agencies of Japan:
|
||||||
// - https://mojikiban.ipa.go.jp/mji/
|
// - List of Joyo Kanji by the Agency for Cultural Affairs
|
||||||
// - Available under the terms of the Creative Commons Attribution-ShareAlike 2.1 Japan (CC BY-SA 2.1 JP).
|
// - https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kijun/naikaku/kanji/
|
||||||
// - https://creativecommons.org/licenses/by-sa/2.1/jp/deed.en
|
// - List of Jinmeiyo Kanji by the Ministry of Justice
|
||||||
// - https://creativecommons.org/licenses/by-sa/2.1/jp/legalcode
|
// - http://www.moj.go.jp/MINJI/minji86.html
|
||||||
// - You can generate this code by the script at:
|
// - Available under the terms of the Creative Commons Attribution 4.0 International (CC BY 4.0).
|
||||||
// - https://github.com/vaiorabbit/everyday_use_kanji
|
// - https://creativecommons.org/licenses/by/4.0/legalcode
|
||||||
|
// - You can generate this code by the script at:
|
||||||
|
// - https://github.com/vaiorabbit/everyday_use_kanji
|
||||||
// - References:
|
// - References:
|
||||||
// - List of Joyo Kanji
|
// - List of Joyo Kanji
|
||||||
// - (Official list by the Agency for Cultural Affairs) https://www.bunka.go.jp/kokugo_nihongo/sisaku/joho/joho/kakuki/14/tosin02/index.html
|
|
||||||
// - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji
|
// - (Wikipedia) https://en.wikipedia.org/wiki/List_of_j%C5%8Dy%C5%8D_kanji
|
||||||
// - List of Jinmeiyo Kanji
|
// - List of Jinmeiyo Kanji
|
||||||
// - (Official list by the Ministry of Justice) http://www.moj.go.jp/MINJI/minji86.html
|
|
||||||
// - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji
|
// - (Wikipedia) https://en.wikipedia.org/wiki/Jinmeiy%C5%8D_kanji
|
||||||
// - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details.
|
// - Missing 1 Joyo Kanji: U+20B9F (Kun'yomi: Shikaru, On'yomi: Shitsu,shichi), see https://github.com/ocornut/imgui/pull/3627 for details.
|
||||||
// You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters.
|
// You can use ImFontGlyphRangesBuilder to create your own ranges derived from this, by merging existing ranges or adding new characters.
|
||||||
@@ -3109,7 +3176,8 @@ ImFont::ImFont()
|
|||||||
FallbackAdvanceX = 0.0f;
|
FallbackAdvanceX = 0.0f;
|
||||||
FallbackChar = (ImWchar)-1;
|
FallbackChar = (ImWchar)-1;
|
||||||
EllipsisChar = (ImWchar)-1;
|
EllipsisChar = (ImWchar)-1;
|
||||||
DotChar = (ImWchar)-1;
|
EllipsisWidth = EllipsisCharStep = 0.0f;
|
||||||
|
EllipsisCharCount = 0;
|
||||||
FallbackGlyph = NULL;
|
FallbackGlyph = NULL;
|
||||||
ContainerAtlas = NULL;
|
ContainerAtlas = NULL;
|
||||||
ConfigData = NULL;
|
ConfigData = NULL;
|
||||||
@@ -3190,17 +3258,7 @@ void ImFont::BuildLookupTable()
|
|||||||
SetGlyphVisible((ImWchar)' ', false);
|
SetGlyphVisible((ImWchar)' ', false);
|
||||||
SetGlyphVisible((ImWchar)'\t', false);
|
SetGlyphVisible((ImWchar)'\t', false);
|
||||||
|
|
||||||
// Ellipsis character is required for rendering elided text. We prefer using U+2026 (horizontal ellipsis).
|
// Setup Fallback character
|
||||||
// However some old fonts may contain ellipsis at U+0085. Here we auto-detect most suitable ellipsis character.
|
|
||||||
// FIXME: Note that 0x2026 is rarely included in our font ranges. Because of this we are more likely to use three individual dots.
|
|
||||||
const ImWchar ellipsis_chars[] = { (ImWchar)0x2026, (ImWchar)0x0085 };
|
|
||||||
const ImWchar dots_chars[] = { (ImWchar)'.', (ImWchar)0xFF0E };
|
|
||||||
if (EllipsisChar == (ImWchar)-1)
|
|
||||||
EllipsisChar = FindFirstExistingGlyph(this, ellipsis_chars, IM_ARRAYSIZE(ellipsis_chars));
|
|
||||||
if (DotChar == (ImWchar)-1)
|
|
||||||
DotChar = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars));
|
|
||||||
|
|
||||||
// Setup fallback character
|
|
||||||
const ImWchar fallback_chars[] = { (ImWchar)IM_UNICODE_CODEPOINT_INVALID, (ImWchar)'?', (ImWchar)' ' };
|
const ImWchar fallback_chars[] = { (ImWchar)IM_UNICODE_CODEPOINT_INVALID, (ImWchar)'?', (ImWchar)' ' };
|
||||||
FallbackGlyph = FindGlyphNoFallback(FallbackChar);
|
FallbackGlyph = FindGlyphNoFallback(FallbackChar);
|
||||||
if (FallbackGlyph == NULL)
|
if (FallbackGlyph == NULL)
|
||||||
@@ -3213,11 +3271,32 @@ void ImFont::BuildLookupTable()
|
|||||||
FallbackChar = (ImWchar)FallbackGlyph->Codepoint;
|
FallbackChar = (ImWchar)FallbackGlyph->Codepoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FallbackAdvanceX = FallbackGlyph->AdvanceX;
|
FallbackAdvanceX = FallbackGlyph->AdvanceX;
|
||||||
for (int i = 0; i < max_codepoint + 1; i++)
|
for (int i = 0; i < max_codepoint + 1; i++)
|
||||||
if (IndexAdvanceX[i] < 0.0f)
|
if (IndexAdvanceX[i] < 0.0f)
|
||||||
IndexAdvanceX[i] = FallbackAdvanceX;
|
IndexAdvanceX[i] = FallbackAdvanceX;
|
||||||
|
|
||||||
|
// Setup Ellipsis character. It is required for rendering elided text. We prefer using U+2026 (horizontal ellipsis).
|
||||||
|
// However some old fonts may contain ellipsis at U+0085. Here we auto-detect most suitable ellipsis character.
|
||||||
|
// FIXME: Note that 0x2026 is rarely included in our font ranges. Because of this we are more likely to use three individual dots.
|
||||||
|
const ImWchar ellipsis_chars[] = { (ImWchar)0x2026, (ImWchar)0x0085 };
|
||||||
|
const ImWchar dots_chars[] = { (ImWchar)'.', (ImWchar)0xFF0E };
|
||||||
|
if (EllipsisChar == (ImWchar)-1)
|
||||||
|
EllipsisChar = FindFirstExistingGlyph(this, ellipsis_chars, IM_ARRAYSIZE(ellipsis_chars));
|
||||||
|
const ImWchar dot_char = FindFirstExistingGlyph(this, dots_chars, IM_ARRAYSIZE(dots_chars));
|
||||||
|
if (EllipsisChar != (ImWchar)-1)
|
||||||
|
{
|
||||||
|
EllipsisCharCount = 1;
|
||||||
|
EllipsisWidth = EllipsisCharStep = FindGlyph(EllipsisChar)->X1;
|
||||||
|
}
|
||||||
|
else if (dot_char != (ImWchar)-1)
|
||||||
|
{
|
||||||
|
const ImFontGlyph* glyph = FindGlyph(dot_char);
|
||||||
|
EllipsisChar = dot_char;
|
||||||
|
EllipsisCharCount = 3;
|
||||||
|
EllipsisCharStep = (glyph->X1 - glyph->X0) + 1.0f;
|
||||||
|
EllipsisWidth = EllipsisCharStep * 3.0f - 1.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// API is designed this way to avoid exposing the 4K page size
|
// API is designed this way to avoid exposing the 4K page size
|
||||||
@@ -3330,11 +3409,21 @@ const ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c) const
|
|||||||
return &Glyphs.Data[i];
|
return &Glyphs.Data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrapping skips upcoming blanks
|
||||||
|
static inline const char* CalcWordWrapNextLineStartA(const char* text, const char* text_end)
|
||||||
|
{
|
||||||
|
while (text < text_end && ImCharIsBlankA(*text))
|
||||||
|
text++;
|
||||||
|
if (*text == '\n')
|
||||||
|
text++;
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Simple word-wrapping for English, not full-featured. Please submit failing cases!
|
||||||
|
// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.
|
||||||
|
// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
|
||||||
const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
|
const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
|
||||||
{
|
{
|
||||||
// Simple word-wrapping for English, not full-featured. Please submit failing cases!
|
|
||||||
// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
|
|
||||||
|
|
||||||
// For references, possible wrap point marked with ^
|
// For references, possible wrap point marked with ^
|
||||||
// "aaa bbb, ccc,ddd. eee fff. ggg!"
|
// "aaa bbb, ccc,ddd. eee fff. ggg!"
|
||||||
// ^ ^ ^ ^ ^__ ^ ^
|
// ^ ^ ^ ^ ^__ ^ ^
|
||||||
@@ -3346,7 +3435,6 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
|||||||
|
|
||||||
// Cut words that cannot possibly fit within one line.
|
// Cut words that cannot possibly fit within one line.
|
||||||
// e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish"
|
// e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish"
|
||||||
|
|
||||||
float line_width = 0.0f;
|
float line_width = 0.0f;
|
||||||
float word_width = 0.0f;
|
float word_width = 0.0f;
|
||||||
float blank_width = 0.0f;
|
float blank_width = 0.0f;
|
||||||
@@ -3357,6 +3445,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
|||||||
bool inside_word = true;
|
bool inside_word = true;
|
||||||
|
|
||||||
const char* s = text;
|
const char* s = text;
|
||||||
|
IM_ASSERT(text_end != NULL);
|
||||||
while (s < text_end)
|
while (s < text_end)
|
||||||
{
|
{
|
||||||
unsigned int c = (unsigned int)*s;
|
unsigned int c = (unsigned int)*s;
|
||||||
@@ -3365,8 +3454,6 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
|||||||
next_s = s + 1;
|
next_s = s + 1;
|
||||||
else
|
else
|
||||||
next_s = s + ImTextCharFromUtf8(&c, s, text_end);
|
next_s = s + ImTextCharFromUtf8(&c, s, text_end);
|
||||||
if (c == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (c < 32)
|
if (c < 32)
|
||||||
{
|
{
|
||||||
@@ -3426,6 +3513,10 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
|||||||
s = next_s;
|
s = next_s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
|
||||||
|
// +1 may not be a character start point in UTF-8 but it's ok because caller loops use (text >= word_wrap_eol).
|
||||||
|
if (s == text && text < text_end)
|
||||||
|
return s + 1;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3450,11 +3541,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
|||||||
{
|
{
|
||||||
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
|
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
|
||||||
if (!word_wrap_eol)
|
if (!word_wrap_eol)
|
||||||
{
|
|
||||||
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width);
|
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width);
|
||||||
if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
|
|
||||||
word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s >= word_wrap_eol)
|
if (s >= word_wrap_eol)
|
||||||
{
|
{
|
||||||
@@ -3463,13 +3550,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
|||||||
text_size.y += line_height;
|
text_size.y += line_height;
|
||||||
line_width = 0.0f;
|
line_width = 0.0f;
|
||||||
word_wrap_eol = NULL;
|
word_wrap_eol = NULL;
|
||||||
|
s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks
|
||||||
// Wrapping skips upcoming blanks
|
|
||||||
while (s < text_end)
|
|
||||||
{
|
|
||||||
const char c = *s;
|
|
||||||
if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3478,15 +3559,9 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
|
|||||||
const char* prev_s = s;
|
const char* prev_s = s;
|
||||||
unsigned int c = (unsigned int)*s;
|
unsigned int c = (unsigned int)*s;
|
||||||
if (c < 0x80)
|
if (c < 0x80)
|
||||||
{
|
|
||||||
s += 1;
|
s += 1;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
s += ImTextCharFromUtf8(&c, s, text_end);
|
s += ImTextCharFromUtf8(&c, s, text_end);
|
||||||
if (c == 0) // Malformed UTF-8?
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c < 32)
|
if (c < 32)
|
||||||
{
|
{
|
||||||
@@ -3554,15 +3629,25 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
|||||||
const float scale = size / FontSize;
|
const float scale = size / FontSize;
|
||||||
const float line_height = FontSize * scale;
|
const float line_height = FontSize * scale;
|
||||||
const bool word_wrap_enabled = (wrap_width > 0.0f);
|
const bool word_wrap_enabled = (wrap_width > 0.0f);
|
||||||
const char* word_wrap_eol = NULL;
|
|
||||||
|
|
||||||
// Fast-forward to first visible line
|
// Fast-forward to first visible line
|
||||||
const char* s = text_begin;
|
const char* s = text_begin;
|
||||||
if (y + line_height < clip_rect.y && !word_wrap_enabled)
|
if (y + line_height < clip_rect.y)
|
||||||
while (y + line_height < clip_rect.y && s < text_end)
|
while (y + line_height < clip_rect.y && s < text_end)
|
||||||
{
|
{
|
||||||
s = (const char*)memchr(s, '\n', text_end - s);
|
const char* line_end = (const char*)memchr(s, '\n', text_end - s);
|
||||||
s = s ? s + 1 : text_end;
|
if (word_wrap_enabled)
|
||||||
|
{
|
||||||
|
// FIXME-OPT: This is not optimal as do first do a search for \n before calling CalcWordWrapPositionA().
|
||||||
|
// If the specs for CalcWordWrapPositionA() were reworked to optionally return on \n we could combine both.
|
||||||
|
// However it is still better than nothing performing the fast-forward!
|
||||||
|
s = CalcWordWrapPositionA(scale, s, line_end ? line_end : text_end, wrap_width);
|
||||||
|
s = CalcWordWrapNextLineStartA(s, text_end);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s = line_end ? line_end + 1 : text_end;
|
||||||
|
}
|
||||||
y += line_height;
|
y += line_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3588,12 +3673,12 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
|||||||
const int idx_count_max = (int)(text_end - s) * 6;
|
const int idx_count_max = (int)(text_end - s) * 6;
|
||||||
const int idx_expected_size = draw_list->IdxBuffer.Size + idx_count_max;
|
const int idx_expected_size = draw_list->IdxBuffer.Size + idx_count_max;
|
||||||
draw_list->PrimReserve(idx_count_max, vtx_count_max);
|
draw_list->PrimReserve(idx_count_max, vtx_count_max);
|
||||||
|
ImDrawVert* vtx_write = draw_list->_VtxWritePtr;
|
||||||
ImDrawVert* vtx_write = draw_list->_VtxWritePtr;
|
ImDrawIdx* idx_write = draw_list->_IdxWritePtr;
|
||||||
ImDrawIdx* idx_write = draw_list->_IdxWritePtr;
|
unsigned int vtx_index = draw_list->_VtxCurrentIdx;
|
||||||
unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx;
|
|
||||||
|
|
||||||
const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
|
const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
|
||||||
|
const char* word_wrap_eol = NULL;
|
||||||
|
|
||||||
while (s < text_end)
|
while (s < text_end)
|
||||||
{
|
{
|
||||||
@@ -3601,24 +3686,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
|||||||
{
|
{
|
||||||
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
|
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
|
||||||
if (!word_wrap_eol)
|
if (!word_wrap_eol)
|
||||||
{
|
|
||||||
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - start_x));
|
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - start_x));
|
||||||
if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
|
|
||||||
word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
|
|
||||||
}
|
|
||||||
|
|
||||||
if (s >= word_wrap_eol)
|
if (s >= word_wrap_eol)
|
||||||
{
|
{
|
||||||
x = start_x;
|
x = start_x;
|
||||||
y += line_height;
|
y += line_height;
|
||||||
word_wrap_eol = NULL;
|
word_wrap_eol = NULL;
|
||||||
|
s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks
|
||||||
// Wrapping skips upcoming blanks
|
|
||||||
while (s < text_end)
|
|
||||||
{
|
|
||||||
const char c = *s;
|
|
||||||
if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3626,15 +3701,9 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
|||||||
// Decode and advance source
|
// Decode and advance source
|
||||||
unsigned int c = (unsigned int)*s;
|
unsigned int c = (unsigned int)*s;
|
||||||
if (c < 0x80)
|
if (c < 0x80)
|
||||||
{
|
|
||||||
s += 1;
|
s += 1;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
s += ImTextCharFromUtf8(&c, s, text_end);
|
s += ImTextCharFromUtf8(&c, s, text_end);
|
||||||
if (c == 0) // Malformed UTF-8?
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (c < 32)
|
if (c < 32)
|
||||||
{
|
{
|
||||||
@@ -3705,14 +3774,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
|||||||
|
|
||||||
// We are NOT calling PrimRectUV() here because non-inlined causes too much overhead in a debug builds. Inlined here:
|
// We are NOT calling PrimRectUV() here because non-inlined causes too much overhead in a debug builds. Inlined here:
|
||||||
{
|
{
|
||||||
idx_write[0] = (ImDrawIdx)(vtx_current_idx); idx_write[1] = (ImDrawIdx)(vtx_current_idx+1); idx_write[2] = (ImDrawIdx)(vtx_current_idx+2);
|
|
||||||
idx_write[3] = (ImDrawIdx)(vtx_current_idx); idx_write[4] = (ImDrawIdx)(vtx_current_idx+2); idx_write[5] = (ImDrawIdx)(vtx_current_idx+3);
|
|
||||||
vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = glyph_col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1;
|
vtx_write[0].pos.x = x1; vtx_write[0].pos.y = y1; vtx_write[0].col = glyph_col; vtx_write[0].uv.x = u1; vtx_write[0].uv.y = v1;
|
||||||
vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = glyph_col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1;
|
vtx_write[1].pos.x = x2; vtx_write[1].pos.y = y1; vtx_write[1].col = glyph_col; vtx_write[1].uv.x = u2; vtx_write[1].uv.y = v1;
|
||||||
vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = glyph_col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2;
|
vtx_write[2].pos.x = x2; vtx_write[2].pos.y = y2; vtx_write[2].col = glyph_col; vtx_write[2].uv.x = u2; vtx_write[2].uv.y = v2;
|
||||||
vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = glyph_col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2;
|
vtx_write[3].pos.x = x1; vtx_write[3].pos.y = y2; vtx_write[3].col = glyph_col; vtx_write[3].uv.x = u1; vtx_write[3].uv.y = v2;
|
||||||
|
idx_write[0] = (ImDrawIdx)(vtx_index); idx_write[1] = (ImDrawIdx)(vtx_index + 1); idx_write[2] = (ImDrawIdx)(vtx_index + 2);
|
||||||
|
idx_write[3] = (ImDrawIdx)(vtx_index); idx_write[4] = (ImDrawIdx)(vtx_index + 2); idx_write[5] = (ImDrawIdx)(vtx_index + 3);
|
||||||
vtx_write += 4;
|
vtx_write += 4;
|
||||||
vtx_current_idx += 4;
|
vtx_index += 4;
|
||||||
idx_write += 6;
|
idx_write += 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3726,7 +3795,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, Im
|
|||||||
draw_list->CmdBuffer[draw_list->CmdBuffer.Size - 1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size);
|
draw_list->CmdBuffer[draw_list->CmdBuffer.Size - 1].ElemCount -= (idx_expected_size - draw_list->IdxBuffer.Size);
|
||||||
draw_list->_VtxWritePtr = vtx_write;
|
draw_list->_VtxWritePtr = vtx_write;
|
||||||
draw_list->_IdxWritePtr = idx_write;
|
draw_list->_IdxWritePtr = idx_write;
|
||||||
draw_list->_VtxCurrentIdx = vtx_current_idx;
|
draw_list->_VtxCurrentIdx = vtx_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -3778,6 +3847,7 @@ void ImGui::RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir d
|
|||||||
|
|
||||||
void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col)
|
void ImGui::RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col)
|
||||||
{
|
{
|
||||||
|
// FIXME-OPT: This should be baked in font.
|
||||||
draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8);
|
draw_list->AddCircleFilled(pos, draw_list->_Data->FontSize * 0.20f, col, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+144
-73
@@ -5,7 +5,12 @@
|
|||||||
|
|
||||||
// Implemented features:
|
// Implemented features:
|
||||||
// [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID!
|
// [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID!
|
||||||
// [x] Renderer: Desktop GL only: Support for large meshes (64k+ vertices) with 16-bit indices.
|
// [x] Renderer: Large meshes support (64k+ vertices) with 16-bit indices (Desktop OpenGL only).
|
||||||
|
|
||||||
|
// About WebGL/ES:
|
||||||
|
// - You need to '#define IMGUI_IMPL_OPENGL_ES2' or '#define IMGUI_IMPL_OPENGL_ES3' to use WebGL or OpenGL ES.
|
||||||
|
// - This is done automatically on iOS, Android and Emscripten targets.
|
||||||
|
// - For other targets, the define needs to be visible from the imgui_impl_opengl3.cpp compilation unit. If unsure, define globally or in imconfig.h.
|
||||||
|
|
||||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||||
@@ -14,8 +19,17 @@
|
|||||||
|
|
||||||
// CHANGELOG
|
// CHANGELOG
|
||||||
// (minor and older changes stripped away, please see git history for details)
|
// (minor and older changes stripped away, please see git history for details)
|
||||||
|
// 2023-06-20: OpenGL: Fixed erroneous use glGetIntegerv(GL_CONTEXT_PROFILE_MASK) on contexts lower than 3.2. (#6539, #6333)
|
||||||
|
// 2023-05-09: OpenGL: Support for glBindSampler() backup/restore on ES3. (#6375)
|
||||||
|
// 2023-04-18: OpenGL: Restore front and back polygon mode separately when supported by context. (#6333)
|
||||||
|
// 2023-03-23: OpenGL: Properly restoring "no shader program bound" if it was the case prior to running the rendering function. (#6267, #6220, #6224)
|
||||||
|
// 2023-03-15: OpenGL: Fixed GL loader crash when GL_VERSION returns NULL. (#6154, #4445, #3530)
|
||||||
|
// 2023-03-06: OpenGL: Fixed restoration of a potentially deleted OpenGL program, by calling glIsProgram(). (#6220, #6224)
|
||||||
|
// 2022-11-09: OpenGL: Reverted use of glBufferSubData(), too many corruptions issues + old issues seemingly can't be reproed with Intel drivers nowadays (revert 2021-12-15 and 2022-05-23 changes).
|
||||||
|
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
|
||||||
|
// 2022-09-27: OpenGL: Added ability to '#define IMGUI_IMPL_OPENGL_DEBUG'.
|
||||||
// 2022-05-23: OpenGL: Reworking 2021-12-15 "Using buffer orphaning" so it only happens on Intel GPU, seems to cause problems otherwise. (#4468, #4825, #4832, #5127).
|
// 2022-05-23: OpenGL: Reworking 2021-12-15 "Using buffer orphaning" so it only happens on Intel GPU, seems to cause problems otherwise. (#4468, #4825, #4832, #5127).
|
||||||
// 2022-05-13: OpenGL: Fix state corruption on OpenGL ES 2.0 due to not preserving GL_ELEMENT_ARRAY_BUFFER_BINDING and vertex attribute states.
|
// 2022-05-13: OpenGL: Fixed state corruption on OpenGL ES 2.0 due to not preserving GL_ELEMENT_ARRAY_BUFFER_BINDING and vertex attribute states.
|
||||||
// 2021-12-15: OpenGL: Using buffer orphaning + glBufferSubData(), seems to fix leaks with multi-viewports with some Intel HD drivers.
|
// 2021-12-15: OpenGL: Using buffer orphaning + glBufferSubData(), seems to fix leaks with multi-viewports with some Intel HD drivers.
|
||||||
// 2021-08-23: OpenGL: Fixed ES 3.0 shader ("#version 300 es") use normal precision floats to avoid wobbly rendering at HD resolutions.
|
// 2021-08-23: OpenGL: Fixed ES 3.0 shader ("#version 300 es") use normal precision floats to avoid wobbly rendering at HD resolutions.
|
||||||
// 2021-08-19: OpenGL: Embed and use our own minimal GL loader (imgui_impl_opengl3_loader.h), removing requirement and support for third-party loader.
|
// 2021-08-19: OpenGL: Embed and use our own minimal GL loader (imgui_impl_opengl3_loader.h), removing requirement and support for third-party loader.
|
||||||
@@ -56,7 +70,7 @@
|
|||||||
// 2018-06-08: Misc: Extracted imgui_impl_opengl3.cpp/.h away from the old combined GLFW/SDL+OpenGL3 examples.
|
// 2018-06-08: Misc: Extracted imgui_impl_opengl3.cpp/.h away from the old combined GLFW/SDL+OpenGL3 examples.
|
||||||
// 2018-06-08: OpenGL: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle.
|
// 2018-06-08: OpenGL: Use draw_data->DisplayPos and draw_data->DisplaySize to setup projection matrix and clipping rectangle.
|
||||||
// 2018-05-25: OpenGL: Removed unnecessary backup/restore of GL_ELEMENT_ARRAY_BUFFER_BINDING since this is part of the VAO state.
|
// 2018-05-25: OpenGL: Removed unnecessary backup/restore of GL_ELEMENT_ARRAY_BUFFER_BINDING since this is part of the VAO state.
|
||||||
// 2018-05-14: OpenGL: Making the call to glBindSampler() optional so 3.2 context won't fail if the function is a NULL pointer.
|
// 2018-05-14: OpenGL: Making the call to glBindSampler() optional so 3.2 context won't fail if the function is a nullptr pointer.
|
||||||
// 2018-03-06: OpenGL: Added const char* glsl_version parameter to ImGui_ImplOpenGL3_Init() so user can override the GLSL version e.g. "#version 150".
|
// 2018-03-06: OpenGL: Added const char* glsl_version parameter to ImGui_ImplOpenGL3_Init() so user can override the GLSL version e.g. "#version 150".
|
||||||
// 2018-02-23: OpenGL: Create the VAO in the render function so the setup can more easily be used with multiple shared GL context.
|
// 2018-02-23: OpenGL: Create the VAO in the render function so the setup can more easily be used with multiple shared GL context.
|
||||||
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplSdlGL3_RenderDrawData() in the .h file so you can call it yourself.
|
// 2018-02-16: Misc: Obsoleted the io.RenderDrawListsFn callback and exposed ImGui_ImplSdlGL3_RenderDrawData() in the .h file so you can call it yourself.
|
||||||
@@ -90,25 +104,28 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
|
#ifndef IMGUI_DISABLE
|
||||||
#include "imgui_impl_opengl3.h"
|
#include "imgui_impl_opengl3.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
|
||||||
#include <stddef.h> // intptr_t
|
|
||||||
#else
|
|
||||||
#include <stdint.h> // intptr_t
|
#include <stdint.h> // intptr_t
|
||||||
#endif
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
#include <TargetConditionals.h>
|
#include <TargetConditionals.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Clang warnings with -Weverything
|
// Clang/GCC warnings with -Weverything
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast
|
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast
|
||||||
#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
|
#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
|
||||||
#if __has_warning("-Wzero-as-null-pointer-constant")
|
#pragma clang diagnostic ignored "-Wunused-macros" // warning: macro is not used
|
||||||
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
#pragma clang diagnostic ignored "-Wnonportable-system-include-path"
|
||||||
|
#pragma clang diagnostic ignored "-Wcast-function-type" // warning: cast between incompatible function types (for loader)
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||||
|
#pragma GCC diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx'
|
||||||
|
#pragma GCC diagnostic ignored "-Wcast-function-type" // warning: cast between incompatible function types (for loader)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GL includes
|
// GL includes
|
||||||
@@ -163,8 +180,8 @@
|
|||||||
#define IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
#define IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Desktop GL 3.3+ has glBindSampler()
|
// Desktop GL 3.3+ and GL ES 3.0+ have glBindSampler()
|
||||||
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && defined(GL_VERSION_3_3)
|
#if !defined(IMGUI_IMPL_OPENGL_ES2) && (defined(IMGUI_IMPL_OPENGL_ES3) || defined(GL_VERSION_3_3))
|
||||||
#define IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
#define IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -178,11 +195,24 @@
|
|||||||
#define IMGUI_IMPL_OPENGL_MAY_HAVE_EXTENSIONS
|
#define IMGUI_IMPL_OPENGL_MAY_HAVE_EXTENSIONS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// [Debugging]
|
||||||
|
//#define IMGUI_IMPL_OPENGL_DEBUG
|
||||||
|
#ifdef IMGUI_IMPL_OPENGL_DEBUG
|
||||||
|
#include <stdio.h>
|
||||||
|
#define GL_CALL(_CALL) do { _CALL; GLenum gl_err = glGetError(); if (gl_err != 0) fprintf(stderr, "GL error 0x%x returned from '%s'.\n", gl_err, #_CALL); } while (0) // Call with error check
|
||||||
|
#else
|
||||||
|
#define GL_CALL(_CALL) _CALL // Call without error check
|
||||||
|
#endif
|
||||||
|
|
||||||
// OpenGL Data
|
// OpenGL Data
|
||||||
struct ImGui_ImplOpenGL3_Data
|
struct ImGui_ImplOpenGL3_Data
|
||||||
{
|
{
|
||||||
GLuint GlVersion; // Extracted at runtime using GL_MAJOR_VERSION, GL_MINOR_VERSION queries (e.g. 320 for GL 3.2)
|
GLuint GlVersion; // Extracted at runtime using GL_MAJOR_VERSION, GL_MINOR_VERSION queries (e.g. 320 for GL 3.2)
|
||||||
char GlslVersionString[32]; // Specified by user or detected based on compile time GL settings.
|
char GlslVersionString[32]; // Specified by user or detected based on compile time GL settings.
|
||||||
|
bool GlProfileIsES2;
|
||||||
|
bool GlProfileIsES3;
|
||||||
|
bool GlProfileIsCompat;
|
||||||
|
GLint GlProfileMask;
|
||||||
GLuint FontTexture;
|
GLuint FontTexture;
|
||||||
GLuint ShaderHandle;
|
GLuint ShaderHandle;
|
||||||
GLint AttribLocationTex; // Uniforms location
|
GLint AttribLocationTex; // Uniforms location
|
||||||
@@ -203,7 +233,7 @@ struct ImGui_ImplOpenGL3_Data
|
|||||||
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
|
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
|
||||||
static ImGui_ImplOpenGL3_Data* ImGui_ImplOpenGL3_GetBackendData()
|
static ImGui_ImplOpenGL3_Data* ImGui_ImplOpenGL3_GetBackendData()
|
||||||
{
|
{
|
||||||
return ImGui::GetCurrentContext() ? (ImGui_ImplOpenGL3_Data*)ImGui::GetIO().BackendRendererUserData : NULL;
|
return ImGui::GetCurrentContext() ? (ImGui_ImplOpenGL3_Data*)ImGui::GetIO().BackendRendererUserData : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenGL vertex attribute state (for ES 1.0 and ES 2.0 only)
|
// OpenGL vertex attribute state (for ES 1.0 and ES 2.0 only)
|
||||||
@@ -234,7 +264,7 @@ struct ImGui_ImplOpenGL3_VtxAttribState
|
|||||||
bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
IM_ASSERT(io.BackendRendererUserData == NULL && "Already initialized a renderer backend!");
|
IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
|
||||||
|
|
||||||
// Initialize our loader
|
// Initialize our loader
|
||||||
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
|
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3) && !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
|
||||||
@@ -251,7 +281,12 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||||||
io.BackendRendererName = "imgui_impl_opengl3";
|
io.BackendRendererName = "imgui_impl_opengl3";
|
||||||
|
|
||||||
// Query for GL version (e.g. 320 for GL 3.2)
|
// Query for GL version (e.g. 320 for GL 3.2)
|
||||||
#if !defined(IMGUI_IMPL_OPENGL_ES2)
|
#if defined(IMGUI_IMPL_OPENGL_ES2)
|
||||||
|
// GLES 2
|
||||||
|
bd->GlVersion = 200;
|
||||||
|
bd->GlProfileIsES2 = true;
|
||||||
|
#else
|
||||||
|
// Desktop or GLES 3
|
||||||
GLint major = 0;
|
GLint major = 0;
|
||||||
GLint minor = 0;
|
GLint minor = 0;
|
||||||
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
||||||
@@ -263,16 +298,29 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||||||
sscanf(gl_version, "%d.%d", &major, &minor);
|
sscanf(gl_version, "%d.%d", &major, &minor);
|
||||||
}
|
}
|
||||||
bd->GlVersion = (GLuint)(major * 100 + minor * 10);
|
bd->GlVersion = (GLuint)(major * 100 + minor * 10);
|
||||||
|
#if defined(GL_CONTEXT_PROFILE_MASK)
|
||||||
|
if (bd->GlVersion >= 320)
|
||||||
|
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &bd->GlProfileMask);
|
||||||
|
bd->GlProfileIsCompat = (bd->GlProfileMask & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT) != 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(IMGUI_IMPL_OPENGL_ES3)
|
||||||
|
bd->GlProfileIsES3 = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bd->UseBufferSubData = false;
|
||||||
|
/*
|
||||||
// Query vendor to enable glBufferSubData kludge
|
// Query vendor to enable glBufferSubData kludge
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (const char* vendor = (const char*)glGetString(GL_VENDOR))
|
if (const char* vendor = (const char*)glGetString(GL_VENDOR))
|
||||||
if (strncmp(vendor, "Intel", 5) == 0)
|
if (strncmp(vendor, "Intel", 5) == 0)
|
||||||
bd->UseBufferSubData = true;
|
bd->UseBufferSubData = true;
|
||||||
#endif
|
#endif
|
||||||
//printf("GL_MAJOR_VERSION = %d\nGL_MINOR_VERSION = %d\nGL_VENDOR = '%s'\nGL_RENDERER = '%s'\n", major, minor, (const char*)glGetString(GL_VENDOR), (const char*)glGetString(GL_RENDERER)); // [DEBUG]
|
*/
|
||||||
#else
|
#endif
|
||||||
bd->GlVersion = 200; // GLES 2
|
|
||||||
|
#ifdef IMGUI_IMPL_OPENGL_DEBUG
|
||||||
|
printf("GlVersion = %d\nGlProfileIsCompat = %d\nGlProfileMask = 0x%X\nGlProfileIsES2 = %d, GlProfileIsES3 = %d\nGL_VENDOR = '%s'\nGL_RENDERER = '%s'\n", bd->GlVersion, bd->GlProfileIsCompat, bd->GlProfileMask, bd->GlProfileIsES2, bd->GlProfileIsES3, (const char*)glGetString(GL_VENDOR), (const char*)glGetString(GL_RENDERER)); // [DEBUG]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
||||||
@@ -281,8 +329,8 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Store GLSL version string so we can refer to it later in case we recreate shaders.
|
// Store GLSL version string so we can refer to it later in case we recreate shaders.
|
||||||
// Note: GLSL version is NOT the same as GL version. Leave this to NULL if unsure.
|
// Note: GLSL version is NOT the same as GL version. Leave this to nullptr if unsure.
|
||||||
if (glsl_version == NULL)
|
if (glsl_version == nullptr)
|
||||||
{
|
{
|
||||||
#if defined(IMGUI_IMPL_OPENGL_ES2)
|
#if defined(IMGUI_IMPL_OPENGL_ES2)
|
||||||
glsl_version = "#version 100";
|
glsl_version = "#version 100";
|
||||||
@@ -311,7 +359,7 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||||||
for (GLint i = 0; i < num_extensions; i++)
|
for (GLint i = 0; i < num_extensions; i++)
|
||||||
{
|
{
|
||||||
const char* extension = (const char*)glGetStringi(GL_EXTENSIONS, i);
|
const char* extension = (const char*)glGetStringi(GL_EXTENSIONS, i);
|
||||||
if (extension != NULL && strcmp(extension, "GL_ARB_clip_control") == 0)
|
if (extension != nullptr && strcmp(extension, "GL_ARB_clip_control") == 0)
|
||||||
bd->HasClipOrigin = true;
|
bd->HasClipOrigin = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -322,19 +370,20 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||||||
void ImGui_ImplOpenGL3_Shutdown()
|
void ImGui_ImplOpenGL3_Shutdown()
|
||||||
{
|
{
|
||||||
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
|
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
|
||||||
IM_ASSERT(bd != NULL && "No renderer backend to shutdown, or already shutdown?");
|
IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
||||||
io.BackendRendererName = NULL;
|
io.BackendRendererName = nullptr;
|
||||||
io.BackendRendererUserData = NULL;
|
io.BackendRendererUserData = nullptr;
|
||||||
|
io.BackendFlags &= ~ImGuiBackendFlags_RendererHasVtxOffset;
|
||||||
IM_DELETE(bd);
|
IM_DELETE(bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui_ImplOpenGL3_NewFrame()
|
void ImGui_ImplOpenGL3_NewFrame()
|
||||||
{
|
{
|
||||||
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
|
ImGui_ImplOpenGL3_Data* bd = ImGui_ImplOpenGL3_GetBackendData();
|
||||||
IM_ASSERT(bd != NULL && "Did you call ImGui_ImplOpenGL3_Init()?");
|
IM_ASSERT(bd != nullptr && "Did you call ImGui_ImplOpenGL3_Init()?");
|
||||||
|
|
||||||
if (!bd->ShaderHandle)
|
if (!bd->ShaderHandle)
|
||||||
ImGui_ImplOpenGL3_CreateDeviceObjects();
|
ImGui_ImplOpenGL3_CreateDeviceObjects();
|
||||||
@@ -373,7 +422,7 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|||||||
|
|
||||||
// Setup viewport, orthographic projection matrix
|
// Setup viewport, orthographic projection matrix
|
||||||
// Our visible imgui space lies from draw_data->DisplayPos (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps.
|
// Our visible imgui space lies from draw_data->DisplayPos (top left) to draw_data->DisplayPos+data_data->DisplaySize (bottom right). DisplayPos is (0,0) for single viewport apps.
|
||||||
glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height);
|
GL_CALL(glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height));
|
||||||
float L = draw_data->DisplayPos.x;
|
float L = draw_data->DisplayPos.x;
|
||||||
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
|
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
|
||||||
float T = draw_data->DisplayPos.y;
|
float T = draw_data->DisplayPos.y;
|
||||||
@@ -393,8 +442,8 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|||||||
glUniformMatrix4fv(bd->AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
|
glUniformMatrix4fv(bd->AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
|
||||||
|
|
||||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
||||||
if (bd->GlVersion >= 330)
|
if (bd->GlVersion >= 330 || bd->GlProfileIsES3)
|
||||||
glBindSampler(0, 0); // We use combined texture/sampler state. Applications using GL 3.3 may set that otherwise.
|
glBindSampler(0, 0); // We use combined texture/sampler state. Applications using GL 3.3 and GL ES 3.0 may set that otherwise.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(void)vertex_array_object;
|
(void)vertex_array_object;
|
||||||
@@ -403,14 +452,14 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Bind vertex/index buffers and setup attributes for ImDrawVert
|
// Bind vertex/index buffers and setup attributes for ImDrawVert
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, bd->VboHandle);
|
GL_CALL(glBindBuffer(GL_ARRAY_BUFFER, bd->VboHandle));
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bd->ElementsHandle);
|
GL_CALL(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bd->ElementsHandle));
|
||||||
glEnableVertexAttribArray(bd->AttribLocationVtxPos);
|
GL_CALL(glEnableVertexAttribArray(bd->AttribLocationVtxPos));
|
||||||
glEnableVertexAttribArray(bd->AttribLocationVtxUV);
|
GL_CALL(glEnableVertexAttribArray(bd->AttribLocationVtxUV));
|
||||||
glEnableVertexAttribArray(bd->AttribLocationVtxColor);
|
GL_CALL(glEnableVertexAttribArray(bd->AttribLocationVtxColor));
|
||||||
glVertexAttribPointer(bd->AttribLocationVtxPos, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, pos));
|
GL_CALL(glVertexAttribPointer(bd->AttribLocationVtxPos, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, pos)));
|
||||||
glVertexAttribPointer(bd->AttribLocationVtxUV, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, uv));
|
GL_CALL(glVertexAttribPointer(bd->AttribLocationVtxUV, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, uv)));
|
||||||
glVertexAttribPointer(bd->AttribLocationVtxColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, col));
|
GL_CALL(glVertexAttribPointer(bd->AttribLocationVtxColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid*)IM_OFFSETOF(ImDrawVert, col)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenGL3 Render function.
|
// OpenGL3 Render function.
|
||||||
@@ -432,7 +481,7 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
GLuint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&last_program);
|
GLuint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&last_program);
|
||||||
GLuint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint*)&last_texture);
|
GLuint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint*)&last_texture);
|
||||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
||||||
GLuint last_sampler; if (bd->GlVersion >= 330) { glGetIntegerv(GL_SAMPLER_BINDING, (GLint*)&last_sampler); } else { last_sampler = 0; }
|
GLuint last_sampler; if (bd->GlVersion >= 330 || bd->GlProfileIsES3) { glGetIntegerv(GL_SAMPLER_BINDING, (GLint*)&last_sampler); } else { last_sampler = 0; }
|
||||||
#endif
|
#endif
|
||||||
GLuint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, (GLint*)&last_array_buffer);
|
GLuint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, (GLint*)&last_array_buffer);
|
||||||
#ifndef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
|
#ifndef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
|
||||||
@@ -470,7 +519,7 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
// The renderer would actually work without any VAO bound, but then our VertexAttrib calls would overwrite the default one currently bound.
|
// The renderer would actually work without any VAO bound, but then our VertexAttrib calls would overwrite the default one currently bound.
|
||||||
GLuint vertex_array_object = 0;
|
GLuint vertex_array_object = 0;
|
||||||
#ifdef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
|
#ifdef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
|
||||||
glGenVertexArrays(1, &vertex_array_object);
|
GL_CALL(glGenVertexArrays(1, &vertex_array_object));
|
||||||
#endif
|
#endif
|
||||||
ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object);
|
ImGui_ImplOpenGL3_SetupRenderState(draw_data, fb_width, fb_height, vertex_array_object);
|
||||||
|
|
||||||
@@ -484,9 +533,13 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
||||||
|
|
||||||
// Upload vertex/index buffers
|
// Upload vertex/index buffers
|
||||||
// - On Intel windows drivers we got reports that regular glBufferData() led to accumulating leaks when using multi-viewports, so we started using orphaning + glBufferSubData(). (See https://github.com/ocornut/imgui/issues/4468)
|
// - OpenGL drivers are in a very sorry state nowadays....
|
||||||
// - On NVIDIA drivers we got reports that using orphaning + glBufferSubData() led to glitches when using multi-viewports.
|
// During 2021 we attempted to switch from glBufferData() to orphaning+glBufferSubData() following reports
|
||||||
// - OpenGL drivers are in a very sorry state in 2022, for now we are switching code path based on vendors.
|
// of leaks on Intel GPU when using multi-viewports on Windows.
|
||||||
|
// - After this we kept hearing of various display corruptions issues. We started disabling on non-Intel GPU, but issues still got reported on Intel.
|
||||||
|
// - We are now back to using exclusively glBufferData(). So bd->UseBufferSubData IS ALWAYS FALSE in this code.
|
||||||
|
// We are keeping the old code path for a while in case people finding new issues may want to test the bd->UseBufferSubData path.
|
||||||
|
// - See https://github.com/ocornut/imgui/issues/4468 and please report any corruption issues.
|
||||||
const GLsizeiptr vtx_buffer_size = (GLsizeiptr)cmd_list->VtxBuffer.Size * (int)sizeof(ImDrawVert);
|
const GLsizeiptr vtx_buffer_size = (GLsizeiptr)cmd_list->VtxBuffer.Size * (int)sizeof(ImDrawVert);
|
||||||
const GLsizeiptr idx_buffer_size = (GLsizeiptr)cmd_list->IdxBuffer.Size * (int)sizeof(ImDrawIdx);
|
const GLsizeiptr idx_buffer_size = (GLsizeiptr)cmd_list->IdxBuffer.Size * (int)sizeof(ImDrawIdx);
|
||||||
if (bd->UseBufferSubData)
|
if (bd->UseBufferSubData)
|
||||||
@@ -494,26 +547,26 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
if (bd->VertexBufferSize < vtx_buffer_size)
|
if (bd->VertexBufferSize < vtx_buffer_size)
|
||||||
{
|
{
|
||||||
bd->VertexBufferSize = vtx_buffer_size;
|
bd->VertexBufferSize = vtx_buffer_size;
|
||||||
glBufferData(GL_ARRAY_BUFFER, bd->VertexBufferSize, NULL, GL_STREAM_DRAW);
|
GL_CALL(glBufferData(GL_ARRAY_BUFFER, bd->VertexBufferSize, nullptr, GL_STREAM_DRAW));
|
||||||
}
|
}
|
||||||
if (bd->IndexBufferSize < idx_buffer_size)
|
if (bd->IndexBufferSize < idx_buffer_size)
|
||||||
{
|
{
|
||||||
bd->IndexBufferSize = idx_buffer_size;
|
bd->IndexBufferSize = idx_buffer_size;
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, bd->IndexBufferSize, NULL, GL_STREAM_DRAW);
|
GL_CALL(glBufferData(GL_ELEMENT_ARRAY_BUFFER, bd->IndexBufferSize, nullptr, GL_STREAM_DRAW));
|
||||||
}
|
}
|
||||||
glBufferSubData(GL_ARRAY_BUFFER, 0, vtx_buffer_size, (const GLvoid*)cmd_list->VtxBuffer.Data);
|
GL_CALL(glBufferSubData(GL_ARRAY_BUFFER, 0, vtx_buffer_size, (const GLvoid*)cmd_list->VtxBuffer.Data));
|
||||||
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, idx_buffer_size, (const GLvoid*)cmd_list->IdxBuffer.Data);
|
GL_CALL(glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, idx_buffer_size, (const GLvoid*)cmd_list->IdxBuffer.Data));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glBufferData(GL_ARRAY_BUFFER, vtx_buffer_size, (const GLvoid*)cmd_list->VtxBuffer.Data, GL_STREAM_DRAW);
|
GL_CALL(glBufferData(GL_ARRAY_BUFFER, vtx_buffer_size, (const GLvoid*)cmd_list->VtxBuffer.Data, GL_STREAM_DRAW));
|
||||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_size, (const GLvoid*)cmd_list->IdxBuffer.Data, GL_STREAM_DRAW);
|
GL_CALL(glBufferData(GL_ELEMENT_ARRAY_BUFFER, idx_buffer_size, (const GLvoid*)cmd_list->IdxBuffer.Data, GL_STREAM_DRAW));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
|
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
|
||||||
{
|
{
|
||||||
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
|
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
|
||||||
if (pcmd->UserCallback != NULL)
|
if (pcmd->UserCallback != nullptr)
|
||||||
{
|
{
|
||||||
// User callback, registered via ImDrawList::AddCallback()
|
// User callback, registered via ImDrawList::AddCallback()
|
||||||
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
|
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
|
||||||
@@ -531,30 +584,31 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Apply scissor/clipping rectangle (Y is inverted in OpenGL)
|
// Apply scissor/clipping rectangle (Y is inverted in OpenGL)
|
||||||
glScissor((int)clip_min.x, (int)((float)fb_height - clip_max.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y));
|
GL_CALL(glScissor((int)clip_min.x, (int)((float)fb_height - clip_max.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y)));
|
||||||
|
|
||||||
// Bind texture, Draw
|
// Bind texture, Draw
|
||||||
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->GetTexID());
|
GL_CALL(glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->GetTexID()));
|
||||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_VTX_OFFSET
|
||||||
if (bd->GlVersion >= 320)
|
if (bd->GlVersion >= 320)
|
||||||
glDrawElementsBaseVertex(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, (void*)(intptr_t)(pcmd->IdxOffset * sizeof(ImDrawIdx)), (GLint)pcmd->VtxOffset);
|
GL_CALL(glDrawElementsBaseVertex(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, (void*)(intptr_t)(pcmd->IdxOffset * sizeof(ImDrawIdx)), (GLint)pcmd->VtxOffset));
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, (void*)(intptr_t)(pcmd->IdxOffset * sizeof(ImDrawIdx)));
|
GL_CALL(glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, (void*)(intptr_t)(pcmd->IdxOffset * sizeof(ImDrawIdx))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroy the temporary VAO
|
// Destroy the temporary VAO
|
||||||
#ifdef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
|
#ifdef IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
|
||||||
glDeleteVertexArrays(1, &vertex_array_object);
|
GL_CALL(glDeleteVertexArrays(1, &vertex_array_object));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Restore modified GL state
|
// Restore modified GL state
|
||||||
glUseProgram(last_program);
|
// This "glIsProgram()" check is required because if the program is "pending deletion" at the time of binding backup, it will have been deleted by now and will cause an OpenGL error. See #6220.
|
||||||
|
if (last_program == 0 || glIsProgram(last_program)) glUseProgram(last_program);
|
||||||
glBindTexture(GL_TEXTURE_2D, last_texture);
|
glBindTexture(GL_TEXTURE_2D, last_texture);
|
||||||
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
#ifdef IMGUI_IMPL_OPENGL_MAY_HAVE_BIND_SAMPLER
|
||||||
if (bd->GlVersion >= 330)
|
if (bd->GlVersion >= 330 || bd->GlProfileIsES3)
|
||||||
glBindSampler(0, last_sampler);
|
glBindSampler(0, last_sampler);
|
||||||
#endif
|
#endif
|
||||||
glActiveTexture(last_active_texture);
|
glActiveTexture(last_active_texture);
|
||||||
@@ -580,8 +634,18 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IMGUI_IMPL_HAS_POLYGON_MODE
|
#ifdef IMGUI_IMPL_HAS_POLYGON_MODE
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, (GLenum)last_polygon_mode[0]);
|
// Desktop OpenGL 3.0 and OpenGL 3.1 had separate polygon draw modes for front-facing and back-facing faces of polygons
|
||||||
#endif
|
if (bd->GlVersion <= 310 || bd->GlProfileIsCompat)
|
||||||
|
{
|
||||||
|
glPolygonMode(GL_FRONT, (GLenum)last_polygon_mode[0]);
|
||||||
|
glPolygonMode(GL_BACK, (GLenum)last_polygon_mode[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glPolygonMode(GL_FRONT_AND_BACK, (GLenum)last_polygon_mode[0]);
|
||||||
|
}
|
||||||
|
#endif // IMGUI_IMPL_HAS_POLYGON_MODE
|
||||||
|
|
||||||
glViewport(last_viewport[0], last_viewport[1], (GLsizei)last_viewport[2], (GLsizei)last_viewport[3]);
|
glViewport(last_viewport[0], last_viewport[1], (GLsizei)last_viewport[2], (GLsizei)last_viewport[3]);
|
||||||
glScissor(last_scissor_box[0], last_scissor_box[1], (GLsizei)last_scissor_box[2], (GLsizei)last_scissor_box[3]);
|
glScissor(last_scissor_box[0], last_scissor_box[1], (GLsizei)last_scissor_box[2], (GLsizei)last_scissor_box[3]);
|
||||||
(void)bd; // Not all compilation paths use this
|
(void)bd; // Not all compilation paths use this
|
||||||
@@ -600,21 +664,21 @@ bool ImGui_ImplOpenGL3_CreateFontsTexture()
|
|||||||
// Upload texture to graphics system
|
// Upload texture to graphics system
|
||||||
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
|
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
|
||||||
GLint last_texture;
|
GLint last_texture;
|
||||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
|
GL_CALL(glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture));
|
||||||
glGenTextures(1, &bd->FontTexture);
|
GL_CALL(glGenTextures(1, &bd->FontTexture));
|
||||||
glBindTexture(GL_TEXTURE_2D, bd->FontTexture);
|
GL_CALL(glBindTexture(GL_TEXTURE_2D, bd->FontTexture));
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
|
||||||
#ifdef GL_UNPACK_ROW_LENGTH // Not on WebGL/ES
|
#ifdef GL_UNPACK_ROW_LENGTH // Not on WebGL/ES
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
GL_CALL(glPixelStorei(GL_UNPACK_ROW_LENGTH, 0));
|
||||||
#endif
|
#endif
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
|
||||||
|
|
||||||
// Store our identifier
|
// Store our identifier
|
||||||
io.Fonts->SetTexID((ImTextureID)(intptr_t)bd->FontTexture);
|
io.Fonts->SetTexID((ImTextureID)(intptr_t)bd->FontTexture);
|
||||||
|
|
||||||
// Restore state
|
// Restore state
|
||||||
glBindTexture(GL_TEXTURE_2D, last_texture);
|
GL_CALL(glBindTexture(GL_TEXTURE_2D, last_texture));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -644,7 +708,7 @@ static bool CheckShader(GLuint handle, const char* desc)
|
|||||||
{
|
{
|
||||||
ImVector<char> buf;
|
ImVector<char> buf;
|
||||||
buf.resize((int)(log_length + 1));
|
buf.resize((int)(log_length + 1));
|
||||||
glGetShaderInfoLog(handle, log_length, NULL, (GLchar*)buf.begin());
|
glGetShaderInfoLog(handle, log_length, nullptr, (GLchar*)buf.begin());
|
||||||
fprintf(stderr, "%s\n", buf.begin());
|
fprintf(stderr, "%s\n", buf.begin());
|
||||||
}
|
}
|
||||||
return (GLboolean)status == GL_TRUE;
|
return (GLboolean)status == GL_TRUE;
|
||||||
@@ -663,7 +727,7 @@ static bool CheckProgram(GLuint handle, const char* desc)
|
|||||||
{
|
{
|
||||||
ImVector<char> buf;
|
ImVector<char> buf;
|
||||||
buf.resize((int)(log_length + 1));
|
buf.resize((int)(log_length + 1));
|
||||||
glGetProgramInfoLog(handle, log_length, NULL, (GLchar*)buf.begin());
|
glGetProgramInfoLog(handle, log_length, nullptr, (GLchar*)buf.begin());
|
||||||
fprintf(stderr, "%s\n", buf.begin());
|
fprintf(stderr, "%s\n", buf.begin());
|
||||||
}
|
}
|
||||||
return (GLboolean)status == GL_TRUE;
|
return (GLboolean)status == GL_TRUE;
|
||||||
@@ -787,8 +851,8 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
|
|||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
// Select shaders matching our GLSL versions
|
// Select shaders matching our GLSL versions
|
||||||
const GLchar* vertex_shader = NULL;
|
const GLchar* vertex_shader = nullptr;
|
||||||
const GLchar* fragment_shader = NULL;
|
const GLchar* fragment_shader = nullptr;
|
||||||
if (glsl_version < 130)
|
if (glsl_version < 130)
|
||||||
{
|
{
|
||||||
vertex_shader = vertex_shader_glsl_120;
|
vertex_shader = vertex_shader_glsl_120;
|
||||||
@@ -813,13 +877,13 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
|
|||||||
// Create shaders
|
// Create shaders
|
||||||
const GLchar* vertex_shader_with_version[2] = { bd->GlslVersionString, vertex_shader };
|
const GLchar* vertex_shader_with_version[2] = { bd->GlslVersionString, vertex_shader };
|
||||||
GLuint vert_handle = glCreateShader(GL_VERTEX_SHADER);
|
GLuint vert_handle = glCreateShader(GL_VERTEX_SHADER);
|
||||||
glShaderSource(vert_handle, 2, vertex_shader_with_version, NULL);
|
glShaderSource(vert_handle, 2, vertex_shader_with_version, nullptr);
|
||||||
glCompileShader(vert_handle);
|
glCompileShader(vert_handle);
|
||||||
CheckShader(vert_handle, "vertex shader");
|
CheckShader(vert_handle, "vertex shader");
|
||||||
|
|
||||||
const GLchar* fragment_shader_with_version[2] = { bd->GlslVersionString, fragment_shader };
|
const GLchar* fragment_shader_with_version[2] = { bd->GlslVersionString, fragment_shader };
|
||||||
GLuint frag_handle = glCreateShader(GL_FRAGMENT_SHADER);
|
GLuint frag_handle = glCreateShader(GL_FRAGMENT_SHADER);
|
||||||
glShaderSource(frag_handle, 2, fragment_shader_with_version, NULL);
|
glShaderSource(frag_handle, 2, fragment_shader_with_version, nullptr);
|
||||||
glCompileShader(frag_handle);
|
glCompileShader(frag_handle);
|
||||||
CheckShader(frag_handle, "fragment shader");
|
CheckShader(frag_handle, "fragment shader");
|
||||||
|
|
||||||
@@ -866,6 +930,13 @@ void ImGui_ImplOpenGL3_DestroyDeviceObjects()
|
|||||||
ImGui_ImplOpenGL3_DestroyFontsTexture();
|
ImGui_ImplOpenGL3_DestroyFontsTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef IMGUI_DISABLE
|
||||||
|
|||||||
+11
-3
@@ -5,7 +5,12 @@
|
|||||||
|
|
||||||
// Implemented features:
|
// Implemented features:
|
||||||
// [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID!
|
// [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID!
|
||||||
// [x] Renderer: Desktop GL only: Support for large meshes (64k+ vertices) with 16-bit indices.
|
// [x] Renderer: Large meshes support (64k+ vertices) with 16-bit indices (Desktop OpenGL only).
|
||||||
|
|
||||||
|
// About WebGL/ES:
|
||||||
|
// - You need to '#define IMGUI_IMPL_OPENGL_ES2' or '#define IMGUI_IMPL_OPENGL_ES3' to use WebGL or OpenGL ES.
|
||||||
|
// - This is done automatically on iOS, Android and Emscripten targets.
|
||||||
|
// - For other targets, the define needs to be visible from the imgui_impl_opengl3.cpp compilation unit. If unsure, define globally or in imconfig.h.
|
||||||
|
|
||||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||||
@@ -13,15 +18,16 @@
|
|||||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||||
|
|
||||||
// About GLSL version:
|
// About GLSL version:
|
||||||
// The 'glsl_version' initialization parameter should be NULL (default) or a "#version XXX" string.
|
// The 'glsl_version' initialization parameter should be nullptr (default) or a "#version XXX" string.
|
||||||
// On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es"
|
// On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es"
|
||||||
// Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp.
|
// Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp.
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "imgui.h" // IMGUI_IMPL_API
|
#include "imgui.h" // IMGUI_IMPL_API
|
||||||
|
#ifndef IMGUI_DISABLE
|
||||||
|
|
||||||
// Backend API
|
// Backend API
|
||||||
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
|
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = nullptr);
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame();
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame();
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
|
||||||
@@ -53,3 +59,5 @@ IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef IMGUI_DISABLE
|
||||||
|
|||||||
+26
-3
@@ -9,6 +9,14 @@
|
|||||||
// YOU SHOULD NOT NEED TO INCLUDE/USE THIS DIRECTLY. THIS IS USED BY imgui_impl_opengl3.cpp ONLY.
|
// YOU SHOULD NOT NEED TO INCLUDE/USE THIS DIRECTLY. THIS IS USED BY imgui_impl_opengl3.cpp ONLY.
|
||||||
// THE REST OF YOUR APP SHOULD USE A DIFFERENT GL LOADER: ANY GL LOADER OF YOUR CHOICE.
|
// THE REST OF YOUR APP SHOULD USE A DIFFERENT GL LOADER: ANY GL LOADER OF YOUR CHOICE.
|
||||||
//
|
//
|
||||||
|
// IF YOU GET BUILD ERRORS IN THIS FILE (commonly macro redefinitions or function redefinitions):
|
||||||
|
// IT LIKELY MEANS THAT YOU ARE BUILDING 'imgui_impl_opengl3.cpp' OR INCUDING 'imgui_impl_opengl3_loader.h'
|
||||||
|
// IN THE SAME COMPILATION UNIT AS ONE OF YOUR FILE WHICH IS USING A THIRD-PARTY OPENGL LOADER.
|
||||||
|
// (e.g. COULD HAPPEN IF YOU ARE DOING A UNITY/JUMBO BUILD, OR INCLUDING .CPP FILES FROM OTHERS)
|
||||||
|
// YOU SHOULD NOT BUILD BOTH IN THE SAME COMPILATION UNIT.
|
||||||
|
// BUT IF YOU REALLY WANT TO, you can '#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM' and imgui_impl_opengl3.cpp
|
||||||
|
// WILL NOT BE USING OUR LOADER, AND INSTEAD EXPECT ANOTHER/YOUR LOADER TO BE AVAILABLE IN THE COMPILATION UNIT.
|
||||||
|
//
|
||||||
// Regenerate with:
|
// Regenerate with:
|
||||||
// python gl3w_gen.py --output ../imgui/backends/imgui_impl_opengl3_loader.h --ref ../imgui/backends/imgui_impl_opengl3.cpp ./extra_symbols.txt
|
// python gl3w_gen.py --output ../imgui/backends/imgui_impl_opengl3_loader.h --ref ../imgui/backends/imgui_impl_opengl3.cpp ./extra_symbols.txt
|
||||||
//
|
//
|
||||||
@@ -146,6 +154,8 @@ typedef khronos_uint8_t GLubyte;
|
|||||||
#define GL_ONE 1
|
#define GL_ONE 1
|
||||||
#define GL_SRC_ALPHA 0x0302
|
#define GL_SRC_ALPHA 0x0302
|
||||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||||
|
#define GL_FRONT 0x0404
|
||||||
|
#define GL_BACK 0x0405
|
||||||
#define GL_FRONT_AND_BACK 0x0408
|
#define GL_FRONT_AND_BACK 0x0408
|
||||||
#define GL_POLYGON_MODE 0x0B40
|
#define GL_POLYGON_MODE 0x0B40
|
||||||
#define GL_CULL_FACE 0x0B44
|
#define GL_CULL_FACE 0x0B44
|
||||||
@@ -301,6 +311,7 @@ typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSi
|
|||||||
typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
|
typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
|
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
|
||||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
|
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
|
||||||
|
typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
|
||||||
typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
|
typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
|
||||||
typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||||
typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
|
typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
|
||||||
@@ -326,6 +337,7 @@ GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei
|
|||||||
GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
|
GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
|
||||||
GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
|
GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
|
||||||
GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
|
GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
|
||||||
|
GLAPI GLboolean APIENTRY glIsProgram (GLuint program);
|
||||||
GLAPI void APIENTRY glLinkProgram (GLuint program);
|
GLAPI void APIENTRY glLinkProgram (GLuint program);
|
||||||
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||||
GLAPI void APIENTRY glUseProgram (GLuint program);
|
GLAPI void APIENTRY glUseProgram (GLuint program);
|
||||||
@@ -363,6 +375,8 @@ GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays);
|
|||||||
typedef struct __GLsync *GLsync;
|
typedef struct __GLsync *GLsync;
|
||||||
typedef khronos_uint64_t GLuint64;
|
typedef khronos_uint64_t GLuint64;
|
||||||
typedef khronos_int64_t GLint64;
|
typedef khronos_int64_t GLint64;
|
||||||
|
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
|
||||||
|
#define GL_CONTEXT_PROFILE_MASK 0x9126
|
||||||
typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
|
||||||
typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
||||||
#ifdef GL_GLEXT_PROTOTYPES
|
#ifdef GL_GLEXT_PROTOTYPES
|
||||||
@@ -454,7 +468,7 @@ GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc);
|
|||||||
|
|
||||||
/* gl3w internal state */
|
/* gl3w internal state */
|
||||||
union GL3WProcs {
|
union GL3WProcs {
|
||||||
GL3WglProc ptr[58];
|
GL3WglProc ptr[59];
|
||||||
struct {
|
struct {
|
||||||
PFNGLACTIVETEXTUREPROC ActiveTexture;
|
PFNGLACTIVETEXTUREPROC ActiveTexture;
|
||||||
PFNGLATTACHSHADERPROC AttachShader;
|
PFNGLATTACHSHADERPROC AttachShader;
|
||||||
@@ -501,6 +515,7 @@ union GL3WProcs {
|
|||||||
PFNGLGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv;
|
PFNGLGETVERTEXATTRIBPOINTERVPROC GetVertexAttribPointerv;
|
||||||
PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv;
|
PFNGLGETVERTEXATTRIBIVPROC GetVertexAttribiv;
|
||||||
PFNGLISENABLEDPROC IsEnabled;
|
PFNGLISENABLEDPROC IsEnabled;
|
||||||
|
PFNGLISPROGRAMPROC IsProgram;
|
||||||
PFNGLLINKPROGRAMPROC LinkProgram;
|
PFNGLLINKPROGRAMPROC LinkProgram;
|
||||||
PFNGLPIXELSTOREIPROC PixelStorei;
|
PFNGLPIXELSTOREIPROC PixelStorei;
|
||||||
PFNGLPOLYGONMODEPROC PolygonMode;
|
PFNGLPOLYGONMODEPROC PolygonMode;
|
||||||
@@ -565,6 +580,7 @@ GL3W_API extern union GL3WProcs imgl3wProcs;
|
|||||||
#define glGetVertexAttribPointerv imgl3wProcs.gl.GetVertexAttribPointerv
|
#define glGetVertexAttribPointerv imgl3wProcs.gl.GetVertexAttribPointerv
|
||||||
#define glGetVertexAttribiv imgl3wProcs.gl.GetVertexAttribiv
|
#define glGetVertexAttribiv imgl3wProcs.gl.GetVertexAttribiv
|
||||||
#define glIsEnabled imgl3wProcs.gl.IsEnabled
|
#define glIsEnabled imgl3wProcs.gl.IsEnabled
|
||||||
|
#define glIsProgram imgl3wProcs.gl.IsProgram
|
||||||
#define glLinkProgram imgl3wProcs.gl.LinkProgram
|
#define glLinkProgram imgl3wProcs.gl.LinkProgram
|
||||||
#define glPixelStorei imgl3wProcs.gl.PixelStorei
|
#define glPixelStorei imgl3wProcs.gl.PixelStorei
|
||||||
#define glPolygonMode imgl3wProcs.gl.PolygonMode
|
#define glPolygonMode imgl3wProcs.gl.PolygonMode
|
||||||
@@ -677,7 +693,13 @@ static int parse_version(void)
|
|||||||
return GL3W_ERROR_INIT;
|
return GL3W_ERROR_INIT;
|
||||||
glGetIntegerv(GL_MAJOR_VERSION, &version.major);
|
glGetIntegerv(GL_MAJOR_VERSION, &version.major);
|
||||||
glGetIntegerv(GL_MINOR_VERSION, &version.minor);
|
glGetIntegerv(GL_MINOR_VERSION, &version.minor);
|
||||||
if (version.major < 3)
|
if (version.major == 0 && version.minor == 0)
|
||||||
|
{
|
||||||
|
// Query GL_VERSION in desktop GL 2.x, the string will start with "<major>.<minor>"
|
||||||
|
if (const char* gl_version = (const char*)glGetString(GL_VERSION))
|
||||||
|
sscanf(gl_version, "%d.%d", &version.major, &version.minor);
|
||||||
|
}
|
||||||
|
if (version.major < 2)
|
||||||
return GL3W_ERROR_OPENGL_VERSION;
|
return GL3W_ERROR_OPENGL_VERSION;
|
||||||
return GL3W_OK;
|
return GL3W_OK;
|
||||||
}
|
}
|
||||||
@@ -701,7 +723,7 @@ int imgl3wInit2(GL3WGetProcAddressProc proc)
|
|||||||
|
|
||||||
int imgl3wIsSupported(int major, int minor)
|
int imgl3wIsSupported(int major, int minor)
|
||||||
{
|
{
|
||||||
if (major < 3)
|
if (major < 2)
|
||||||
return 0;
|
return 0;
|
||||||
if (version.major == major)
|
if (version.major == major)
|
||||||
return version.minor >= minor;
|
return version.minor >= minor;
|
||||||
@@ -756,6 +778,7 @@ static const char *proc_names[] = {
|
|||||||
"glGetVertexAttribPointerv",
|
"glGetVertexAttribPointerv",
|
||||||
"glGetVertexAttribiv",
|
"glGetVertexAttribiv",
|
||||||
"glIsEnabled",
|
"glIsEnabled",
|
||||||
|
"glIsProgram",
|
||||||
"glLinkProgram",
|
"glLinkProgram",
|
||||||
"glPixelStorei",
|
"glPixelStorei",
|
||||||
"glPolygonMode",
|
"glPolygonMode",
|
||||||
|
|||||||
+123
-36
@@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
// Implemented features:
|
// Implemented features:
|
||||||
// [X] Platform: Clipboard support.
|
// [X] Platform: Clipboard support.
|
||||||
|
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.
|
||||||
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
|
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
|
||||||
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
|
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
|
||||||
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
|
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
|
||||||
// Missing features:
|
// [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");' before SDL_CreateWindow()!.
|
||||||
// [ ] Platform: SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME.
|
|
||||||
|
|
||||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||||
@@ -18,6 +18,18 @@
|
|||||||
|
|
||||||
// CHANGELOG
|
// CHANGELOG
|
||||||
// (minor and older changes stripped away, please see git history for details)
|
// (minor and older changes stripped away, please see git history for details)
|
||||||
|
// 2023-04-06: Inputs: Avoid calling SDL_StartTextInput()/SDL_StopTextInput() as they don't only pertain to IME. It's unclear exactly what their relation is to IME. (#6306)
|
||||||
|
// 2023-04-04: Inputs: Added support for io.AddMouseSourceEvent() to discriminate ImGuiMouseSource_Mouse/ImGuiMouseSource_TouchScreen. (#2702)
|
||||||
|
// 2023-02-23: Accept SDL_GetPerformanceCounter() not returning a monotonically increasing value. (#6189, #6114, #3644)
|
||||||
|
// 2023-02-07: Implement IME handler (io.SetPlatformImeDataFn will call SDL_SetTextInputRect()/SDL_StartTextInput()).
|
||||||
|
// 2023-02-07: *BREAKING CHANGE* Renamed this backend file from imgui_impl_sdl.cpp/.h to imgui_impl_sdl2.cpp/.h in prevision for the future release of SDL3.
|
||||||
|
// 2023-02-02: Avoid calling SDL_SetCursor() when cursor has not changed, as the function is surprisingly costly on Mac with latest SDL (may be fixed in next SDL version).
|
||||||
|
// 2023-02-02: Added support for SDL 2.0.18+ preciseX/preciseY mouse wheel data for smooth scrolling + Scaling X value on Emscripten (bug?). (#4019, #6096)
|
||||||
|
// 2023-02-02: Removed SDL_MOUSEWHEEL value clamping, as values seem correct in latest Emscripten. (#4019)
|
||||||
|
// 2023-02-01: Flipping SDL_MOUSEWHEEL 'wheel.x' value to match other backends and offer consistent horizontal scrolling direction. (#4019, #6096, #1463)
|
||||||
|
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
|
||||||
|
// 2022-09-26: Inputs: Disable SDL 2.0.22 new "auto capture" (SDL_HINT_MOUSE_AUTO_CAPTURE) which prevents drag and drop across windows for multi-viewport support + don't capture when drag and dropping. (#5710)
|
||||||
|
// 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
|
||||||
// 2022-03-22: Inputs: Fix mouse position issues when dragging outside of boundaries. SDL_CaptureMouse() erroneously still gives out LEAVE events when hovering OS decorations.
|
// 2022-03-22: Inputs: Fix mouse position issues when dragging outside of boundaries. SDL_CaptureMouse() erroneously still gives out LEAVE events when hovering OS decorations.
|
||||||
// 2022-03-22: Inputs: Added support for extra mouse buttons (SDL_BUTTON_X1/SDL_BUTTON_X2).
|
// 2022-03-22: Inputs: Added support for extra mouse buttons (SDL_BUTTON_X1/SDL_BUTTON_X2).
|
||||||
// 2022-02-04: Added SDL_Renderer* parameter to ImGui_ImplSDL2_InitForSDLRenderer(), so we can use SDL_GetRendererOutputSize() instead of SDL_GL_GetDrawableSize() when bound to a SDL_Renderer.
|
// 2022-02-04: Added SDL_Renderer* parameter to ImGui_ImplSDL2_InitForSDLRenderer(), so we can use SDL_GetRendererOutputSize() instead of SDL_GL_GetDrawableSize() when bound to a SDL_Renderer.
|
||||||
@@ -61,7 +73,14 @@
|
|||||||
// 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers.
|
// 2016-10-15: Misc: Added a void* user_data parameter to Clipboard function handlers.
|
||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_impl_sdl.h"
|
#ifndef IMGUI_DISABLE
|
||||||
|
#include "imgui_impl_sdl2.h"
|
||||||
|
|
||||||
|
// Clang warnings with -Weverything
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
|
||||||
|
#endif
|
||||||
|
|
||||||
// SDL
|
// SDL
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
@@ -75,7 +94,6 @@
|
|||||||
#else
|
#else
|
||||||
#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE 0
|
#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE 0
|
||||||
#endif
|
#endif
|
||||||
#define SDL_HAS_MOUSE_FOCUS_CLICKTHROUGH SDL_VERSION_ATLEAST(2,0,5)
|
|
||||||
#define SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6)
|
#define SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6)
|
||||||
|
|
||||||
// SDL Data
|
// SDL Data
|
||||||
@@ -84,8 +102,10 @@ struct ImGui_ImplSDL2_Data
|
|||||||
SDL_Window* Window;
|
SDL_Window* Window;
|
||||||
SDL_Renderer* Renderer;
|
SDL_Renderer* Renderer;
|
||||||
Uint64 Time;
|
Uint64 Time;
|
||||||
|
Uint32 MouseWindowID;
|
||||||
int MouseButtonsDown;
|
int MouseButtonsDown;
|
||||||
SDL_Cursor* MouseCursors[ImGuiMouseCursor_COUNT];
|
SDL_Cursor* MouseCursors[ImGuiMouseCursor_COUNT];
|
||||||
|
SDL_Cursor* LastMouseCursor;
|
||||||
int PendingMouseLeaveFrame;
|
int PendingMouseLeaveFrame;
|
||||||
char* ClipboardTextData;
|
char* ClipboardTextData;
|
||||||
bool MouseCanUseGlobalState;
|
bool MouseCanUseGlobalState;
|
||||||
@@ -99,7 +119,7 @@ struct ImGui_ImplSDL2_Data
|
|||||||
// FIXME: some shared resources (mouse cursor shape, gamepad) are mishandled when using multi-context.
|
// FIXME: some shared resources (mouse cursor shape, gamepad) are mishandled when using multi-context.
|
||||||
static ImGui_ImplSDL2_Data* ImGui_ImplSDL2_GetBackendData()
|
static ImGui_ImplSDL2_Data* ImGui_ImplSDL2_GetBackendData()
|
||||||
{
|
{
|
||||||
return ImGui::GetCurrentContext() ? (ImGui_ImplSDL2_Data*)ImGui::GetIO().BackendPlatformUserData : NULL;
|
return ImGui::GetCurrentContext() ? (ImGui_ImplSDL2_Data*)ImGui::GetIO().BackendPlatformUserData : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
@@ -117,6 +137,20 @@ static void ImGui_ImplSDL2_SetClipboardText(void*, const char* text)
|
|||||||
SDL_SetClipboardText(text);
|
SDL_SetClipboardText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note: native IME will only display if user calls SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1") _before_ SDL_CreateWindow().
|
||||||
|
static void ImGui_ImplSDL2_SetPlatformImeData(ImGuiViewport*, ImGuiPlatformImeData* data)
|
||||||
|
{
|
||||||
|
if (data->WantVisible)
|
||||||
|
{
|
||||||
|
SDL_Rect r;
|
||||||
|
r.x = (int)data->InputPos.x;
|
||||||
|
r.y = (int)data->InputPos.y;
|
||||||
|
r.w = 1;
|
||||||
|
r.h = (int)data->InputLineHeight;
|
||||||
|
SDL_SetTextInputRect(&r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static ImGuiKey ImGui_ImplSDL2_KeycodeToImGuiKey(int keycode)
|
static ImGuiKey ImGui_ImplSDL2_KeycodeToImGuiKey(int keycode)
|
||||||
{
|
{
|
||||||
switch (keycode)
|
switch (keycode)
|
||||||
@@ -233,10 +267,10 @@ static ImGuiKey ImGui_ImplSDL2_KeycodeToImGuiKey(int keycode)
|
|||||||
static void ImGui_ImplSDL2_UpdateKeyModifiers(SDL_Keymod sdl_key_mods)
|
static void ImGui_ImplSDL2_UpdateKeyModifiers(SDL_Keymod sdl_key_mods)
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
io.AddKeyEvent(ImGuiKey_ModCtrl, (sdl_key_mods & KMOD_CTRL) != 0);
|
io.AddKeyEvent(ImGuiMod_Ctrl, (sdl_key_mods & KMOD_CTRL) != 0);
|
||||||
io.AddKeyEvent(ImGuiKey_ModShift, (sdl_key_mods & KMOD_SHIFT) != 0);
|
io.AddKeyEvent(ImGuiMod_Shift, (sdl_key_mods & KMOD_SHIFT) != 0);
|
||||||
io.AddKeyEvent(ImGuiKey_ModAlt, (sdl_key_mods & KMOD_ALT) != 0);
|
io.AddKeyEvent(ImGuiMod_Alt, (sdl_key_mods & KMOD_ALT) != 0);
|
||||||
io.AddKeyEvent(ImGuiKey_ModSuper, (sdl_key_mods & KMOD_GUI) != 0);
|
io.AddKeyEvent(ImGuiMod_Super, (sdl_key_mods & KMOD_GUI) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
||||||
@@ -253,13 +287,25 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
|
|||||||
{
|
{
|
||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION:
|
||||||
{
|
{
|
||||||
io.AddMousePosEvent((float)event->motion.x, (float)event->motion.y);
|
ImVec2 mouse_pos((float)event->motion.x, (float)event->motion.y);
|
||||||
|
io.AddMouseSourceEvent(event->motion.which == SDL_TOUCH_MOUSEID ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);
|
||||||
|
io.AddMousePosEvent(mouse_pos.x, mouse_pos.y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case SDL_MOUSEWHEEL:
|
case SDL_MOUSEWHEEL:
|
||||||
{
|
{
|
||||||
float wheel_x = (event->wheel.x > 0) ? 1.0f : (event->wheel.x < 0) ? -1.0f : 0.0f;
|
//IMGUI_DEBUG_LOG("wheel %.2f %.2f, precise %.2f %.2f\n", (float)event->wheel.x, (float)event->wheel.y, event->wheel.preciseX, event->wheel.preciseY);
|
||||||
float wheel_y = (event->wheel.y > 0) ? 1.0f : (event->wheel.y < 0) ? -1.0f : 0.0f;
|
#if SDL_VERSION_ATLEAST(2,0,18) // If this fails to compile on Emscripten: update to latest Emscripten!
|
||||||
|
float wheel_x = -event->wheel.preciseX;
|
||||||
|
float wheel_y = event->wheel.preciseY;
|
||||||
|
#else
|
||||||
|
float wheel_x = -(float)event->wheel.x;
|
||||||
|
float wheel_y = (float)event->wheel.y;
|
||||||
|
#endif
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
wheel_x /= 100.0f;
|
||||||
|
#endif
|
||||||
|
io.AddMouseSourceEvent(event->wheel.which == SDL_TOUCH_MOUSEID ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);
|
||||||
io.AddMouseWheelEvent(wheel_x, wheel_y);
|
io.AddMouseWheelEvent(wheel_x, wheel_y);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -274,6 +320,7 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
|
|||||||
if (event->button.button == SDL_BUTTON_X2) { mouse_button = 4; }
|
if (event->button.button == SDL_BUTTON_X2) { mouse_button = 4; }
|
||||||
if (mouse_button == -1)
|
if (mouse_button == -1)
|
||||||
break;
|
break;
|
||||||
|
io.AddMouseSourceEvent(event->button.which == SDL_TOUCH_MOUSEID ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);
|
||||||
io.AddMouseButtonEvent(mouse_button, (event->type == SDL_MOUSEBUTTONDOWN));
|
io.AddMouseButtonEvent(mouse_button, (event->type == SDL_MOUSEBUTTONDOWN));
|
||||||
bd->MouseButtonsDown = (event->type == SDL_MOUSEBUTTONDOWN) ? (bd->MouseButtonsDown | (1 << mouse_button)) : (bd->MouseButtonsDown & ~(1 << mouse_button));
|
bd->MouseButtonsDown = (event->type == SDL_MOUSEBUTTONDOWN) ? (bd->MouseButtonsDown | (1 << mouse_button)) : (bd->MouseButtonsDown & ~(1 << mouse_button));
|
||||||
return true;
|
return true;
|
||||||
@@ -301,7 +348,10 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
|
|||||||
// we delay process the SDL_WINDOWEVENT_LEAVE events by one frame. See issue #5012 for details.
|
// we delay process the SDL_WINDOWEVENT_LEAVE events by one frame. See issue #5012 for details.
|
||||||
Uint8 window_event = event->window.event;
|
Uint8 window_event = event->window.event;
|
||||||
if (window_event == SDL_WINDOWEVENT_ENTER)
|
if (window_event == SDL_WINDOWEVENT_ENTER)
|
||||||
|
{
|
||||||
|
bd->MouseWindowID = event->window.windowID;
|
||||||
bd->PendingMouseLeaveFrame = 0;
|
bd->PendingMouseLeaveFrame = 0;
|
||||||
|
}
|
||||||
if (window_event == SDL_WINDOWEVENT_LEAVE)
|
if (window_event == SDL_WINDOWEVENT_LEAVE)
|
||||||
bd->PendingMouseLeaveFrame = ImGui::GetFrameCount() + 1;
|
bd->PendingMouseLeaveFrame = ImGui::GetFrameCount() + 1;
|
||||||
if (window_event == SDL_WINDOWEVENT_FOCUS_GAINED)
|
if (window_event == SDL_WINDOWEVENT_FOCUS_GAINED)
|
||||||
@@ -317,7 +367,7 @@ bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
|
|||||||
static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)
|
static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
IM_ASSERT(io.BackendPlatformUserData == NULL && "Already initialized a platform backend!");
|
IM_ASSERT(io.BackendPlatformUserData == nullptr && "Already initialized a platform backend!");
|
||||||
|
|
||||||
// Check and store if we are on a SDL backend that supports global mouse position
|
// Check and store if we are on a SDL backend that supports global mouse position
|
||||||
// ("wayland" and "rpi" don't support it, but we chose to use a white-list instead of a black-list)
|
// ("wayland" and "rpi" don't support it, but we chose to use a white-list instead of a black-list)
|
||||||
@@ -333,7 +383,7 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)
|
|||||||
// Setup backend capabilities flags
|
// Setup backend capabilities flags
|
||||||
ImGui_ImplSDL2_Data* bd = IM_NEW(ImGui_ImplSDL2_Data)();
|
ImGui_ImplSDL2_Data* bd = IM_NEW(ImGui_ImplSDL2_Data)();
|
||||||
io.BackendPlatformUserData = (void*)bd;
|
io.BackendPlatformUserData = (void*)bd;
|
||||||
io.BackendPlatformName = "imgui_impl_sdl";
|
io.BackendPlatformName = "imgui_impl_sdl2";
|
||||||
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
|
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors; // We can honor GetMouseCursor() values (optional)
|
||||||
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
|
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos; // We can honor io.WantSetMousePos requests (optional, rarely used)
|
||||||
|
|
||||||
@@ -343,7 +393,8 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)
|
|||||||
|
|
||||||
io.SetClipboardTextFn = ImGui_ImplSDL2_SetClipboardText;
|
io.SetClipboardTextFn = ImGui_ImplSDL2_SetClipboardText;
|
||||||
io.GetClipboardTextFn = ImGui_ImplSDL2_GetClipboardText;
|
io.GetClipboardTextFn = ImGui_ImplSDL2_GetClipboardText;
|
||||||
io.ClipboardUserData = NULL;
|
io.ClipboardUserData = nullptr;
|
||||||
|
io.SetPlatformImeDataFn = ImGui_ImplSDL2_SetPlatformImeData;
|
||||||
|
|
||||||
// Load mouse cursors
|
// Load mouse cursors
|
||||||
bd->MouseCursors[ImGuiMouseCursor_Arrow] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
|
bd->MouseCursors[ImGuiMouseCursor_Arrow] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
|
||||||
@@ -357,31 +408,48 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window, SDL_Renderer* renderer)
|
|||||||
bd->MouseCursors[ImGuiMouseCursor_NotAllowed] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_NO);
|
bd->MouseCursors[ImGuiMouseCursor_NotAllowed] = SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_NO);
|
||||||
|
|
||||||
// Set platform dependent data in viewport
|
// Set platform dependent data in viewport
|
||||||
#ifdef _WIN32
|
// Our mouse update function expect PlatformHandle to be filled for the main viewport
|
||||||
|
ImGuiViewport* main_viewport = ImGui::GetMainViewport();
|
||||||
|
main_viewport->PlatformHandleRaw = nullptr;
|
||||||
SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
SDL_VERSION(&info.version);
|
SDL_VERSION(&info.version);
|
||||||
if (SDL_GetWindowWMInfo(window, &info))
|
if (SDL_GetWindowWMInfo(window, &info))
|
||||||
ImGui::GetMainViewport()->PlatformHandleRaw = (void*)info.info.win.window;
|
{
|
||||||
#else
|
#if defined(SDL_VIDEO_DRIVER_WINDOWS)
|
||||||
(void)window;
|
main_viewport->PlatformHandleRaw = (void*)info.info.win.window;
|
||||||
|
#elif defined(__APPLE__) && defined(SDL_VIDEO_DRIVER_COCOA)
|
||||||
|
main_viewport->PlatformHandleRaw = (void*)info.info.cocoa.window;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// Set SDL hint to receive mouse click events on window focus, otherwise SDL doesn't emit the event.
|
// From 2.0.5: Set SDL hint to receive mouse click events on window focus, otherwise SDL doesn't emit the event.
|
||||||
// Without this, when clicking to gain focus, our widgets wouldn't activate even though they showed as hovered.
|
// Without this, when clicking to gain focus, our widgets wouldn't activate even though they showed as hovered.
|
||||||
// (This is unfortunately a global SDL setting, so enabling it might have a side-effect on your application.
|
// (This is unfortunately a global SDL setting, so enabling it might have a side-effect on your application.
|
||||||
// It is unlikely to make a difference, but if your app absolutely needs to ignore the initial on-focus click:
|
// It is unlikely to make a difference, but if your app absolutely needs to ignore the initial on-focus click:
|
||||||
// you can ignore SDL_MOUSEBUTTONDOWN events coming right after a SDL_WINDOWEVENT_FOCUS_GAINED)
|
// you can ignore SDL_MOUSEBUTTONDOWN events coming right after a SDL_WINDOWEVENT_FOCUS_GAINED)
|
||||||
#if SDL_HAS_MOUSE_FOCUS_CLICKTHROUGH
|
#ifdef SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH
|
||||||
SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1");
|
SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// From 2.0.18: Enable native IME.
|
||||||
|
// IMPORTANT: This is used at the time of SDL_CreateWindow() so this will only affects secondary windows, if any.
|
||||||
|
// For the main window to be affected, your application needs to call this manually before calling SDL_CreateWindow().
|
||||||
|
#ifdef SDL_HINT_IME_SHOW_UI
|
||||||
|
SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// From 2.0.22: Disable auto-capture, this is preventing drag and drop across multiple windows (see #5710)
|
||||||
|
#ifdef SDL_HINT_MOUSE_AUTO_CAPTURE
|
||||||
|
SDL_SetHint(SDL_HINT_MOUSE_AUTO_CAPTURE, "0");
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context)
|
bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context)
|
||||||
{
|
{
|
||||||
IM_UNUSED(sdl_gl_context); // Viewport branch will need this.
|
IM_UNUSED(sdl_gl_context); // Viewport branch will need this.
|
||||||
return ImGui_ImplSDL2_Init(window, NULL);
|
return ImGui_ImplSDL2_Init(window, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window)
|
bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window)
|
||||||
@@ -389,7 +457,7 @@ bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window)
|
|||||||
#if !SDL_HAS_VULKAN
|
#if !SDL_HAS_VULKAN
|
||||||
IM_ASSERT(0 && "Unsupported");
|
IM_ASSERT(0 && "Unsupported");
|
||||||
#endif
|
#endif
|
||||||
return ImGui_ImplSDL2_Init(window, NULL);
|
return ImGui_ImplSDL2_Init(window, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window)
|
bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window)
|
||||||
@@ -397,12 +465,12 @@ bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window)
|
|||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
IM_ASSERT(0 && "Unsupported");
|
IM_ASSERT(0 && "Unsupported");
|
||||||
#endif
|
#endif
|
||||||
return ImGui_ImplSDL2_Init(window, NULL);
|
return ImGui_ImplSDL2_Init(window, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui_ImplSDL2_InitForMetal(SDL_Window* window)
|
bool ImGui_ImplSDL2_InitForMetal(SDL_Window* window)
|
||||||
{
|
{
|
||||||
return ImGui_ImplSDL2_Init(window, NULL);
|
return ImGui_ImplSDL2_Init(window, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* renderer)
|
bool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* renderer)
|
||||||
@@ -413,16 +481,18 @@ bool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window, SDL_Renderer* rendere
|
|||||||
void ImGui_ImplSDL2_Shutdown()
|
void ImGui_ImplSDL2_Shutdown()
|
||||||
{
|
{
|
||||||
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
|
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
|
||||||
IM_ASSERT(bd != NULL && "No platform backend to shutdown, or already shutdown?");
|
IM_ASSERT(bd != nullptr && "No platform backend to shutdown, or already shutdown?");
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
if (bd->ClipboardTextData)
|
if (bd->ClipboardTextData)
|
||||||
SDL_free(bd->ClipboardTextData);
|
SDL_free(bd->ClipboardTextData);
|
||||||
for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
|
for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
|
||||||
SDL_FreeCursor(bd->MouseCursors[cursor_n]);
|
SDL_FreeCursor(bd->MouseCursors[cursor_n]);
|
||||||
|
bd->LastMouseCursor = nullptr;
|
||||||
|
|
||||||
io.BackendPlatformName = NULL;
|
io.BackendPlatformName = nullptr;
|
||||||
io.BackendPlatformUserData = NULL;
|
io.BackendPlatformUserData = nullptr;
|
||||||
|
io.BackendFlags &= ~(ImGuiBackendFlags_HasMouseCursors | ImGuiBackendFlags_HasSetMousePos | ImGuiBackendFlags_HasGamepad);
|
||||||
IM_DELETE(bd);
|
IM_DELETE(bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -434,7 +504,7 @@ static void ImGui_ImplSDL2_UpdateMouseData()
|
|||||||
// We forward mouse input when hovered or captured (via SDL_MOUSEMOTION) or when focused (below)
|
// We forward mouse input when hovered or captured (via SDL_MOUSEMOTION) or when focused (below)
|
||||||
#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE
|
#if SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE
|
||||||
// SDL_CaptureMouse() let the OS know e.g. that our imgui drag outside the SDL window boundaries shouldn't e.g. trigger other operations outside
|
// SDL_CaptureMouse() let the OS know e.g. that our imgui drag outside the SDL window boundaries shouldn't e.g. trigger other operations outside
|
||||||
SDL_CaptureMouse(bd->MouseButtonsDown != 0 ? SDL_TRUE : SDL_FALSE);
|
SDL_CaptureMouse((bd->MouseButtonsDown != 0) ? SDL_TRUE : SDL_FALSE);
|
||||||
SDL_Window* focused_window = SDL_GetKeyboardFocus();
|
SDL_Window* focused_window = SDL_GetKeyboardFocus();
|
||||||
const bool is_app_focused = (bd->Window == focused_window);
|
const bool is_app_focused = (bd->Window == focused_window);
|
||||||
#else
|
#else
|
||||||
@@ -473,7 +543,12 @@ static void ImGui_ImplSDL2_UpdateMouseCursor()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Show OS mouse cursor
|
// Show OS mouse cursor
|
||||||
SDL_SetCursor(bd->MouseCursors[imgui_cursor] ? bd->MouseCursors[imgui_cursor] : bd->MouseCursors[ImGuiMouseCursor_Arrow]);
|
SDL_Cursor* expected_cursor = bd->MouseCursors[imgui_cursor] ? bd->MouseCursors[imgui_cursor] : bd->MouseCursors[ImGuiMouseCursor_Arrow];
|
||||||
|
if (bd->LastMouseCursor != expected_cursor)
|
||||||
|
{
|
||||||
|
SDL_SetCursor(expected_cursor); // SDL function doesn't have an early out (see #6113)
|
||||||
|
bd->LastMouseCursor = expected_cursor;
|
||||||
|
}
|
||||||
SDL_ShowCursor(SDL_TRUE);
|
SDL_ShowCursor(SDL_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -481,7 +556,7 @@ static void ImGui_ImplSDL2_UpdateMouseCursor()
|
|||||||
static void ImGui_ImplSDL2_UpdateGamepads()
|
static void ImGui_ImplSDL2_UpdateGamepads()
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0)
|
if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0) // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Get gamepad
|
// Get gamepad
|
||||||
@@ -498,10 +573,10 @@ static void ImGui_ImplSDL2_UpdateGamepads()
|
|||||||
const int thumb_dead_zone = 8000; // SDL_gamecontroller.h suggests using this value.
|
const int thumb_dead_zone = 8000; // SDL_gamecontroller.h suggests using this value.
|
||||||
MAP_BUTTON(ImGuiKey_GamepadStart, SDL_CONTROLLER_BUTTON_START);
|
MAP_BUTTON(ImGuiKey_GamepadStart, SDL_CONTROLLER_BUTTON_START);
|
||||||
MAP_BUTTON(ImGuiKey_GamepadBack, SDL_CONTROLLER_BUTTON_BACK);
|
MAP_BUTTON(ImGuiKey_GamepadBack, SDL_CONTROLLER_BUTTON_BACK);
|
||||||
MAP_BUTTON(ImGuiKey_GamepadFaceDown, SDL_CONTROLLER_BUTTON_A); // Xbox A, PS Cross
|
|
||||||
MAP_BUTTON(ImGuiKey_GamepadFaceRight, SDL_CONTROLLER_BUTTON_B); // Xbox B, PS Circle
|
|
||||||
MAP_BUTTON(ImGuiKey_GamepadFaceLeft, SDL_CONTROLLER_BUTTON_X); // Xbox X, PS Square
|
MAP_BUTTON(ImGuiKey_GamepadFaceLeft, SDL_CONTROLLER_BUTTON_X); // Xbox X, PS Square
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadFaceRight, SDL_CONTROLLER_BUTTON_B); // Xbox B, PS Circle
|
||||||
MAP_BUTTON(ImGuiKey_GamepadFaceUp, SDL_CONTROLLER_BUTTON_Y); // Xbox Y, PS Triangle
|
MAP_BUTTON(ImGuiKey_GamepadFaceUp, SDL_CONTROLLER_BUTTON_Y); // Xbox Y, PS Triangle
|
||||||
|
MAP_BUTTON(ImGuiKey_GamepadFaceDown, SDL_CONTROLLER_BUTTON_A); // Xbox A, PS Cross
|
||||||
MAP_BUTTON(ImGuiKey_GamepadDpadLeft, SDL_CONTROLLER_BUTTON_DPAD_LEFT);
|
MAP_BUTTON(ImGuiKey_GamepadDpadLeft, SDL_CONTROLLER_BUTTON_DPAD_LEFT);
|
||||||
MAP_BUTTON(ImGuiKey_GamepadDpadRight, SDL_CONTROLLER_BUTTON_DPAD_RIGHT);
|
MAP_BUTTON(ImGuiKey_GamepadDpadRight, SDL_CONTROLLER_BUTTON_DPAD_RIGHT);
|
||||||
MAP_BUTTON(ImGuiKey_GamepadDpadUp, SDL_CONTROLLER_BUTTON_DPAD_UP);
|
MAP_BUTTON(ImGuiKey_GamepadDpadUp, SDL_CONTROLLER_BUTTON_DPAD_UP);
|
||||||
@@ -527,7 +602,7 @@ static void ImGui_ImplSDL2_UpdateGamepads()
|
|||||||
void ImGui_ImplSDL2_NewFrame()
|
void ImGui_ImplSDL2_NewFrame()
|
||||||
{
|
{
|
||||||
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
|
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
|
||||||
IM_ASSERT(bd != NULL && "Did you call ImGui_ImplSDL2_Init()?");
|
IM_ASSERT(bd != nullptr && "Did you call ImGui_ImplSDL2_Init()?");
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
// Setup display size (every frame to accommodate for window resizing)
|
// Setup display size (every frame to accommodate for window resizing)
|
||||||
@@ -536,7 +611,7 @@ void ImGui_ImplSDL2_NewFrame()
|
|||||||
SDL_GetWindowSize(bd->Window, &w, &h);
|
SDL_GetWindowSize(bd->Window, &w, &h);
|
||||||
if (SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_MINIMIZED)
|
if (SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_MINIMIZED)
|
||||||
w = h = 0;
|
w = h = 0;
|
||||||
if (bd->Renderer != NULL)
|
if (bd->Renderer != nullptr)
|
||||||
SDL_GetRendererOutputSize(bd->Renderer, &display_w, &display_h);
|
SDL_GetRendererOutputSize(bd->Renderer, &display_w, &display_h);
|
||||||
else
|
else
|
||||||
SDL_GL_GetDrawableSize(bd->Window, &display_w, &display_h);
|
SDL_GL_GetDrawableSize(bd->Window, &display_w, &display_h);
|
||||||
@@ -545,15 +620,19 @@ void ImGui_ImplSDL2_NewFrame()
|
|||||||
io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);
|
io.DisplayFramebufferScale = ImVec2((float)display_w / w, (float)display_h / h);
|
||||||
|
|
||||||
// Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution)
|
// Setup time step (we don't use SDL_GetTicks() because it is using millisecond resolution)
|
||||||
|
// (Accept SDL_GetPerformanceCounter() not returning a monotonically increasing value. Happens in VMs and Emscripten, see #6189, #6114, #3644)
|
||||||
static Uint64 frequency = SDL_GetPerformanceFrequency();
|
static Uint64 frequency = SDL_GetPerformanceFrequency();
|
||||||
Uint64 current_time = SDL_GetPerformanceCounter();
|
Uint64 current_time = SDL_GetPerformanceCounter();
|
||||||
|
if (current_time <= bd->Time)
|
||||||
|
current_time = bd->Time + 1;
|
||||||
io.DeltaTime = bd->Time > 0 ? (float)((double)(current_time - bd->Time) / frequency) : (float)(1.0f / 60.0f);
|
io.DeltaTime = bd->Time > 0 ? (float)((double)(current_time - bd->Time) / frequency) : (float)(1.0f / 60.0f);
|
||||||
bd->Time = current_time;
|
bd->Time = current_time;
|
||||||
|
|
||||||
if (bd->PendingMouseLeaveFrame && bd->PendingMouseLeaveFrame >= ImGui::GetFrameCount() && bd->MouseButtonsDown == 0)
|
if (bd->PendingMouseLeaveFrame && bd->PendingMouseLeaveFrame >= ImGui::GetFrameCount() && bd->MouseButtonsDown == 0)
|
||||||
{
|
{
|
||||||
io.AddMousePosEvent(-FLT_MAX, -FLT_MAX);
|
bd->MouseWindowID = 0;
|
||||||
bd->PendingMouseLeaveFrame = 0;
|
bd->PendingMouseLeaveFrame = 0;
|
||||||
|
io.AddMousePosEvent(-FLT_MAX, -FLT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui_ImplSDL2_UpdateMouseData();
|
ImGui_ImplSDL2_UpdateMouseData();
|
||||||
@@ -562,3 +641,11 @@ void ImGui_ImplSDL2_NewFrame()
|
|||||||
// Update game controllers (if enabled and available)
|
// Update game controllers (if enabled and available)
|
||||||
ImGui_ImplSDL2_UpdateGamepads();
|
ImGui_ImplSDL2_UpdateGamepads();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef IMGUI_DISABLE
|
||||||
+5
-2
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
// Implemented features:
|
// Implemented features:
|
||||||
// [X] Platform: Clipboard support.
|
// [X] Platform: Clipboard support.
|
||||||
|
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen.
|
||||||
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
|
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy SDL_SCANCODE_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set]
|
||||||
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
|
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
|
||||||
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
|
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
|
||||||
// Missing features:
|
// [X] Platform: Basic IME support. App needs to call 'SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1");' before SDL_CreateWindow()!.
|
||||||
// [ ] Platform: SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME.
|
|
||||||
|
|
||||||
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "imgui.h" // IMGUI_IMPL_API
|
#include "imgui.h" // IMGUI_IMPL_API
|
||||||
|
#ifndef IMGUI_DISABLE
|
||||||
|
|
||||||
struct SDL_Window;
|
struct SDL_Window;
|
||||||
struct SDL_Renderer;
|
struct SDL_Renderer;
|
||||||
@@ -34,3 +35,5 @@ IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event);
|
|||||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||||
static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter
|
static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef IMGUI_DISABLE
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
// dear imgui: Renderer Backend for SDL_Renderer
|
|
||||||
// (Requires: SDL 2.0.17+)
|
|
||||||
|
|
||||||
// Important to understand: SDL_Renderer is an _optional_ component of SDL.
|
|
||||||
// For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX.
|
|
||||||
// If your application will want to render any non trivial amount of graphics other than UI,
|
|
||||||
// please be aware that SDL_Renderer offers a limited graphic API to the end-user and it might
|
|
||||||
// be difficult to step out of those boundaries.
|
|
||||||
// However, we understand it is a convenient choice to get an app started easily.
|
|
||||||
|
|
||||||
// Implemented features:
|
|
||||||
// [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID!
|
|
||||||
// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#include "imgui.h" // IMGUI_IMPL_API
|
|
||||||
|
|
||||||
struct SDL_Renderer;
|
|
||||||
|
|
||||||
IMGUI_IMPL_API bool ImGui_ImplSDLRenderer_Init(SDL_Renderer* renderer);
|
|
||||||
IMGUI_IMPL_API void ImGui_ImplSDLRenderer_Shutdown();
|
|
||||||
IMGUI_IMPL_API void ImGui_ImplSDLRenderer_NewFrame();
|
|
||||||
IMGUI_IMPL_API void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data);
|
|
||||||
|
|
||||||
// Called by Init/NewFrame/Shutdown
|
|
||||||
IMGUI_IMPL_API bool ImGui_ImplSDLRenderer_CreateFontsTexture();
|
|
||||||
IMGUI_IMPL_API void ImGui_ImplSDLRenderer_DestroyFontsTexture();
|
|
||||||
IMGUI_IMPL_API bool ImGui_ImplSDLRenderer_CreateDeviceObjects();
|
|
||||||
IMGUI_IMPL_API void ImGui_ImplSDLRenderer_DestroyDeviceObjects();
|
|
||||||
+68
-56
@@ -1,34 +1,37 @@
|
|||||||
// dear imgui: Renderer Backend for SDL_Renderer
|
// dear imgui: Renderer Backend for SDL_Renderer for SDL2
|
||||||
// (Requires: SDL 2.0.17+)
|
// (Requires: SDL 2.0.17+)
|
||||||
|
|
||||||
// Important to understand: SDL_Renderer is an _optional_ component of SDL.
|
// Note how SDL_Renderer is an _optional_ component of SDL2.
|
||||||
// For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX.
|
// For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX.
|
||||||
// If your application will want to render any non trivial amount of graphics other than UI,
|
// If your application will want to render any non trivial amount of graphics other than UI,
|
||||||
// please be aware that SDL_Renderer offers a limited graphic API to the end-user and it might
|
// please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and
|
||||||
// be difficult to step out of those boundaries.
|
// it might be difficult to step out of those boundaries.
|
||||||
// However, we understand it is a convenient choice to get an app started easily.
|
|
||||||
|
|
||||||
// Implemented features:
|
// Implemented features:
|
||||||
// [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID!
|
// [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID!
|
||||||
// [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices.
|
// [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
|
||||||
// Missing features:
|
|
||||||
|
|
||||||
// You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
// You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
||||||
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
|
||||||
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
// Read online: https://github.com/ocornut/imgui/tree/master/docs
|
||||||
|
|
||||||
// CHANGELOG
|
// CHANGELOG
|
||||||
|
// 2023-05-30: Renamed imgui_impl_sdlrenderer.h/.cpp to imgui_impl_sdlrenderer2.h/.cpp to accommodate for upcoming SDL3.
|
||||||
|
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
|
||||||
// 2021-12-21: Update SDL_RenderGeometryRaw() format to work with SDL 2.0.19.
|
// 2021-12-21: Update SDL_RenderGeometryRaw() format to work with SDL 2.0.19.
|
||||||
// 2021-12-03: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
|
// 2021-12-03: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
|
||||||
// 2021-10-06: Backup and restore modified ClipRect/Viewport.
|
// 2021-10-06: Backup and restore modified ClipRect/Viewport.
|
||||||
// 2021-09-21: Initial version.
|
// 2021-09-21: Initial version.
|
||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_impl_sdlrenderer.h"
|
#ifndef IMGUI_DISABLE
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
#include "imgui_impl_sdlrenderer2.h"
|
||||||
#include <stddef.h> // intptr_t
|
|
||||||
#else
|
|
||||||
#include <stdint.h> // intptr_t
|
#include <stdint.h> // intptr_t
|
||||||
|
|
||||||
|
// Clang warnings with -Weverything
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wsign-conversion" // warning: implicit conversion changes signedness
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SDL
|
// SDL
|
||||||
@@ -38,31 +41,31 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// SDL_Renderer data
|
// SDL_Renderer data
|
||||||
struct ImGui_ImplSDLRenderer_Data
|
struct ImGui_ImplSDLRenderer2_Data
|
||||||
{
|
{
|
||||||
SDL_Renderer* SDLRenderer;
|
SDL_Renderer* SDLRenderer;
|
||||||
SDL_Texture* FontTexture;
|
SDL_Texture* FontTexture;
|
||||||
ImGui_ImplSDLRenderer_Data() { memset((void*)this, 0, sizeof(*this)); }
|
ImGui_ImplSDLRenderer2_Data() { memset((void*)this, 0, sizeof(*this)); }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
|
// Backend data stored in io.BackendRendererUserData to allow support for multiple Dear ImGui contexts
|
||||||
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
|
// It is STRONGLY preferred that you use docking branch with multi-viewports (== single Dear ImGui context + multiple windows) instead of multiple Dear ImGui contexts.
|
||||||
static ImGui_ImplSDLRenderer_Data* ImGui_ImplSDLRenderer_GetBackendData()
|
static ImGui_ImplSDLRenderer2_Data* ImGui_ImplSDLRenderer2_GetBackendData()
|
||||||
{
|
{
|
||||||
return ImGui::GetCurrentContext() ? (ImGui_ImplSDLRenderer_Data*)ImGui::GetIO().BackendRendererUserData : NULL;
|
return ImGui::GetCurrentContext() ? (ImGui_ImplSDLRenderer2_Data*)ImGui::GetIO().BackendRendererUserData : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
bool ImGui_ImplSDLRenderer_Init(SDL_Renderer* renderer)
|
bool ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer)
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
IM_ASSERT(io.BackendRendererUserData == NULL && "Already initialized a renderer backend!");
|
IM_ASSERT(io.BackendRendererUserData == nullptr && "Already initialized a renderer backend!");
|
||||||
IM_ASSERT(renderer != NULL && "SDL_Renderer not initialized!");
|
IM_ASSERT(renderer != nullptr && "SDL_Renderer not initialized!");
|
||||||
|
|
||||||
// Setup backend capabilities flags
|
// Setup backend capabilities flags
|
||||||
ImGui_ImplSDLRenderer_Data* bd = IM_NEW(ImGui_ImplSDLRenderer_Data)();
|
ImGui_ImplSDLRenderer2_Data* bd = IM_NEW(ImGui_ImplSDLRenderer2_Data)();
|
||||||
io.BackendRendererUserData = (void*)bd;
|
io.BackendRendererUserData = (void*)bd;
|
||||||
io.BackendRendererName = "imgui_impl_sdlrenderer";
|
io.BackendRendererName = "imgui_impl_sdlrenderer2";
|
||||||
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
|
io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset; // We can honor the ImDrawCmd::VtxOffset field, allowing for large meshes.
|
||||||
|
|
||||||
bd->SDLRenderer = renderer;
|
bd->SDLRenderer = renderer;
|
||||||
@@ -70,41 +73,42 @@ bool ImGui_ImplSDLRenderer_Init(SDL_Renderer* renderer)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui_ImplSDLRenderer_Shutdown()
|
void ImGui_ImplSDLRenderer2_Shutdown()
|
||||||
{
|
{
|
||||||
ImGui_ImplSDLRenderer_Data* bd = ImGui_ImplSDLRenderer_GetBackendData();
|
ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
|
||||||
IM_ASSERT(bd != NULL && "No renderer backend to shutdown, or already shutdown?");
|
IM_ASSERT(bd != nullptr && "No renderer backend to shutdown, or already shutdown?");
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
ImGui_ImplSDLRenderer_DestroyDeviceObjects();
|
ImGui_ImplSDLRenderer2_DestroyDeviceObjects();
|
||||||
|
|
||||||
io.BackendRendererName = NULL;
|
io.BackendRendererName = nullptr;
|
||||||
io.BackendRendererUserData = NULL;
|
io.BackendRendererUserData = nullptr;
|
||||||
|
io.BackendFlags &= ~ImGuiBackendFlags_RendererHasVtxOffset;
|
||||||
IM_DELETE(bd);
|
IM_DELETE(bd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ImGui_ImplSDLRenderer_SetupRenderState()
|
static void ImGui_ImplSDLRenderer2_SetupRenderState()
|
||||||
{
|
{
|
||||||
ImGui_ImplSDLRenderer_Data* bd = ImGui_ImplSDLRenderer_GetBackendData();
|
ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
|
||||||
|
|
||||||
// Clear out any viewports and cliprect set by the user
|
// Clear out any viewports and cliprect set by the user
|
||||||
// FIXME: Technically speaking there are lots of other things we could backup/setup/restore during our render process.
|
// FIXME: Technically speaking there are lots of other things we could backup/setup/restore during our render process.
|
||||||
SDL_RenderSetViewport(bd->SDLRenderer, NULL);
|
SDL_RenderSetViewport(bd->SDLRenderer, nullptr);
|
||||||
SDL_RenderSetClipRect(bd->SDLRenderer, NULL);
|
SDL_RenderSetClipRect(bd->SDLRenderer, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui_ImplSDLRenderer_NewFrame()
|
void ImGui_ImplSDLRenderer2_NewFrame()
|
||||||
{
|
{
|
||||||
ImGui_ImplSDLRenderer_Data* bd = ImGui_ImplSDLRenderer_GetBackendData();
|
ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
|
||||||
IM_ASSERT(bd != NULL && "Did you call ImGui_ImplSDLRenderer_Init()?");
|
IM_ASSERT(bd != nullptr && "Did you call ImGui_ImplSDLRenderer2_Init()?");
|
||||||
|
|
||||||
if (!bd->FontTexture)
|
if (!bd->FontTexture)
|
||||||
ImGui_ImplSDLRenderer_CreateDeviceObjects();
|
ImGui_ImplSDLRenderer2_CreateDeviceObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
|
void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data)
|
||||||
{
|
{
|
||||||
ImGui_ImplSDLRenderer_Data* bd = ImGui_ImplSDLRenderer_GetBackendData();
|
ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
|
||||||
|
|
||||||
// If there's a scale factor set by the user, use that instead
|
// If there's a scale factor set by the user, use that instead
|
||||||
// If the user has specified a scale factor to SDL_Renderer already via SDL_RenderSetScale(), SDL will scale whatever we pass
|
// If the user has specified a scale factor to SDL_Renderer already via SDL_RenderSetScale(), SDL will scale whatever we pass
|
||||||
@@ -139,7 +143,7 @@ void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
|
|||||||
ImVec2 clip_scale = render_scale;
|
ImVec2 clip_scale = render_scale;
|
||||||
|
|
||||||
// Render command lists
|
// Render command lists
|
||||||
ImGui_ImplSDLRenderer_SetupRenderState();
|
ImGui_ImplSDLRenderer2_SetupRenderState();
|
||||||
for (int n = 0; n < draw_data->CmdListsCount; n++)
|
for (int n = 0; n < draw_data->CmdListsCount; n++)
|
||||||
{
|
{
|
||||||
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
const ImDrawList* cmd_list = draw_data->CmdLists[n];
|
||||||
@@ -154,7 +158,7 @@ void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
|
|||||||
// User callback, registered via ImDrawList::AddCallback()
|
// User callback, registered via ImDrawList::AddCallback()
|
||||||
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
|
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
|
||||||
if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
|
if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
|
||||||
ImGui_ImplSDLRenderer_SetupRenderState();
|
ImGui_ImplSDLRenderer2_SetupRenderState();
|
||||||
else
|
else
|
||||||
pcmd->UserCallback(cmd_list, pcmd);
|
pcmd->UserCallback(cmd_list, pcmd);
|
||||||
}
|
}
|
||||||
@@ -165,20 +169,20 @@ void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
|
|||||||
ImVec2 clip_max((pcmd->ClipRect.z - clip_off.x) * clip_scale.x, (pcmd->ClipRect.w - clip_off.y) * clip_scale.y);
|
ImVec2 clip_max((pcmd->ClipRect.z - clip_off.x) * clip_scale.x, (pcmd->ClipRect.w - clip_off.y) * clip_scale.y);
|
||||||
if (clip_min.x < 0.0f) { clip_min.x = 0.0f; }
|
if (clip_min.x < 0.0f) { clip_min.x = 0.0f; }
|
||||||
if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
|
if (clip_min.y < 0.0f) { clip_min.y = 0.0f; }
|
||||||
if (clip_max.x > fb_width) { clip_max.x = (float)fb_width; }
|
if (clip_max.x > (float)fb_width) { clip_max.x = (float)fb_width; }
|
||||||
if (clip_max.y > fb_height) { clip_max.y = (float)fb_height; }
|
if (clip_max.y > (float)fb_height) { clip_max.y = (float)fb_height; }
|
||||||
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
|
if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SDL_Rect r = { (int)(clip_min.x), (int)(clip_min.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y) };
|
SDL_Rect r = { (int)(clip_min.x), (int)(clip_min.y), (int)(clip_max.x - clip_min.x), (int)(clip_max.y - clip_min.y) };
|
||||||
SDL_RenderSetClipRect(bd->SDLRenderer, &r);
|
SDL_RenderSetClipRect(bd->SDLRenderer, &r);
|
||||||
|
|
||||||
const float* xy = (const float*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, pos));
|
const float* xy = (const float*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, pos));
|
||||||
const float* uv = (const float*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, uv));
|
const float* uv = (const float*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, uv));
|
||||||
#if SDL_VERSION_ATLEAST(2,0,19)
|
#if SDL_VERSION_ATLEAST(2,0,19)
|
||||||
const SDL_Color* color = (const SDL_Color*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, col)); // SDL 2.0.19+
|
const SDL_Color* color = (const SDL_Color*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, col)); // SDL 2.0.19+
|
||||||
#else
|
#else
|
||||||
const int* color = (const int*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, col)); // SDL 2.0.17 and 2.0.18
|
const int* color = (const int*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + IM_OFFSETOF(ImDrawVert, col)); // SDL 2.0.17 and 2.0.18
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Bind texture, Draw
|
// Bind texture, Draw
|
||||||
@@ -195,14 +199,14 @@ void ImGui_ImplSDLRenderer_RenderDrawData(ImDrawData* draw_data)
|
|||||||
|
|
||||||
// Restore modified SDL_Renderer state
|
// Restore modified SDL_Renderer state
|
||||||
SDL_RenderSetViewport(bd->SDLRenderer, &old.Viewport);
|
SDL_RenderSetViewport(bd->SDLRenderer, &old.Viewport);
|
||||||
SDL_RenderSetClipRect(bd->SDLRenderer, old.ClipEnabled ? &old.ClipRect : NULL);
|
SDL_RenderSetClipRect(bd->SDLRenderer, old.ClipEnabled ? &old.ClipRect : nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called by Init/NewFrame/Shutdown
|
// Called by Init/NewFrame/Shutdown
|
||||||
bool ImGui_ImplSDLRenderer_CreateFontsTexture()
|
bool ImGui_ImplSDLRenderer2_CreateFontsTexture()
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
ImGui_ImplSDLRenderer_Data* bd = ImGui_ImplSDLRenderer_GetBackendData();
|
ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
|
||||||
|
|
||||||
// Build texture atlas
|
// Build texture atlas
|
||||||
unsigned char* pixels;
|
unsigned char* pixels;
|
||||||
@@ -212,12 +216,12 @@ bool ImGui_ImplSDLRenderer_CreateFontsTexture()
|
|||||||
// Upload texture to graphics system
|
// Upload texture to graphics system
|
||||||
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
|
// (Bilinear sampling is required by default. Set 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines' or 'style.AntiAliasedLinesUseTex = false' to allow point/nearest sampling)
|
||||||
bd->FontTexture = SDL_CreateTexture(bd->SDLRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, width, height);
|
bd->FontTexture = SDL_CreateTexture(bd->SDLRenderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, width, height);
|
||||||
if (bd->FontTexture == NULL)
|
if (bd->FontTexture == nullptr)
|
||||||
{
|
{
|
||||||
SDL_Log("error creating texture");
|
SDL_Log("error creating texture");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
SDL_UpdateTexture(bd->FontTexture, NULL, pixels, 4 * width);
|
SDL_UpdateTexture(bd->FontTexture, nullptr, pixels, 4 * width);
|
||||||
SDL_SetTextureBlendMode(bd->FontTexture, SDL_BLENDMODE_BLEND);
|
SDL_SetTextureBlendMode(bd->FontTexture, SDL_BLENDMODE_BLEND);
|
||||||
SDL_SetTextureScaleMode(bd->FontTexture, SDL_ScaleModeLinear);
|
SDL_SetTextureScaleMode(bd->FontTexture, SDL_ScaleModeLinear);
|
||||||
|
|
||||||
@@ -227,24 +231,32 @@ bool ImGui_ImplSDLRenderer_CreateFontsTexture()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui_ImplSDLRenderer_DestroyFontsTexture()
|
void ImGui_ImplSDLRenderer2_DestroyFontsTexture()
|
||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
ImGui_ImplSDLRenderer_Data* bd = ImGui_ImplSDLRenderer_GetBackendData();
|
ImGui_ImplSDLRenderer2_Data* bd = ImGui_ImplSDLRenderer2_GetBackendData();
|
||||||
if (bd->FontTexture)
|
if (bd->FontTexture)
|
||||||
{
|
{
|
||||||
io.Fonts->SetTexID(0);
|
io.Fonts->SetTexID(0);
|
||||||
SDL_DestroyTexture(bd->FontTexture);
|
SDL_DestroyTexture(bd->FontTexture);
|
||||||
bd->FontTexture = NULL;
|
bd->FontTexture = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui_ImplSDLRenderer_CreateDeviceObjects()
|
bool ImGui_ImplSDLRenderer2_CreateDeviceObjects()
|
||||||
{
|
{
|
||||||
return ImGui_ImplSDLRenderer_CreateFontsTexture();
|
return ImGui_ImplSDLRenderer2_CreateFontsTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui_ImplSDLRenderer_DestroyDeviceObjects()
|
void ImGui_ImplSDLRenderer2_DestroyDeviceObjects()
|
||||||
{
|
{
|
||||||
ImGui_ImplSDLRenderer_DestroyFontsTexture();
|
ImGui_ImplSDLRenderer2_DestroyFontsTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#if defined(__clang__)
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // #ifndef IMGUI_DISABLE
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// dear imgui: Renderer Backend for SDL_Renderer for SDL2
|
||||||
|
// (Requires: SDL 2.0.17+)
|
||||||
|
|
||||||
|
// Note how SDL_Renderer is an _optional_ component of SDL2.
|
||||||
|
// For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX.
|
||||||
|
// If your application will want to render any non trivial amount of graphics other than UI,
|
||||||
|
// please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and
|
||||||
|
// it might be difficult to step out of those boundaries.
|
||||||
|
|
||||||
|
// Implemented features:
|
||||||
|
// [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID!
|
||||||
|
// [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#ifndef IMGUI_DISABLE
|
||||||
|
#include "imgui.h" // IMGUI_IMPL_API
|
||||||
|
|
||||||
|
struct SDL_Renderer;
|
||||||
|
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer);
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_Shutdown();
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_NewFrame();
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data);
|
||||||
|
|
||||||
|
// Called by Init/NewFrame/Shutdown
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateFontsTexture();
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyFontsTexture();
|
||||||
|
IMGUI_IMPL_API bool ImGui_ImplSDLRenderer2_CreateDeviceObjects();
|
||||||
|
IMGUI_IMPL_API void ImGui_ImplSDLRenderer2_DestroyDeviceObjects();
|
||||||
|
|
||||||
|
#endif // #ifndef IMGUI_DISABLE
|
||||||
+652
-292
File diff suppressed because it is too large
Load Diff
+228
-155
@@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.88
|
// dear imgui, v1.89.8
|
||||||
// (tables and columns code)
|
// (tables and columns code)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -80,20 +80,20 @@ Index of this file:
|
|||||||
// - outer_size.x <= 0.0f -> Right-align from window/work-rect right-most edge. With -FLT_MIN or 0.0f will align exactly on right-most edge.
|
// - outer_size.x <= 0.0f -> Right-align from window/work-rect right-most edge. With -FLT_MIN or 0.0f will align exactly on right-most edge.
|
||||||
// - outer_size.x > 0.0f -> Set Fixed width.
|
// - outer_size.x > 0.0f -> Set Fixed width.
|
||||||
// Y with ScrollX/ScrollY disabled: we output table directly in current window
|
// Y with ScrollX/ScrollY disabled: we output table directly in current window
|
||||||
// - outer_size.y < 0.0f -> Bottom-align (but will auto extend, unless _NoHostExtendY is set). Not meaningful is parent window can vertically scroll.
|
// - outer_size.y < 0.0f -> Bottom-align (but will auto extend, unless _NoHostExtendY is set). Not meaningful if parent window can vertically scroll.
|
||||||
// - outer_size.y = 0.0f -> No minimum height (but will auto extend, unless _NoHostExtendY is set)
|
// - outer_size.y = 0.0f -> No minimum height (but will auto extend, unless _NoHostExtendY is set)
|
||||||
// - outer_size.y > 0.0f -> Set Minimum height (but will auto extend, unless _NoHostExtenY is set)
|
// - outer_size.y > 0.0f -> Set Minimum height (but will auto extend, unless _NoHostExtenY is set)
|
||||||
// Y with ScrollX/ScrollY enabled: using a child window for scrolling
|
// Y with ScrollX/ScrollY enabled: using a child window for scrolling
|
||||||
// - outer_size.y < 0.0f -> Bottom-align. Not meaningful is parent window can vertically scroll.
|
// - outer_size.y < 0.0f -> Bottom-align. Not meaningful if parent window can vertically scroll.
|
||||||
// - outer_size.y = 0.0f -> Bottom-align, consistent with BeginChild(). Not recommended unless table is last item in parent window.
|
// - outer_size.y = 0.0f -> Bottom-align, consistent with BeginChild(). Not recommended unless table is last item in parent window.
|
||||||
// - outer_size.y > 0.0f -> Set Exact height. Recommended when using Scrolling on any axis.
|
// - outer_size.y > 0.0f -> Set Exact height. Recommended when using Scrolling on any axis.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Outer size is also affected by the NoHostExtendX/NoHostExtendY flags.
|
// Outer size is also affected by the NoHostExtendX/NoHostExtendY flags.
|
||||||
// Important to that note how the two flags have slightly different behaviors!
|
// Important to note how the two flags have slightly different behaviors!
|
||||||
// - ImGuiTableFlags_NoHostExtendX -> Make outer width auto-fit to columns (overriding outer_size.x value). Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
|
// - ImGuiTableFlags_NoHostExtendX -> Make outer width auto-fit to columns (overriding outer_size.x value). Only available when ScrollX/ScrollY are disabled and Stretch columns are not used.
|
||||||
// - ImGuiTableFlags_NoHostExtendY -> Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY is disabled. Data below the limit will be clipped and not visible.
|
// - ImGuiTableFlags_NoHostExtendY -> Make outer height stop exactly at outer_size.y (prevent auto-extending table past the limit). Only available when ScrollX/ScrollY is disabled. Data below the limit will be clipped and not visible.
|
||||||
// In theory ImGuiTableFlags_NoHostExtendY could be the default and any non-scrolling tables with outer_size.y != 0.0f would use exact height.
|
// In theory ImGuiTableFlags_NoHostExtendY could be the default and any non-scrolling tables with outer_size.y != 0.0f would use exact height.
|
||||||
// This would be consistent but perhaps less useful and more confusing (as vertically clipped items are not easily noticeable)
|
// This would be consistent but perhaps less useful and more confusing (as vertically clipped items are not useful and not easily noticeable).
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// About 'inner_width':
|
// About 'inner_width':
|
||||||
// With ScrollX disabled:
|
// With ScrollX disabled:
|
||||||
@@ -112,15 +112,16 @@ Index of this file:
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// COLUMNS SIZING POLICIES
|
// COLUMNS SIZING POLICIES
|
||||||
|
// (Reference: ImGuiTableFlags_SizingXXX flags and ImGuiTableColumnFlags_WidthXXX flags)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// About overriding column sizing policy and width/weight with TableSetupColumn():
|
// About overriding column sizing policy and width/weight with TableSetupColumn():
|
||||||
// We use a default parameter of 'init_width_or_weight == -1'.
|
// We use a default parameter of -1 for 'init_width'/'init_weight'.
|
||||||
// - with ImGuiTableColumnFlags_WidthFixed, init_width <= 0 (default) --> width is automatic
|
// - with ImGuiTableColumnFlags_WidthFixed, init_width <= 0 (default) --> width is automatic
|
||||||
// - with ImGuiTableColumnFlags_WidthFixed, init_width > 0 (explicit) --> width is custom
|
// - with ImGuiTableColumnFlags_WidthFixed, init_width > 0 (explicit) --> width is custom
|
||||||
// - with ImGuiTableColumnFlags_WidthStretch, init_weight <= 0 (default) --> weight is 1.0f
|
// - with ImGuiTableColumnFlags_WidthStretch, init_weight <= 0 (default) --> weight is 1.0f
|
||||||
// - with ImGuiTableColumnFlags_WidthStretch, init_weight > 0 (explicit) --> weight is custom
|
// - with ImGuiTableColumnFlags_WidthStretch, init_weight > 0 (explicit) --> weight is custom
|
||||||
// Widths are specified _without_ CellPadding. If you specify a width of 100.0f, the column will be cover (100.0f + Padding * 2.0f)
|
// Widths are specified _without_ CellPadding. If you specify a width of 100.0f, the column will be cover (100.0f + Padding * 2.0f)
|
||||||
// and you can fit a 100.0f wide item in it without clipping and with full padding.
|
// and you can fit a 100.0f wide item in it without clipping and with padding honored.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// About default sizing policy (if you don't specify a ImGuiTableColumnFlags_WidthXXXX flag)
|
// About default sizing policy (if you don't specify a ImGuiTableColumnFlags_WidthXXXX flag)
|
||||||
// - with Table policy ImGuiTableFlags_SizingFixedFit --> default Column policy is ImGuiTableColumnFlags_WidthFixed, default Width is equal to contents width
|
// - with Table policy ImGuiTableFlags_SizingFixedFit --> default Column policy is ImGuiTableColumnFlags_WidthFixed, default Width is equal to contents width
|
||||||
@@ -134,10 +135,10 @@ Index of this file:
|
|||||||
// - using mixed policies with ScrollX does not make much sense, as using Stretch columns with ScrollX does not make much sense in the first place!
|
// - using mixed policies with ScrollX does not make much sense, as using Stretch columns with ScrollX does not make much sense in the first place!
|
||||||
// that is, unless 'inner_width' is passed to BeginTable() to explicitly provide a total width to layout columns in.
|
// that is, unless 'inner_width' is passed to BeginTable() to explicitly provide a total width to layout columns in.
|
||||||
// - when using ImGuiTableFlags_SizingFixedSame with mixed columns, only the Fixed/Auto columns will match their widths to the width of the maximum contents.
|
// - when using ImGuiTableFlags_SizingFixedSame with mixed columns, only the Fixed/Auto columns will match their widths to the width of the maximum contents.
|
||||||
// - when using ImGuiTableFlags_SizingStretchSame with mixed columns, only the Stretch columns will match their weight/widths.
|
// - when using ImGuiTableFlags_SizingStretchSame with mixed columns, only the Stretch columns will match their weights/widths.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// About using column width:
|
// About using column width:
|
||||||
// If a column is manual resizable or has a width specified with TableSetupColumn():
|
// If a column is manually resizable or has a width specified with TableSetupColumn():
|
||||||
// - you may use GetContentRegionAvail().x to query the width available in a given column.
|
// - you may use GetContentRegionAvail().x to query the width available in a given column.
|
||||||
// - right-side alignment features such as SetNextItemWidth(-x) or PushItemWidth(-x) will rely on this width.
|
// - right-side alignment features such as SetNextItemWidth(-x) or PushItemWidth(-x) will rely on this width.
|
||||||
// If the column is not resizable and has no width specified with TableSetupColumn():
|
// If the column is not resizable and has no width specified with TableSetupColumn():
|
||||||
@@ -151,7 +152,7 @@ Index of this file:
|
|||||||
// TABLES CLIPPING/CULLING
|
// TABLES CLIPPING/CULLING
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// About clipping/culling of Rows in Tables:
|
// About clipping/culling of Rows in Tables:
|
||||||
// - For large numbers of rows, it is recommended you use ImGuiListClipper to only submit visible rows.
|
// - For large numbers of rows, it is recommended you use ImGuiListClipper to submit only visible rows.
|
||||||
// ImGuiListClipper is reliant on the fact that rows are of equal height.
|
// ImGuiListClipper is reliant on the fact that rows are of equal height.
|
||||||
// See 'Demo->Tables->Vertical Scrolling' or 'Demo->Tables->Advanced' for a demo of using the clipper.
|
// See 'Demo->Tables->Vertical Scrolling' or 'Demo->Tables->Advanced' for a demo of using the clipper.
|
||||||
// - Note that auto-resizing columns don't play well with using the clipper.
|
// - Note that auto-resizing columns don't play well with using the clipper.
|
||||||
@@ -168,7 +169,7 @@ Index of this file:
|
|||||||
// - Case C: column is hidden explicitly by the user (e.g. via the context menu, or _DefaultHide column flag, etc.).
|
// - Case C: column is hidden explicitly by the user (e.g. via the context menu, or _DefaultHide column flag, etc.).
|
||||||
//
|
//
|
||||||
// [A] [B] [C]
|
// [A] [B] [C]
|
||||||
// TableNextColumn(): true false false -> [userland] when TableNextColumn() / TableSetColumnIndex() return false, user can skip submitting items but only if the column doesn't contribute to row height.
|
// TableNextColumn(): true false false -> [userland] when TableNextColumn() / TableSetColumnIndex() returns false, user can skip submitting items but only if the column doesn't contribute to row height.
|
||||||
// SkipItems: false false true -> [internal] when SkipItems is true, most widgets will early out if submitted, resulting is no layout output.
|
// SkipItems: false false true -> [internal] when SkipItems is true, most widgets will early out if submitted, resulting is no layout output.
|
||||||
// ClipRect: normal zero-width zero-width -> [internal] when ClipRect is zero, ItemAdd() will return false and most widgets will early out mid-way.
|
// ClipRect: normal zero-width zero-width -> [internal] when ClipRect is zero, ItemAdd() will return false and most widgets will early out mid-way.
|
||||||
// ImDrawList output: normal dummy dummy -> [internal] when using the dummy channel, ImDrawList submissions (if any) will be wasted (because cliprect is zero-width anyway).
|
// ImDrawList output: normal dummy dummy -> [internal] when using the dummy channel, ImDrawList submissions (if any) will be wasted (because cliprect is zero-width anyway).
|
||||||
@@ -188,20 +189,16 @@ Index of this file:
|
|||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "imgui.h"
|
|
||||||
#ifndef IMGUI_DISABLE
|
|
||||||
|
|
||||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "imgui.h"
|
||||||
|
#ifndef IMGUI_DISABLE
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
|
|
||||||
// System includes
|
// System includes
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
|
||||||
#include <stddef.h> // intptr_t
|
|
||||||
#else
|
|
||||||
#include <stdint.h> // intptr_t
|
#include <stdint.h> // intptr_t
|
||||||
#endif
|
|
||||||
|
|
||||||
// Visual Studio warnings
|
// Visual Studio warnings
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@@ -315,11 +312,11 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Sanity checks
|
// Sanity checks
|
||||||
IM_ASSERT(columns_count > 0 && columns_count <= IMGUI_TABLE_MAX_COLUMNS && "Only 1..64 columns allowed!");
|
IM_ASSERT(columns_count > 0 && columns_count < IMGUI_TABLE_MAX_COLUMNS);
|
||||||
if (flags & ImGuiTableFlags_ScrollX)
|
if (flags & ImGuiTableFlags_ScrollX)
|
||||||
IM_ASSERT(inner_width >= 0.0f);
|
IM_ASSERT(inner_width >= 0.0f);
|
||||||
|
|
||||||
// If an outer size is specified ahead we will be able to early out when not visible. Exact clipping rules may evolve.
|
// If an outer size is specified ahead we will be able to early out when not visible. Exact clipping criteria may evolve.
|
||||||
const bool use_child_window = (flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) != 0;
|
const bool use_child_window = (flags & (ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY)) != 0;
|
||||||
const ImVec2 avail_size = GetContentRegionAvail();
|
const ImVec2 avail_size = GetContentRegionAvail();
|
||||||
ImVec2 actual_outer_size = CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f);
|
ImVec2 actual_outer_size = CalcItemSize(outer_size, ImMax(avail_size.x, 1.0f), use_child_window ? ImMax(avail_size.y, 1.0f) : 0.0f);
|
||||||
@@ -332,11 +329,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
|
|
||||||
// Acquire storage for the table
|
// Acquire storage for the table
|
||||||
ImGuiTable* table = g.Tables.GetOrAddByKey(id);
|
ImGuiTable* table = g.Tables.GetOrAddByKey(id);
|
||||||
const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
|
|
||||||
const ImGuiID instance_id = id + instance_no;
|
|
||||||
const ImGuiTableFlags table_last_flags = table->Flags;
|
const ImGuiTableFlags table_last_flags = table->Flags;
|
||||||
if (instance_no > 0)
|
|
||||||
IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
|
|
||||||
|
|
||||||
// Acquire temporary buffers
|
// Acquire temporary buffers
|
||||||
const int table_idx = g.Tables.GetIndex(table);
|
const int table_idx = g.Tables.GetIndex(table);
|
||||||
@@ -352,17 +345,32 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
flags = TableFixFlags(flags, outer_window);
|
flags = TableFixFlags(flags, outer_window);
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
|
const int instance_no = (table->LastFrameActive != g.FrameCount) ? 0 : table->InstanceCurrent + 1;
|
||||||
table->ID = id;
|
table->ID = id;
|
||||||
table->Flags = flags;
|
table->Flags = flags;
|
||||||
table->InstanceCurrent = (ImS16)instance_no;
|
|
||||||
table->LastFrameActive = g.FrameCount;
|
table->LastFrameActive = g.FrameCount;
|
||||||
table->OuterWindow = table->InnerWindow = outer_window;
|
table->OuterWindow = table->InnerWindow = outer_window;
|
||||||
table->ColumnsCount = columns_count;
|
table->ColumnsCount = columns_count;
|
||||||
table->IsLayoutLocked = false;
|
table->IsLayoutLocked = false;
|
||||||
table->InnerWidth = inner_width;
|
table->InnerWidth = inner_width;
|
||||||
temp_data->UserOuterSize = outer_size;
|
temp_data->UserOuterSize = outer_size;
|
||||||
if (instance_no > 0 && table->InstanceDataExtra.Size < instance_no)
|
|
||||||
table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
|
// Instance data (for instance 0, TableID == TableInstanceID)
|
||||||
|
ImGuiID instance_id;
|
||||||
|
table->InstanceCurrent = (ImS16)instance_no;
|
||||||
|
if (instance_no > 0)
|
||||||
|
{
|
||||||
|
IM_ASSERT(table->ColumnsCount == columns_count && "BeginTable(): Cannot change columns count mid-frame while preserving same ID");
|
||||||
|
if (table->InstanceDataExtra.Size < instance_no)
|
||||||
|
table->InstanceDataExtra.push_back(ImGuiTableInstanceData());
|
||||||
|
instance_id = GetIDWithSeed(instance_no, GetIDWithSeed("##Instances", NULL, id)); // Push "##Instances" followed by (int)instance_no in ID stack.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
instance_id = id;
|
||||||
|
}
|
||||||
|
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||||
|
table_instance->TableInstanceID = instance_id;
|
||||||
|
|
||||||
// When not using a child window, WorkRect.Max will grow as we append contents.
|
// When not using a child window, WorkRect.Max will grow as we append contents.
|
||||||
if (use_child_window)
|
if (use_child_window)
|
||||||
@@ -395,6 +403,14 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
table->OuterRect = table->InnerWindow->Rect();
|
table->OuterRect = table->InnerWindow->Rect();
|
||||||
table->InnerRect = table->InnerWindow->InnerRect;
|
table->InnerRect = table->InnerWindow->InnerRect;
|
||||||
IM_ASSERT(table->InnerWindow->WindowPadding.x == 0.0f && table->InnerWindow->WindowPadding.y == 0.0f && table->InnerWindow->WindowBorderSize == 0.0f);
|
IM_ASSERT(table->InnerWindow->WindowPadding.x == 0.0f && table->InnerWindow->WindowPadding.y == 0.0f && table->InnerWindow->WindowBorderSize == 0.0f);
|
||||||
|
|
||||||
|
// When using multiple instances, ensure they have the same amount of horizontal decorations (aka vertical scrollbar) so stretched columns can be aligned)
|
||||||
|
if (instance_no == 0)
|
||||||
|
{
|
||||||
|
table->HasScrollbarYPrev = table->HasScrollbarYCurr;
|
||||||
|
table->HasScrollbarYCurr = false;
|
||||||
|
}
|
||||||
|
table->HasScrollbarYCurr |= table->InnerWindow->ScrollbarY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -404,7 +420,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Push a standardized ID for both child-using and not-child-using tables
|
// Push a standardized ID for both child-using and not-child-using tables
|
||||||
PushOverrideID(instance_id);
|
PushOverrideID(id);
|
||||||
|
if (instance_no > 0)
|
||||||
|
PushOverrideID(instance_id); // FIXME: Somehow this is not resolved by stack-tool, even tho GetIDWithSeed() submitted the symbol.
|
||||||
|
|
||||||
// Backup a copy of host window members we will modify
|
// Backup a copy of host window members we will modify
|
||||||
ImGuiWindow* inner_window = table->InnerWindow;
|
ImGuiWindow* inner_window = table->InnerWindow;
|
||||||
@@ -456,12 +474,13 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
table->IsUnfrozenRows = true;
|
table->IsUnfrozenRows = true;
|
||||||
table->DeclColumnsCount = 0;
|
table->DeclColumnsCount = 0;
|
||||||
|
|
||||||
// Using opaque colors facilitate overlapping elements of the grid
|
// Using opaque colors facilitate overlapping lines of the grid, otherwise we'd need to improve TableDrawBorders()
|
||||||
table->BorderColorStrong = GetColorU32(ImGuiCol_TableBorderStrong);
|
table->BorderColorStrong = GetColorU32(ImGuiCol_TableBorderStrong);
|
||||||
table->BorderColorLight = GetColorU32(ImGuiCol_TableBorderLight);
|
table->BorderColorLight = GetColorU32(ImGuiCol_TableBorderLight);
|
||||||
|
|
||||||
// Make table current
|
// Make table current
|
||||||
g.CurrentTable = table;
|
g.CurrentTable = table;
|
||||||
|
outer_window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX();
|
||||||
outer_window->DC.CurrentTableIdx = table_idx;
|
outer_window->DC.CurrentTableIdx = table_idx;
|
||||||
if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly.
|
if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly.
|
||||||
inner_window->DC.CurrentTableIdx = table_idx;
|
inner_window->DC.CurrentTableIdx = table_idx;
|
||||||
@@ -469,7 +488,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
if ((table_last_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0)
|
if ((table_last_flags & ImGuiTableFlags_Reorderable) && (flags & ImGuiTableFlags_Reorderable) == 0)
|
||||||
table->IsResetDisplayOrderRequest = true;
|
table->IsResetDisplayOrderRequest = true;
|
||||||
|
|
||||||
// Mark as used
|
// Mark as used to avoid GC
|
||||||
if (table_idx >= g.TablesLastTimeActive.Size)
|
if (table_idx >= g.TablesLastTimeActive.Size)
|
||||||
g.TablesLastTimeActive.resize(table_idx + 1, -1.0f);
|
g.TablesLastTimeActive.resize(table_idx + 1, -1.0f);
|
||||||
g.TablesLastTimeActive[table_idx] = (float)g.Time;
|
g.TablesLastTimeActive[table_idx] = (float)g.Time;
|
||||||
@@ -562,34 +581,40 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For reference, the average total _allocation count_ for a table is:
|
// For reference, the average total _allocation count_ for a table is:
|
||||||
// + 0 (for ImGuiTable instance, we are pooling allocations in g.Tables)
|
// + 0 (for ImGuiTable instance, we are pooling allocations in g.Tables[])
|
||||||
// + 1 (for table->RawData allocated below)
|
// + 1 (for table->RawData allocated below)
|
||||||
// + 1 (for table->ColumnsNames, if names are used)
|
// + 1 (for table->ColumnsNames, if names are used)
|
||||||
// Shared allocations per number of nested tables
|
// Shared allocations for the maximum number of simultaneously nested tables (generally a very small number)
|
||||||
// + 1 (for table->Splitter._Channels)
|
// + 1 (for table->Splitter._Channels)
|
||||||
// + 2 * active_channels_count (for ImDrawCmd and ImDrawIdx buffers inside channels)
|
// + 2 * active_channels_count (for ImDrawCmd and ImDrawIdx buffers inside channels)
|
||||||
// Where active_channels_count is variable but often == columns_count or columns_count + 1, see TableSetupDrawChannels() for details.
|
// Where active_channels_count is variable but often == columns_count or == columns_count + 1, see TableSetupDrawChannels() for details.
|
||||||
// Unused channels don't perform their +2 allocations.
|
// Unused channels don't perform their +2 allocations.
|
||||||
void ImGui::TableBeginInitMemory(ImGuiTable* table, int columns_count)
|
void ImGui::TableBeginInitMemory(ImGuiTable* table, int columns_count)
|
||||||
{
|
{
|
||||||
// Allocate single buffer for our arrays
|
// Allocate single buffer for our arrays
|
||||||
ImSpanAllocator<3> span_allocator;
|
const int columns_bit_array_size = (int)ImBitArrayGetStorageSizeInBytes(columns_count);
|
||||||
|
ImSpanAllocator<6> span_allocator;
|
||||||
span_allocator.Reserve(0, columns_count * sizeof(ImGuiTableColumn));
|
span_allocator.Reserve(0, columns_count * sizeof(ImGuiTableColumn));
|
||||||
span_allocator.Reserve(1, columns_count * sizeof(ImGuiTableColumnIdx));
|
span_allocator.Reserve(1, columns_count * sizeof(ImGuiTableColumnIdx));
|
||||||
span_allocator.Reserve(2, columns_count * sizeof(ImGuiTableCellData), 4);
|
span_allocator.Reserve(2, columns_count * sizeof(ImGuiTableCellData), 4);
|
||||||
|
for (int n = 3; n < 6; n++)
|
||||||
|
span_allocator.Reserve(n, columns_bit_array_size);
|
||||||
table->RawData = IM_ALLOC(span_allocator.GetArenaSizeInBytes());
|
table->RawData = IM_ALLOC(span_allocator.GetArenaSizeInBytes());
|
||||||
memset(table->RawData, 0, span_allocator.GetArenaSizeInBytes());
|
memset(table->RawData, 0, span_allocator.GetArenaSizeInBytes());
|
||||||
span_allocator.SetArenaBasePtr(table->RawData);
|
span_allocator.SetArenaBasePtr(table->RawData);
|
||||||
span_allocator.GetSpan(0, &table->Columns);
|
span_allocator.GetSpan(0, &table->Columns);
|
||||||
span_allocator.GetSpan(1, &table->DisplayOrderToIndex);
|
span_allocator.GetSpan(1, &table->DisplayOrderToIndex);
|
||||||
span_allocator.GetSpan(2, &table->RowCellData);
|
span_allocator.GetSpan(2, &table->RowCellData);
|
||||||
|
table->EnabledMaskByDisplayOrder = (ImU32*)span_allocator.GetSpanPtrBegin(3);
|
||||||
|
table->EnabledMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(4);
|
||||||
|
table->VisibleMaskByIndex = (ImU32*)span_allocator.GetSpanPtrBegin(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply queued resizing/reordering/hiding requests
|
// Apply queued resizing/reordering/hiding requests
|
||||||
void ImGui::TableBeginApplyRequests(ImGuiTable* table)
|
void ImGui::TableBeginApplyRequests(ImGuiTable* table)
|
||||||
{
|
{
|
||||||
// Handle resizing request
|
// Handle resizing request
|
||||||
// (We process this at the first TableBegin of the frame)
|
// (We process this in the TableBegin() of the first instance of each table)
|
||||||
// FIXME-TABLE: Contains columns if our work area doesn't allow for scrolling?
|
// FIXME-TABLE: Contains columns if our work area doesn't allow for scrolling?
|
||||||
if (table->InstanceCurrent == 0)
|
if (table->InstanceCurrent == 0)
|
||||||
{
|
{
|
||||||
@@ -634,8 +659,7 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table)
|
|||||||
table->Columns[table->DisplayOrderToIndex[order_n]].DisplayOrder -= (ImGuiTableColumnIdx)reorder_dir;
|
table->Columns[table->DisplayOrderToIndex[order_n]].DisplayOrder -= (ImGuiTableColumnIdx)reorder_dir;
|
||||||
IM_ASSERT(dst_column->DisplayOrder == dst_order - reorder_dir);
|
IM_ASSERT(dst_column->DisplayOrder == dst_order - reorder_dir);
|
||||||
|
|
||||||
// Display order is stored in both columns->IndexDisplayOrder and table->DisplayOrder[],
|
// Display order is stored in both columns->IndexDisplayOrder and table->DisplayOrder[]. Rebuild later from the former.
|
||||||
// rebuild the later from the former.
|
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
table->DisplayOrderToIndex[table->Columns[column_n].DisplayOrder] = (ImGuiTableColumnIdx)column_n;
|
table->DisplayOrderToIndex[table->Columns[column_n].DisplayOrder] = (ImGuiTableColumnIdx)column_n;
|
||||||
table->ReorderColumnDir = 0;
|
table->ReorderColumnDir = 0;
|
||||||
@@ -709,8 +733,8 @@ static void TableSetupColumnFlags(ImGuiTable* table, ImGuiTableColumn* column, I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Layout columns for the frame. This is in essence the followup to BeginTable().
|
// Layout columns for the frame. This is in essence the followup to BeginTable() and this is our largest function.
|
||||||
// Runs on the first call to TableNextRow(), to give a chance for TableSetupColumn() to be called first.
|
// Runs on the first call to TableNextRow(), to give a chance for TableSetupColumn() and other TableSetupXXXXX() functions to be called first.
|
||||||
// FIXME-TABLE: Our width (and therefore our WorkRect) will be minimal in the first frame for _WidthAuto columns.
|
// FIXME-TABLE: Our width (and therefore our WorkRect) will be minimal in the first frame for _WidthAuto columns.
|
||||||
// Increase feedback side-effect with widgets relying on WorkRect.Max.x... Maybe provide a default distribution for _WidthAuto columns?
|
// Increase feedback side-effect with widgets relying on WorkRect.Max.x... Maybe provide a default distribution for _WidthAuto columns?
|
||||||
void ImGui::TableUpdateLayout(ImGuiTable* table)
|
void ImGui::TableUpdateLayout(ImGuiTable* table)
|
||||||
@@ -721,8 +745,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
const ImGuiTableFlags table_sizing_policy = (table->Flags & ImGuiTableFlags_SizingMask_);
|
const ImGuiTableFlags table_sizing_policy = (table->Flags & ImGuiTableFlags_SizingMask_);
|
||||||
table->IsDefaultDisplayOrder = true;
|
table->IsDefaultDisplayOrder = true;
|
||||||
table->ColumnsEnabledCount = 0;
|
table->ColumnsEnabledCount = 0;
|
||||||
table->EnabledMaskByIndex = 0x00;
|
ImBitArrayClearAllBits(table->EnabledMaskByIndex, table->ColumnsCount);
|
||||||
table->EnabledMaskByDisplayOrder = 0x00;
|
ImBitArrayClearAllBits(table->EnabledMaskByDisplayOrder, table->ColumnsCount);
|
||||||
table->LeftMostEnabledColumn = -1;
|
table->LeftMostEnabledColumn = -1;
|
||||||
table->MinColumnWidth = ImMax(1.0f, g.Style.FramePadding.x * 1.0f); // g.Style.ColumnsMinSpacing; // FIXME-TABLE
|
table->MinColumnWidth = ImMax(1.0f, g.Style.FramePadding.x * 1.0f); // g.Style.ColumnsMinSpacing; // FIXME-TABLE
|
||||||
|
|
||||||
@@ -787,8 +811,8 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
else
|
else
|
||||||
table->LeftMostEnabledColumn = (ImGuiTableColumnIdx)column_n;
|
table->LeftMostEnabledColumn = (ImGuiTableColumnIdx)column_n;
|
||||||
column->IndexWithinEnabledSet = table->ColumnsEnabledCount++;
|
column->IndexWithinEnabledSet = table->ColumnsEnabledCount++;
|
||||||
table->EnabledMaskByIndex |= (ImU64)1 << column_n;
|
ImBitArraySetBit(table->EnabledMaskByIndex, column_n);
|
||||||
table->EnabledMaskByDisplayOrder |= (ImU64)1 << column->DisplayOrder;
|
ImBitArraySetBit(table->EnabledMaskByDisplayOrder, column->DisplayOrder);
|
||||||
prev_visible_column_idx = column_n;
|
prev_visible_column_idx = column_n;
|
||||||
IM_ASSERT(column->IndexWithinEnabledSet <= column->DisplayOrder);
|
IM_ASSERT(column->IndexWithinEnabledSet <= column->DisplayOrder);
|
||||||
|
|
||||||
@@ -831,12 +855,12 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
table->IsSettingsDirty = true;
|
table->IsSettingsDirty = true;
|
||||||
|
|
||||||
// [Part 3] Fix column flags and record a few extra information.
|
// [Part 3] Fix column flags and record a few extra information.
|
||||||
float sum_width_requests = 0.0f; // Sum of all width for fixed and auto-resize columns, excluding width contributed by Stretch columns but including spacing/padding.
|
float sum_width_requests = 0.0f; // Sum of all width for fixed and auto-resize columns, excluding width contributed by Stretch columns but including spacing/padding.
|
||||||
float stretch_sum_weights = 0.0f; // Sum of all weights for stretch columns.
|
float stretch_sum_weights = 0.0f; // Sum of all weights for stretch columns.
|
||||||
table->LeftMostStretchedColumn = table->RightMostStretchedColumn = -1;
|
table->LeftMostStretchedColumn = table->RightMostStretchedColumn = -1;
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
{
|
{
|
||||||
if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n)))
|
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
|
||||||
continue;
|
continue;
|
||||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||||
|
|
||||||
@@ -852,7 +876,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
// Latch initial size for fixed columns and update it constantly for auto-resizing column (unless clipped!)
|
// Latch initial size for fixed columns and update it constantly for auto-resizing column (unless clipped!)
|
||||||
if (column->AutoFitQueue != 0x00)
|
if (column->AutoFitQueue != 0x00)
|
||||||
column->WidthRequest = width_auto;
|
column->WidthRequest = width_auto;
|
||||||
else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)))
|
else if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !column_is_resizable && column->IsRequestOutput)
|
||||||
column->WidthRequest = width_auto;
|
column->WidthRequest = width_auto;
|
||||||
|
|
||||||
// FIXME-TABLE: Increase minimum size during init frame to avoid biasing auto-fitting widgets
|
// FIXME-TABLE: Increase minimum size during init frame to avoid biasing auto-fitting widgets
|
||||||
@@ -893,13 +917,14 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
// [Part 4] Apply final widths based on requested widths
|
// [Part 4] Apply final widths based on requested widths
|
||||||
const ImRect work_rect = table->WorkRect;
|
const ImRect work_rect = table->WorkRect;
|
||||||
const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
|
const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
|
||||||
const float width_avail = ((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth();
|
const float width_removed = (table->HasScrollbarYPrev && !table->InnerWindow->ScrollbarY) ? g.Style.ScrollbarSize : 0.0f; // To synchronize decoration width of synched tables with mismatching scrollbar state (#5920)
|
||||||
|
const float width_avail = ImMax(1.0f, (((table->Flags & ImGuiTableFlags_ScrollX) && table->InnerWidth == 0.0f) ? table->InnerClipRect.GetWidth() : work_rect.GetWidth()) - width_removed);
|
||||||
const float width_avail_for_stretched_columns = width_avail - width_spacings - sum_width_requests;
|
const float width_avail_for_stretched_columns = width_avail - width_spacings - sum_width_requests;
|
||||||
float width_remaining_for_stretched_columns = width_avail_for_stretched_columns;
|
float width_remaining_for_stretched_columns = width_avail_for_stretched_columns;
|
||||||
table->ColumnsGivenWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount;
|
table->ColumnsGivenWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount;
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
{
|
{
|
||||||
if (!(table->EnabledMaskByIndex & ((ImU64)1 << column_n)))
|
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
|
||||||
continue;
|
continue;
|
||||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||||
|
|
||||||
@@ -926,7 +951,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
if (width_remaining_for_stretched_columns >= 1.0f && !(table->Flags & ImGuiTableFlags_PreciseWidths))
|
if (width_remaining_for_stretched_columns >= 1.0f && !(table->Flags & ImGuiTableFlags_PreciseWidths))
|
||||||
for (int order_n = table->ColumnsCount - 1; stretch_sum_weights > 0.0f && width_remaining_for_stretched_columns >= 1.0f && order_n >= 0; order_n--)
|
for (int order_n = table->ColumnsCount - 1; stretch_sum_weights > 0.0f && width_remaining_for_stretched_columns >= 1.0f && order_n >= 0; order_n--)
|
||||||
{
|
{
|
||||||
if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
|
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||||
continue;
|
continue;
|
||||||
ImGuiTableColumn* column = &table->Columns[table->DisplayOrderToIndex[order_n]];
|
ImGuiTableColumn* column = &table->Columns[table->DisplayOrderToIndex[order_n]];
|
||||||
if (!(column->Flags & ImGuiTableColumnFlags_WidthStretch))
|
if (!(column->Flags & ImGuiTableColumnFlags_WidthStretch))
|
||||||
@@ -936,11 +961,21 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
width_remaining_for_stretched_columns -= 1.0f;
|
width_remaining_for_stretched_columns -= 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine if table is hovered which will be used to flag columns as hovered.
|
||||||
|
// - In principle we'd like to use the equivalent of IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
|
||||||
|
// but because our item is partially submitted at this point we use ItemHoverable() and a workaround (temporarily
|
||||||
|
// clear ActiveId, which is equivalent to the change provided by _AllowWhenBLockedByActiveItem).
|
||||||
|
// - This allows columns to be marked as hovered when e.g. clicking a button inside the column, or using drag and drop.
|
||||||
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||||
|
table_instance->HoveredRowLast = table_instance->HoveredRowNext;
|
||||||
|
table_instance->HoveredRowNext = -1;
|
||||||
table->HoveredColumnBody = -1;
|
table->HoveredColumnBody = -1;
|
||||||
table->HoveredColumnBorder = -1;
|
table->HoveredColumnBorder = -1;
|
||||||
const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table_instance->LastOuterHeight));
|
const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table_instance->LastOuterHeight));
|
||||||
const bool is_hovering_table = ItemHoverable(mouse_hit_rect, 0);
|
const ImGuiID backup_active_id = g.ActiveId;
|
||||||
|
g.ActiveId = 0;
|
||||||
|
const bool is_hovering_table = ItemHoverable(mouse_hit_rect, 0, ImGuiItemFlags_None);
|
||||||
|
g.ActiveId = backup_active_id;
|
||||||
|
|
||||||
// [Part 6] Setup final position, offset, skip/clip states and clipping rectangles, detect hovered column
|
// [Part 6] Setup final position, offset, skip/clip states and clipping rectangles, detect hovered column
|
||||||
// Process columns in their visible orders as we are comparing the visible order and adjusting host_clip_rect while looping.
|
// Process columns in their visible orders as we are comparing the visible order and adjusting host_clip_rect while looping.
|
||||||
@@ -949,14 +984,13 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
float offset_x = ((table->FreezeColumnsCount > 0) ? table->OuterRect.Min.x : work_rect.Min.x) + table->OuterPaddingX - table->CellSpacingX1;
|
float offset_x = ((table->FreezeColumnsCount > 0) ? table->OuterRect.Min.x : work_rect.Min.x) + table->OuterPaddingX - table->CellSpacingX1;
|
||||||
ImRect host_clip_rect = table->InnerClipRect;
|
ImRect host_clip_rect = table->InnerClipRect;
|
||||||
//host_clip_rect.Max.x += table->CellPaddingX + table->CellSpacingX2;
|
//host_clip_rect.Max.x += table->CellPaddingX + table->CellSpacingX2;
|
||||||
table->VisibleMaskByIndex = 0x00;
|
ImBitArrayClearAllBits(table->VisibleMaskByIndex, table->ColumnsCount);
|
||||||
table->RequestOutputMaskByIndex = 0x00;
|
|
||||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||||
{
|
{
|
||||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||||
|
|
||||||
column->NavLayerCurrent = (ImS8)((table->FreezeRowsCount > 0 || column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
|
column->NavLayerCurrent = (ImS8)(table->FreezeRowsCount > 0 ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main); // Use Count NOT request so Header line changes layer when frozen
|
||||||
|
|
||||||
if (offset_x_frozen && table->FreezeColumnsCount == visible_n)
|
if (offset_x_frozen && table->FreezeColumnsCount == visible_n)
|
||||||
{
|
{
|
||||||
@@ -967,7 +1001,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
// Clear status flags
|
// Clear status flags
|
||||||
column->Flags &= ~ImGuiTableColumnFlags_StatusMask_;
|
column->Flags &= ~ImGuiTableColumnFlags_StatusMask_;
|
||||||
|
|
||||||
if ((table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)) == 0)
|
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||||
{
|
{
|
||||||
// Hidden column: clear a few fields and we are done with it for the remainder of the function.
|
// Hidden column: clear a few fields and we are done with it for the remainder of the function.
|
||||||
// We set a zero-width clip rect but set Min.y/Max.y properly to not interfere with the clipper.
|
// We set a zero-width clip rect but set Min.y/Max.y properly to not interfere with the clipper.
|
||||||
@@ -1020,12 +1054,10 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
column->IsVisibleY = true; // (column->ClipRect.Max.y > column->ClipRect.Min.y);
|
column->IsVisibleY = true; // (column->ClipRect.Max.y > column->ClipRect.Min.y);
|
||||||
const bool is_visible = column->IsVisibleX; //&& column->IsVisibleY;
|
const bool is_visible = column->IsVisibleX; //&& column->IsVisibleY;
|
||||||
if (is_visible)
|
if (is_visible)
|
||||||
table->VisibleMaskByIndex |= ((ImU64)1 << column_n);
|
ImBitArraySetBit(table->VisibleMaskByIndex, column_n);
|
||||||
|
|
||||||
// Mark column as requesting output from user. Note that fixed + non-resizable sets are auto-fitting at all times and therefore always request output.
|
// Mark column as requesting output from user. Note that fixed + non-resizable sets are auto-fitting at all times and therefore always request output.
|
||||||
column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0;
|
column->IsRequestOutput = is_visible || column->AutoFitQueue != 0 || column->CannotSkipItemsQueue != 0;
|
||||||
if (column->IsRequestOutput)
|
|
||||||
table->RequestOutputMaskByIndex |= ((ImU64)1 << column_n);
|
|
||||||
|
|
||||||
// Mark column as SkipItems (ignoring all items/layout)
|
// Mark column as SkipItems (ignoring all items/layout)
|
||||||
column->IsSkipItems = !column->IsEnabled || table->HostSkipItems;
|
column->IsSkipItems = !column->IsEnabled || table->HostSkipItems;
|
||||||
@@ -1094,6 +1126,14 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
table->BorderX1 = table->InnerClipRect.Min.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : -1.0f);
|
table->BorderX1 = table->InnerClipRect.Min.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : -1.0f);
|
||||||
table->BorderX2 = table->InnerClipRect.Max.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : +1.0f);
|
table->BorderX2 = table->InnerClipRect.Max.x;// +((table->Flags & ImGuiTableFlags_BordersOuter) ? 0.0f : +1.0f);
|
||||||
|
|
||||||
|
// Setup window's WorkRect.Max.y for GetContentRegionAvail(). Other values will be updated in each TableBeginCell() call.
|
||||||
|
float window_content_max_y;
|
||||||
|
if (table->Flags & ImGuiTableFlags_NoHostExtendY)
|
||||||
|
window_content_max_y = table->OuterRect.Max.y;
|
||||||
|
else
|
||||||
|
window_content_max_y = ImMax(table->InnerWindow->ContentRegionRect.Max.y, (table->Flags & ImGuiTableFlags_ScrollY) ? 0.0f : table->OuterRect.Max.y);
|
||||||
|
table->InnerWindow->WorkRect.Max.y = ImClamp(window_content_max_y - g.Style.CellPadding.y, table->InnerWindow->WorkRect.Min.y, table->InnerWindow->WorkRect.Max.y);
|
||||||
|
|
||||||
// [Part 9] Allocate draw channels and setup background cliprect
|
// [Part 9] Allocate draw channels and setup background cliprect
|
||||||
TableSetupDrawChannels(table);
|
TableSetupDrawChannels(table);
|
||||||
|
|
||||||
@@ -1105,25 +1145,24 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
table->IsUsingHeaders = false;
|
table->IsUsingHeaders = false;
|
||||||
|
|
||||||
// [Part 11] Context menu
|
// [Part 11] Context menu
|
||||||
if (table->IsContextPopupOpen && table->InstanceCurrent == table->InstanceInteracted)
|
if (TableBeginContextMenuPopup(table))
|
||||||
{
|
{
|
||||||
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
|
TableDrawContextMenu(table);
|
||||||
if (BeginPopupEx(context_menu_id, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings))
|
EndPopup();
|
||||||
{
|
|
||||||
TableDrawContextMenu(table);
|
|
||||||
EndPopup();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
table->IsContextPopupOpen = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Part 13] Sanitize and build sort specs before we have a change to use them for display.
|
// [Part 12] Sanitize and build sort specs before we have a chance to use them for display.
|
||||||
// This path will only be exercised when sort specs are modified before header rows (e.g. init or visibility change)
|
// This path will only be exercised when sort specs are modified before header rows (e.g. init or visibility change)
|
||||||
if (table->IsSortSpecsDirty && (table->Flags & ImGuiTableFlags_Sortable))
|
if (table->IsSortSpecsDirty && (table->Flags & ImGuiTableFlags_Sortable))
|
||||||
TableSortSpecsBuild(table);
|
TableSortSpecsBuild(table);
|
||||||
|
|
||||||
|
// [Part 13] Setup inner window decoration size (for scrolling / nav tracking to properly take account of frozen rows/columns)
|
||||||
|
if (table->FreezeColumnsRequest > 0)
|
||||||
|
table->InnerWindow->DecoInnerSizeX1 = table->Columns[table->DisplayOrderToIndex[table->FreezeColumnsRequest - 1]].MaxX - table->OuterRect.Min.x;
|
||||||
|
if (table->FreezeRowsRequest > 0)
|
||||||
|
table->InnerWindow->DecoInnerSizeY1 = table_instance->LastFrozenHeight;
|
||||||
|
table_instance->LastFrozenHeight = 0.0f;
|
||||||
|
|
||||||
// Initial state
|
// Initial state
|
||||||
ImGuiWindow* inner_window = table->InnerWindow;
|
ImGuiWindow* inner_window = table->InnerWindow;
|
||||||
if (table->Flags & ImGuiTableFlags_NoClip)
|
if (table->Flags & ImGuiTableFlags_NoClip)
|
||||||
@@ -1133,9 +1172,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
|
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
|
||||||
// - Set table->HoveredColumnBorder with a short delay/timer to reduce feedback noise
|
// - Set table->HoveredColumnBorder with a short delay/timer to reduce visual feedback noise.
|
||||||
// - Submit ahead of table contents and header, use ImGuiButtonFlags_AllowItemOverlap to prioritize widgets
|
|
||||||
// overlapping the same area.
|
|
||||||
void ImGui::TableUpdateBorders(ImGuiTable* table)
|
void ImGui::TableUpdateBorders(ImGuiTable* table)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
@@ -1153,7 +1190,7 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
|
|||||||
|
|
||||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||||
{
|
{
|
||||||
if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
|
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||||
@@ -1171,11 +1208,11 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
|
|||||||
|
|
||||||
ImGuiID column_id = TableGetColumnResizeID(table, column_n, table->InstanceCurrent);
|
ImGuiID column_id = TableGetColumnResizeID(table, column_n, table->InstanceCurrent);
|
||||||
ImRect hit_rect(column->MaxX - hit_half_width, hit_y1, column->MaxX + hit_half_width, border_y2_hit);
|
ImRect hit_rect(column->MaxX - hit_half_width, hit_y1, column->MaxX + hit_half_width, border_y2_hit);
|
||||||
|
ItemAdd(hit_rect, column_id, NULL, ImGuiItemFlags_NoNav);
|
||||||
//GetForegroundDrawList()->AddRect(hit_rect.Min, hit_rect.Max, IM_COL32(255, 0, 0, 100));
|
//GetForegroundDrawList()->AddRect(hit_rect.Min, hit_rect.Max, IM_COL32(255, 0, 0, 100));
|
||||||
KeepAliveID(column_id);
|
|
||||||
|
|
||||||
bool hovered = false, held = false;
|
bool hovered = false, held = false;
|
||||||
bool pressed = ButtonBehavior(hit_rect, column_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_NoNavFocus);
|
bool pressed = ButtonBehavior(hit_rect, column_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_NoNavFocus);
|
||||||
if (pressed && IsMouseDoubleClicked(0))
|
if (pressed && IsMouseDoubleClicked(0))
|
||||||
{
|
{
|
||||||
TableSetColumnWidthAutoSingle(table, column_n);
|
TableSetColumnWidthAutoSingle(table, column_n);
|
||||||
@@ -1289,7 +1326,7 @@ void ImGui::EndTable()
|
|||||||
float auto_fit_width_for_stretched = 0.0f;
|
float auto_fit_width_for_stretched = 0.0f;
|
||||||
float auto_fit_width_for_stretched_min = 0.0f;
|
float auto_fit_width_for_stretched_min = 0.0f;
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
if (table->EnabledMaskByIndex & ((ImU64)1 << column_n))
|
if (IM_BITARRAY_TESTBIT(table->EnabledMaskByIndex, column_n))
|
||||||
{
|
{
|
||||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||||
float column_width_request = ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize)) ? column->WidthRequest : TableGetColumnWidthAuto(table, column);
|
float column_width_request = ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize)) ? column->WidthRequest : TableGetColumnWidthAuto(table, column);
|
||||||
@@ -1329,8 +1366,10 @@ void ImGui::EndTable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Pop from id stack
|
// Pop from id stack
|
||||||
IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table->ID + table->InstanceCurrent, "Mismatching PushID/PopID!");
|
IM_ASSERT_USER_ERROR(inner_window->IDStack.back() == table_instance->TableInstanceID, "Mismatching PushID/PopID!");
|
||||||
IM_ASSERT_USER_ERROR(outer_window->DC.ItemWidthStack.Size >= temp_data->HostBackupItemWidthStackSize, "Too many PopItemWidth!");
|
IM_ASSERT_USER_ERROR(outer_window->DC.ItemWidthStack.Size >= temp_data->HostBackupItemWidthStackSize, "Too many PopItemWidth!");
|
||||||
|
if (table->InstanceCurrent > 0)
|
||||||
|
PopID();
|
||||||
PopID();
|
PopID();
|
||||||
|
|
||||||
// Restore window data that we modified
|
// Restore window data that we modified
|
||||||
@@ -1402,6 +1441,7 @@ void ImGui::EndTable()
|
|||||||
g.CurrentTable->DrawSplitter = &temp_data->DrawSplitter;
|
g.CurrentTable->DrawSplitter = &temp_data->DrawSplitter;
|
||||||
}
|
}
|
||||||
outer_window->DC.CurrentTableIdx = g.CurrentTable ? g.Tables.GetIndex(g.CurrentTable) : -1;
|
outer_window->DC.CurrentTableIdx = g.CurrentTable ? g.Tables.GetIndex(g.CurrentTable) : -1;
|
||||||
|
NavUpdateCurrentWindowIsScrollPushableX();
|
||||||
}
|
}
|
||||||
|
|
||||||
// See "COLUMN SIZING POLICIES" comments at the top of this file
|
// See "COLUMN SIZING POLICIES" comments at the top of this file
|
||||||
@@ -1513,6 +1553,7 @@ void ImGui::TableSetupScrollFreeze(int columns, int rows)
|
|||||||
// - TableGetCellBgRect() [Internal]
|
// - TableGetCellBgRect() [Internal]
|
||||||
// - TableGetColumnResizeID() [Internal]
|
// - TableGetColumnResizeID() [Internal]
|
||||||
// - TableGetHoveredColumn() [Internal]
|
// - TableGetHoveredColumn() [Internal]
|
||||||
|
// - TableGetHoveredRow() [Internal]
|
||||||
// - TableSetBgColor()
|
// - TableSetBgColor()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -1600,14 +1641,14 @@ ImRect ImGui::TableGetCellBgRect(const ImGuiTable* table, int column_n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return the resizing ID for the right-side of the given column.
|
// Return the resizing ID for the right-side of the given column.
|
||||||
ImGuiID ImGui::TableGetColumnResizeID(const ImGuiTable* table, int column_n, int instance_no)
|
ImGuiID ImGui::TableGetColumnResizeID(ImGuiTable* table, int column_n, int instance_no)
|
||||||
{
|
{
|
||||||
IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount);
|
IM_ASSERT(column_n >= 0 && column_n < table->ColumnsCount);
|
||||||
ImGuiID id = table->ID + 1 + (instance_no * table->ColumnsCount) + column_n;
|
ImGuiID instance_id = TableGetInstanceID(table, instance_no);
|
||||||
return id;
|
return instance_id + 1 + column_n; // FIXME: #6140: still not ideal
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return -1 when table is not hovered. return columns_count if the unused space at the right of visible columns is hovered.
|
// Return -1 when table is not hovered. return columns_count if hovering the unused space at the right of the right-most visible column.
|
||||||
int ImGui::TableGetHoveredColumn()
|
int ImGui::TableGetHoveredColumn()
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
@@ -1617,6 +1658,19 @@ int ImGui::TableGetHoveredColumn()
|
|||||||
return (int)table->HoveredColumnBody;
|
return (int)table->HoveredColumnBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return -1 when table is not hovered. Return maxrow+1 if in table but below last submitted row.
|
||||||
|
// *IMPORTANT* Unlike TableGetHoveredColumn(), this has a one frame latency in updating the value.
|
||||||
|
// This difference with is the reason why this is not public yet.
|
||||||
|
int ImGui::TableGetHoveredRow()
|
||||||
|
{
|
||||||
|
ImGuiContext& g = *GImGui;
|
||||||
|
ImGuiTable* table = g.CurrentTable;
|
||||||
|
if (!table)
|
||||||
|
return -1;
|
||||||
|
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
|
||||||
|
return (int)table_instance->HoveredRowLast;
|
||||||
|
}
|
||||||
|
|
||||||
void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n)
|
void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
@@ -1635,7 +1689,7 @@ void ImGui::TableSetBgColor(ImGuiTableBgTarget target, ImU32 color, int column_n
|
|||||||
return;
|
return;
|
||||||
if (column_n == -1)
|
if (column_n == -1)
|
||||||
column_n = table->CurrentColumn;
|
column_n = table->CurrentColumn;
|
||||||
if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
|
if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n))
|
||||||
return;
|
return;
|
||||||
if (table->RowCellDataCurrent < 0 || table->RowCellData[table->RowCellDataCurrent].Column != column_n)
|
if (table->RowCellDataCurrent < 0 || table->RowCellData[table->RowCellDataCurrent].Column != column_n)
|
||||||
table->RowCellDataCurrent++;
|
table->RowCellDataCurrent++;
|
||||||
@@ -1725,6 +1779,8 @@ void ImGui::TableBeginRow(ImGuiTable* table)
|
|||||||
table->RowTextBaseline = 0.0f;
|
table->RowTextBaseline = 0.0f;
|
||||||
table->RowIndentOffsetX = window->DC.Indent.x - table->HostIndentX; // Lock indent
|
table->RowIndentOffsetX = window->DC.Indent.x - table->HostIndentX; // Lock indent
|
||||||
window->DC.PrevLineTextBaseOffset = 0.0f;
|
window->DC.PrevLineTextBaseOffset = 0.0f;
|
||||||
|
window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
|
||||||
|
window->DC.IsSameLine = window->DC.IsSetPos = false;
|
||||||
window->DC.CursorMaxPos.y = next_y1;
|
window->DC.CursorMaxPos.y = next_y1;
|
||||||
|
|
||||||
// Making the header BG color non-transparent will allow us to overlay it multiple times when handling smooth dragging.
|
// Making the header BG color non-transparent will allow us to overlay it multiple times when handling smooth dragging.
|
||||||
@@ -1766,6 +1822,10 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
|||||||
const bool is_visible = (bg_y2 >= table->InnerClipRect.Min.y && bg_y1 <= table->InnerClipRect.Max.y);
|
const bool is_visible = (bg_y2 >= table->InnerClipRect.Min.y && bg_y1 <= table->InnerClipRect.Max.y);
|
||||||
if (is_visible)
|
if (is_visible)
|
||||||
{
|
{
|
||||||
|
// Update data for TableGetHoveredRow()
|
||||||
|
if (table->HoveredColumnBody != -1 && g.IO.MousePos.y >= bg_y1 && g.IO.MousePos.y < bg_y2)
|
||||||
|
TableGetInstanceData(table, table->InstanceCurrent)->HoveredRowNext = table->CurrentRow;
|
||||||
|
|
||||||
// Decide of background color for the row
|
// Decide of background color for the row
|
||||||
ImU32 bg_col0 = 0;
|
ImU32 bg_col0 = 0;
|
||||||
ImU32 bg_col1 = 0;
|
ImU32 bg_col1 = 0;
|
||||||
@@ -1837,17 +1897,15 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
|||||||
// get the new cursor position.
|
// get the new cursor position.
|
||||||
if (unfreeze_rows_request)
|
if (unfreeze_rows_request)
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
{
|
table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main;
|
||||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
|
||||||
column->NavLayerCurrent = (ImS8)((column_n < table->FreezeColumnsCount) ? ImGuiNavLayer_Menu : ImGuiNavLayer_Main);
|
|
||||||
}
|
|
||||||
if (unfreeze_rows_actual)
|
if (unfreeze_rows_actual)
|
||||||
{
|
{
|
||||||
IM_ASSERT(table->IsUnfrozenRows == false);
|
IM_ASSERT(table->IsUnfrozenRows == false);
|
||||||
|
const float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
|
||||||
table->IsUnfrozenRows = true;
|
table->IsUnfrozenRows = true;
|
||||||
|
TableGetInstanceData(table, table->InstanceCurrent)->LastFrozenHeight = y0 - table->OuterRect.Min.y;
|
||||||
|
|
||||||
// BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
|
// BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
|
||||||
float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
|
|
||||||
table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y);
|
table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y);
|
||||||
table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y;
|
table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y;
|
||||||
table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
|
table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
|
||||||
@@ -1910,7 +1968,7 @@ bool ImGui::TableSetColumnIndex(int column_n)
|
|||||||
|
|
||||||
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
||||||
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
||||||
return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
|
return table->Columns[column_n].IsRequestOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Public] Append into the next column, wrap and create a new row when already on last column
|
// [Public] Append into the next column, wrap and create a new row when already on last column
|
||||||
@@ -1935,8 +1993,7 @@ bool ImGui::TableNextColumn()
|
|||||||
|
|
||||||
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
// Return whether the column is visible. User may choose to skip submitting items based on this return value,
|
||||||
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
// however they shouldn't skip submitting for columns that may have the tallest contribution to row height.
|
||||||
int column_n = table->CurrentColumn;
|
return table->Columns[table->CurrentColumn].IsRequestOutput;
|
||||||
return (table->RequestOutputMaskByIndex & ((ImU64)1 << column_n)) != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1945,6 +2002,7 @@ bool ImGui::TableNextColumn()
|
|||||||
// FIXME-TABLE FIXME-OPT: Could probably shortcut some things for non-active or clipped columns.
|
// FIXME-TABLE FIXME-OPT: Could probably shortcut some things for non-active or clipped columns.
|
||||||
void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
|
void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
|
||||||
{
|
{
|
||||||
|
ImGuiContext& g = *GImGui;
|
||||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||||
ImGuiWindow* window = table->InnerWindow;
|
ImGuiWindow* window = table->InnerWindow;
|
||||||
table->CurrentColumn = column_n;
|
table->CurrentColumn = column_n;
|
||||||
@@ -1961,19 +2019,15 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
|
|||||||
window->DC.CurrLineTextBaseOffset = table->RowTextBaseline;
|
window->DC.CurrLineTextBaseOffset = table->RowTextBaseline;
|
||||||
window->DC.NavLayerCurrent = (ImGuiNavLayer)column->NavLayerCurrent;
|
window->DC.NavLayerCurrent = (ImGuiNavLayer)column->NavLayerCurrent;
|
||||||
|
|
||||||
|
// Note how WorkRect.Max.y is only set once during layout
|
||||||
window->WorkRect.Min.y = window->DC.CursorPos.y;
|
window->WorkRect.Min.y = window->DC.CursorPos.y;
|
||||||
window->WorkRect.Min.x = column->WorkMinX;
|
window->WorkRect.Min.x = column->WorkMinX;
|
||||||
window->WorkRect.Max.x = column->WorkMaxX;
|
window->WorkRect.Max.x = column->WorkMaxX;
|
||||||
window->DC.ItemWidth = column->ItemWidth;
|
window->DC.ItemWidth = column->ItemWidth;
|
||||||
|
|
||||||
// To allow ImGuiListClipper to function we propagate our row height
|
|
||||||
if (!column->IsEnabled)
|
|
||||||
window->DC.CursorPos.y = ImMax(window->DC.CursorPos.y, table->RowPosY2);
|
|
||||||
|
|
||||||
window->SkipItems = column->IsSkipItems;
|
window->SkipItems = column->IsSkipItems;
|
||||||
if (column->IsSkipItems)
|
if (column->IsSkipItems)
|
||||||
{
|
{
|
||||||
ImGuiContext& g = *GImGui;
|
|
||||||
g.LastItemData.ID = 0;
|
g.LastItemData.ID = 0;
|
||||||
g.LastItemData.StatusFlags = 0;
|
g.LastItemData.StatusFlags = 0;
|
||||||
}
|
}
|
||||||
@@ -1992,7 +2046,6 @@ void ImGui::TableBeginCell(ImGuiTable* table, int column_n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logging
|
// Logging
|
||||||
ImGuiContext& g = *GImGui;
|
|
||||||
if (g.LogEnabled && !column->IsSkipItems)
|
if (g.LogEnabled && !column->IsSkipItems)
|
||||||
{
|
{
|
||||||
LogRenderedText(&window->DC.CursorPos, "|");
|
LogRenderedText(&window->DC.CursorPos, "|");
|
||||||
@@ -2006,6 +2059,9 @@ void ImGui::TableEndCell(ImGuiTable* table)
|
|||||||
ImGuiTableColumn* column = &table->Columns[table->CurrentColumn];
|
ImGuiTableColumn* column = &table->Columns[table->CurrentColumn];
|
||||||
ImGuiWindow* window = table->InnerWindow;
|
ImGuiWindow* window = table->InnerWindow;
|
||||||
|
|
||||||
|
if (window->DC.IsSetPos)
|
||||||
|
ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
|
||||||
|
|
||||||
// Report maximum position so we can infer content size per column.
|
// Report maximum position so we can infer content size per column.
|
||||||
float* p_max_pos_x;
|
float* p_max_pos_x;
|
||||||
if (table->RowFlags & ImGuiTableRowFlags_Headers)
|
if (table->RowFlags & ImGuiTableRowFlags_Headers)
|
||||||
@@ -2013,7 +2069,8 @@ void ImGui::TableEndCell(ImGuiTable* table)
|
|||||||
else
|
else
|
||||||
p_max_pos_x = table->IsUnfrozenRows ? &column->ContentMaxXUnfrozen : &column->ContentMaxXFrozen;
|
p_max_pos_x = table->IsUnfrozenRows ? &column->ContentMaxXUnfrozen : &column->ContentMaxXFrozen;
|
||||||
*p_max_pos_x = ImMax(*p_max_pos_x, window->DC.CursorMaxPos.x);
|
*p_max_pos_x = ImMax(*p_max_pos_x, window->DC.CursorMaxPos.x);
|
||||||
table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->CellPaddingY);
|
if (column->IsEnabled)
|
||||||
|
table->RowPosY2 = ImMax(table->RowPosY2, window->DC.CursorMaxPos.y + table->CellPaddingY);
|
||||||
column->ItemWidth = window->DC.ItemWidth;
|
column->ItemWidth = window->DC.ItemWidth;
|
||||||
|
|
||||||
// Propagate text baseline for the entire row
|
// Propagate text baseline for the entire row
|
||||||
@@ -2108,7 +2165,7 @@ void ImGui::TableSetColumnWidth(int column_n, float width)
|
|||||||
// - All stretch: easy.
|
// - All stretch: easy.
|
||||||
// - One or more fixed + one stretch: easy.
|
// - One or more fixed + one stretch: easy.
|
||||||
// - One or more fixed + more than one stretch: tricky.
|
// - One or more fixed + more than one stretch: tricky.
|
||||||
// Qt when manual resize is enabled only support a single _trailing_ stretch column.
|
// Qt when manual resize is enabled only supports a single _trailing_ stretch column, we support more cases here.
|
||||||
|
|
||||||
// When forwarding resize from Wn| to Fn+1| we need to be considerate of the _NoResize flag on Fn+1.
|
// When forwarding resize from Wn| to Fn+1| we need to be considerate of the _NoResize flag on Fn+1.
|
||||||
// FIXME-TABLE: Find a way to rewrite all of this so interactions feel more consistent for the user.
|
// FIXME-TABLE: Find a way to rewrite all of this so interactions feel more consistent for the user.
|
||||||
@@ -2191,7 +2248,7 @@ void ImGui::TableUpdateColumnsWeightFromWidth(ImGuiTable* table)
|
|||||||
{
|
{
|
||||||
IM_ASSERT(table->LeftMostStretchedColumn != -1 && table->RightMostStretchedColumn != -1);
|
IM_ASSERT(table->LeftMostStretchedColumn != -1 && table->RightMostStretchedColumn != -1);
|
||||||
|
|
||||||
// Measure existing quantity
|
// Measure existing quantities
|
||||||
float visible_weight = 0.0f;
|
float visible_weight = 0.0f;
|
||||||
float visible_width = 0.0f;
|
float visible_width = 0.0f;
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
@@ -2273,7 +2330,7 @@ void ImGui::TableSetupDrawChannels(ImGuiTable* table)
|
|||||||
const int freeze_row_multiplier = (table->FreezeRowsCount > 0) ? 2 : 1;
|
const int freeze_row_multiplier = (table->FreezeRowsCount > 0) ? 2 : 1;
|
||||||
const int channels_for_row = (table->Flags & ImGuiTableFlags_NoClip) ? 1 : table->ColumnsEnabledCount;
|
const int channels_for_row = (table->Flags & ImGuiTableFlags_NoClip) ? 1 : table->ColumnsEnabledCount;
|
||||||
const int channels_for_bg = 1 + 1 * freeze_row_multiplier;
|
const int channels_for_bg = 1 + 1 * freeze_row_multiplier;
|
||||||
const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || table->VisibleMaskByIndex != table->EnabledMaskByIndex) ? +1 : 0;
|
const int channels_for_dummy = (table->ColumnsEnabledCount < table->ColumnsCount || (memcmp(table->VisibleMaskByIndex, table->EnabledMaskByIndex, ImBitArrayGetStorageSizeInBytes(table->ColumnsCount)) != 0)) ? +1 : 0;
|
||||||
const int channels_total = channels_for_bg + (channels_for_row * freeze_row_multiplier) + channels_for_dummy;
|
const int channels_total = channels_for_bg + (channels_for_row * freeze_row_multiplier) + channels_for_dummy;
|
||||||
table->DrawSplitter->Split(table->InnerWindow->DrawList, channels_total);
|
table->DrawSplitter->Split(table->InnerWindow->DrawList, channels_total);
|
||||||
table->DummyDrawChannel = (ImGuiTableDrawChannelIdx)((channels_for_dummy > 0) ? channels_total - 1 : -1);
|
table->DummyDrawChannel = (ImGuiTableDrawChannelIdx)((channels_for_dummy > 0) ? channels_total - 1 : -1);
|
||||||
@@ -2347,19 +2404,26 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
|||||||
// Track which groups we are going to attempt to merge, and which channels goes into each group.
|
// Track which groups we are going to attempt to merge, and which channels goes into each group.
|
||||||
struct MergeGroup
|
struct MergeGroup
|
||||||
{
|
{
|
||||||
ImRect ClipRect;
|
ImRect ClipRect;
|
||||||
int ChannelsCount;
|
int ChannelsCount = 0;
|
||||||
ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> ChannelsMask;
|
ImBitArrayPtr ChannelsMask = NULL;
|
||||||
|
|
||||||
MergeGroup() { ChannelsCount = 0; }
|
|
||||||
};
|
};
|
||||||
int merge_group_mask = 0x00;
|
int merge_group_mask = 0x00;
|
||||||
MergeGroup merge_groups[4];
|
MergeGroup merge_groups[4];
|
||||||
|
|
||||||
|
// Use a reusable temp buffer for the merge masks as they are dynamically sized.
|
||||||
|
const int max_draw_channels = (4 + table->ColumnsCount * 2);
|
||||||
|
const int size_for_masks_bitarrays_one = (int)ImBitArrayGetStorageSizeInBytes(max_draw_channels);
|
||||||
|
g.TempBuffer.reserve(size_for_masks_bitarrays_one * 5);
|
||||||
|
memset(g.TempBuffer.Data, 0, size_for_masks_bitarrays_one * 5);
|
||||||
|
for (int n = 0; n < IM_ARRAYSIZE(merge_groups); n++)
|
||||||
|
merge_groups[n].ChannelsMask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * n));
|
||||||
|
ImBitArrayPtr remaining_mask = (ImBitArrayPtr)(void*)(g.TempBuffer.Data + (size_for_masks_bitarrays_one * 4));
|
||||||
|
|
||||||
// 1. Scan channels and take note of those which can be merged
|
// 1. Scan channels and take note of those which can be merged
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
{
|
{
|
||||||
if ((table->VisibleMaskByIndex & ((ImU64)1 << column_n)) == 0)
|
if (!IM_BITARRAY_TESTBIT(table->VisibleMaskByIndex, column_n))
|
||||||
continue;
|
continue;
|
||||||
ImGuiTableColumn* column = &table->Columns[column_n];
|
ImGuiTableColumn* column = &table->Columns[column_n];
|
||||||
|
|
||||||
@@ -2391,11 +2455,11 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int merge_group_n = (has_freeze_h && column_n < table->FreezeColumnsCount ? 0 : 1) + (has_freeze_v && merge_group_sub_n == 0 ? 0 : 2);
|
const int merge_group_n = (has_freeze_h && column_n < table->FreezeColumnsCount ? 0 : 1) + (has_freeze_v && merge_group_sub_n == 0 ? 0 : 2);
|
||||||
IM_ASSERT(channel_no < IMGUI_TABLE_MAX_DRAW_CHANNELS);
|
IM_ASSERT(channel_no < max_draw_channels);
|
||||||
MergeGroup* merge_group = &merge_groups[merge_group_n];
|
MergeGroup* merge_group = &merge_groups[merge_group_n];
|
||||||
if (merge_group->ChannelsCount == 0)
|
if (merge_group->ChannelsCount == 0)
|
||||||
merge_group->ClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
|
merge_group->ClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
|
||||||
merge_group->ChannelsMask.SetBit(channel_no);
|
ImBitArraySetBit(merge_group->ChannelsMask, channel_no);
|
||||||
merge_group->ChannelsCount++;
|
merge_group->ChannelsCount++;
|
||||||
merge_group->ClipRect.Add(src_channel->_CmdBuffer[0].ClipRect);
|
merge_group->ClipRect.Add(src_channel->_CmdBuffer[0].ClipRect);
|
||||||
merge_group_mask |= (1 << merge_group_n);
|
merge_group_mask |= (1 << merge_group_n);
|
||||||
@@ -2431,9 +2495,8 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
|||||||
const int LEADING_DRAW_CHANNELS = 2;
|
const int LEADING_DRAW_CHANNELS = 2;
|
||||||
g.DrawChannelsTempMergeBuffer.resize(splitter->_Count - LEADING_DRAW_CHANNELS); // Use shared temporary storage so the allocation gets amortized
|
g.DrawChannelsTempMergeBuffer.resize(splitter->_Count - LEADING_DRAW_CHANNELS); // Use shared temporary storage so the allocation gets amortized
|
||||||
ImDrawChannel* dst_tmp = g.DrawChannelsTempMergeBuffer.Data;
|
ImDrawChannel* dst_tmp = g.DrawChannelsTempMergeBuffer.Data;
|
||||||
ImBitArray<IMGUI_TABLE_MAX_DRAW_CHANNELS> remaining_mask; // We need 132-bit of storage
|
ImBitArraySetBitRange(remaining_mask, LEADING_DRAW_CHANNELS, splitter->_Count);
|
||||||
remaining_mask.SetBitRange(LEADING_DRAW_CHANNELS, splitter->_Count);
|
ImBitArrayClearBit(remaining_mask, table->Bg2DrawChannelUnfrozen);
|
||||||
remaining_mask.ClearBit(table->Bg2DrawChannelUnfrozen);
|
|
||||||
IM_ASSERT(has_freeze_v == false || table->Bg2DrawChannelUnfrozen != TABLE_DRAW_CHANNEL_BG2_FROZEN);
|
IM_ASSERT(has_freeze_v == false || table->Bg2DrawChannelUnfrozen != TABLE_DRAW_CHANNEL_BG2_FROZEN);
|
||||||
int remaining_count = splitter->_Count - (has_freeze_v ? LEADING_DRAW_CHANNELS + 1 : LEADING_DRAW_CHANNELS);
|
int remaining_count = splitter->_Count - (has_freeze_v ? LEADING_DRAW_CHANNELS + 1 : LEADING_DRAW_CHANNELS);
|
||||||
//ImRect host_rect = (table->InnerWindow == table->OuterWindow) ? table->InnerClipRect : table->HostClipRect;
|
//ImRect host_rect = (table->InnerWindow == table->OuterWindow) ? table->InnerClipRect : table->HostClipRect;
|
||||||
@@ -2460,20 +2523,18 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
|||||||
merge_clip_rect.Max.x = ImMax(merge_clip_rect.Max.x, host_rect.Max.x);
|
merge_clip_rect.Max.x = ImMax(merge_clip_rect.Max.x, host_rect.Max.x);
|
||||||
if ((merge_group_n & 2) != 0 && (table->Flags & ImGuiTableFlags_NoHostExtendY) == 0)
|
if ((merge_group_n & 2) != 0 && (table->Flags & ImGuiTableFlags_NoHostExtendY) == 0)
|
||||||
merge_clip_rect.Max.y = ImMax(merge_clip_rect.Max.y, host_rect.Max.y);
|
merge_clip_rect.Max.y = ImMax(merge_clip_rect.Max.y, host_rect.Max.y);
|
||||||
#if 0
|
//GetForegroundDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 0, 0, 200), 0.0f, 0, 1.0f); // [DEBUG]
|
||||||
GetOverlayDrawList()->AddRect(merge_group->ClipRect.Min, merge_group->ClipRect.Max, IM_COL32(255, 0, 0, 200), 0.0f, 0, 1.0f);
|
//GetForegroundDrawList()->AddLine(merge_group->ClipRect.Min, merge_clip_rect.Min, IM_COL32(255, 100, 0, 200));
|
||||||
GetOverlayDrawList()->AddLine(merge_group->ClipRect.Min, merge_clip_rect.Min, IM_COL32(255, 100, 0, 200));
|
//GetForegroundDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200));
|
||||||
GetOverlayDrawList()->AddLine(merge_group->ClipRect.Max, merge_clip_rect.Max, IM_COL32(255, 100, 0, 200));
|
|
||||||
#endif
|
|
||||||
remaining_count -= merge_group->ChannelsCount;
|
remaining_count -= merge_group->ChannelsCount;
|
||||||
for (int n = 0; n < IM_ARRAYSIZE(remaining_mask.Storage); n++)
|
for (int n = 0; n < (size_for_masks_bitarrays_one >> 2); n++)
|
||||||
remaining_mask.Storage[n] &= ~merge_group->ChannelsMask.Storage[n];
|
remaining_mask[n] &= ~merge_group->ChannelsMask[n];
|
||||||
for (int n = 0; n < splitter->_Count && merge_channels_count != 0; n++)
|
for (int n = 0; n < splitter->_Count && merge_channels_count != 0; n++)
|
||||||
{
|
{
|
||||||
// Copy + overwrite new clip rect
|
// Copy + overwrite new clip rect
|
||||||
if (!merge_group->ChannelsMask.TestBit(n))
|
if (!IM_BITARRAY_TESTBIT(merge_group->ChannelsMask, n))
|
||||||
continue;
|
continue;
|
||||||
merge_group->ChannelsMask.ClearBit(n);
|
IM_BITARRAY_CLEARBIT(merge_group->ChannelsMask, n);
|
||||||
merge_channels_count--;
|
merge_channels_count--;
|
||||||
|
|
||||||
ImDrawChannel* channel = &splitter->_Channels[n];
|
ImDrawChannel* channel = &splitter->_Channels[n];
|
||||||
@@ -2491,7 +2552,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
|
|||||||
// Append unmergeable channels that we didn't reorder at the end of the list
|
// Append unmergeable channels that we didn't reorder at the end of the list
|
||||||
for (int n = 0; n < splitter->_Count && remaining_count != 0; n++)
|
for (int n = 0; n < splitter->_Count && remaining_count != 0; n++)
|
||||||
{
|
{
|
||||||
if (!remaining_mask.TestBit(n))
|
if (!IM_BITARRAY_TESTBIT(remaining_mask, n))
|
||||||
continue;
|
continue;
|
||||||
ImDrawChannel* channel = &splitter->_Channels[n];
|
ImDrawChannel* channel = &splitter->_Channels[n];
|
||||||
memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
|
memcpy(dst_tmp++, channel, sizeof(ImDrawChannel));
|
||||||
@@ -2523,7 +2584,7 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
|
|||||||
{
|
{
|
||||||
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
|
||||||
{
|
{
|
||||||
if (!(table->EnabledMaskByDisplayOrder & ((ImU64)1 << order_n)))
|
if (!IM_BITARRAY_TESTBIT(table->EnabledMaskByDisplayOrder, order_n))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const int column_n = table->DisplayOrderToIndex[order_n];
|
const int column_n = table->DisplayOrderToIndex[order_n];
|
||||||
@@ -2628,7 +2689,6 @@ ImGuiTableSortSpecs* ImGui::TableGetSortSpecs()
|
|||||||
TableUpdateLayout(table);
|
TableUpdateLayout(table);
|
||||||
|
|
||||||
TableSortSpecsBuild(table);
|
TableSortSpecsBuild(table);
|
||||||
|
|
||||||
return &table->SortSpecs;
|
return &table->SortSpecs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2747,7 +2807,7 @@ void ImGui::TableSortSpecsSanitize(ImGuiTable* table)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback default sort order (if no column had the ImGuiTableColumnFlags_DefaultSort flag)
|
// Fallback default sort order (if no column with the ImGuiTableColumnFlags_DefaultSort flag)
|
||||||
if (sort_order_count == 0 && !(table->Flags & ImGuiTableFlags_SortTristate))
|
if (sort_order_count == 0 && !(table->Flags & ImGuiTableFlags_SortTristate))
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
{
|
{
|
||||||
@@ -2851,10 +2911,9 @@ void ImGui::TableHeadersRow()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them)
|
// Push an id to allow unnamed labels (generally accidental, but let's behave nicely with them)
|
||||||
// - in your own code you may omit the PushID/PopID all-together, provided you know they won't collide
|
// In your own code you may omit the PushID/PopID all-together, provided you know they won't collide.
|
||||||
// - table->InstanceCurrent is only >0 when we use multiple BeginTable/EndTable calls with same identifier.
|
|
||||||
const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n);
|
const char* name = (TableGetColumnFlags(column_n) & ImGuiTableColumnFlags_NoHeaderLabel) ? "" : TableGetColumnName(column_n);
|
||||||
PushID(table->InstanceCurrent * table->ColumnsCount + column_n);
|
PushID(column_n);
|
||||||
TableHeader(name);
|
TableHeader(name);
|
||||||
PopID();
|
PopID();
|
||||||
}
|
}
|
||||||
@@ -2925,11 +2984,9 @@ void ImGui::TableHeader(const char* label)
|
|||||||
//GetForegroundDrawList()->AddRect(cell_r.Min, cell_r.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]
|
//GetForegroundDrawList()->AddRect(cell_r.Min, cell_r.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]
|
||||||
//GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]
|
//GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 0, 0, 255)); // [DEBUG]
|
||||||
|
|
||||||
// Using AllowItemOverlap mode because we cover the whole cell, and we want user to be able to submit subsequent items.
|
// Using AllowOverlap mode because we cover the whole cell, and we want user to be able to submit subsequent items.
|
||||||
bool hovered, held;
|
bool hovered, held;
|
||||||
bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_AllowItemOverlap);
|
bool pressed = ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_AllowOverlap);
|
||||||
if (g.ActiveId != id)
|
|
||||||
SetItemAllowOverlap();
|
|
||||||
if (held || hovered || selected)
|
if (held || hovered || selected)
|
||||||
{
|
{
|
||||||
const ImU32 col = GetColorU32(held ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
|
const ImU32 col = GetColorU32(held ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
|
||||||
@@ -2969,7 +3026,7 @@ void ImGui::TableHeader(const char* label)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Sort order arrow
|
// Sort order arrow
|
||||||
const float ellipsis_max = cell_r.Max.x - w_arrow - w_sort_text;
|
const float ellipsis_max = ImMax(cell_r.Max.x - w_arrow - w_sort_text, label_pos.x);
|
||||||
if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort))
|
if ((table->Flags & ImGuiTableFlags_Sortable) && !(column->Flags & ImGuiTableColumnFlags_NoSort))
|
||||||
{
|
{
|
||||||
if (column->SortOrder != -1)
|
if (column->SortOrder != -1)
|
||||||
@@ -3000,8 +3057,8 @@ void ImGui::TableHeader(const char* label)
|
|||||||
RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, label_pos.y + label_height + g.Style.FramePadding.y), ellipsis_max, ellipsis_max, label, label_end, &label_size);
|
RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, label_pos.y + label_height + g.Style.FramePadding.y), ellipsis_max, ellipsis_max, label, label_end, &label_size);
|
||||||
|
|
||||||
const bool text_clipped = label_size.x > (ellipsis_max - label_pos.x);
|
const bool text_clipped = label_size.x > (ellipsis_max - label_pos.x);
|
||||||
if (text_clipped && hovered && g.HoveredIdNotActiveTimer > g.TooltipSlowDelay)
|
if (text_clipped && hovered && g.ActiveId == 0)
|
||||||
SetTooltip("%.*s", (int)(label_end - label), label);
|
SetItemTooltip("%.*s", (int)(label_end - label), label);
|
||||||
|
|
||||||
// We don't use BeginPopupContextItem() because we want the popup to stay up even after the column is hidden
|
// We don't use BeginPopupContextItem() because we want the popup to stay up even after the column is hidden
|
||||||
if (IsMouseReleased(1) && IsItemHovered())
|
if (IsMouseReleased(1) && IsItemHovered())
|
||||||
@@ -3035,6 +3092,17 @@ void ImGui::TableOpenContextMenu(int column_n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table)
|
||||||
|
{
|
||||||
|
if (!table->IsContextPopupOpen || table->InstanceCurrent != table->InstanceInteracted)
|
||||||
|
return false;
|
||||||
|
const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
|
||||||
|
if (BeginPopupEx(context_menu_id, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings))
|
||||||
|
return true;
|
||||||
|
table->IsContextPopupOpen = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Output context menu into current window (generally a popup)
|
// Output context menu into current window (generally a popup)
|
||||||
// FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data?
|
// FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data?
|
||||||
void ImGui::TableDrawContextMenu(ImGuiTable* table)
|
void ImGui::TableDrawContextMenu(ImGuiTable* table)
|
||||||
@@ -3054,15 +3122,15 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
|
|||||||
if (column != NULL)
|
if (column != NULL)
|
||||||
{
|
{
|
||||||
const bool can_resize = !(column->Flags & ImGuiTableColumnFlags_NoResize) && column->IsEnabled;
|
const bool can_resize = !(column->Flags & ImGuiTableColumnFlags_NoResize) && column->IsEnabled;
|
||||||
if (MenuItem("Size column to fit###SizeOne", NULL, false, can_resize))
|
if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableSizeOne), NULL, false, can_resize)) // "###SizeOne"
|
||||||
TableSetColumnWidthAutoSingle(table, column_n);
|
TableSetColumnWidthAutoSingle(table, column_n);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* size_all_desc;
|
const char* size_all_desc;
|
||||||
if (table->ColumnsEnabledFixedCount == table->ColumnsEnabledCount && (table->Flags & ImGuiTableFlags_SizingMask_) != ImGuiTableFlags_SizingFixedSame)
|
if (table->ColumnsEnabledFixedCount == table->ColumnsEnabledCount && (table->Flags & ImGuiTableFlags_SizingMask_) != ImGuiTableFlags_SizingFixedSame)
|
||||||
size_all_desc = "Size all columns to fit###SizeAll"; // All fixed
|
size_all_desc = LocalizeGetMsg(ImGuiLocKey_TableSizeAllFit); // "###SizeAll" All fixed
|
||||||
else
|
else
|
||||||
size_all_desc = "Size all columns to default###SizeAll"; // All stretch or mixed
|
size_all_desc = LocalizeGetMsg(ImGuiLocKey_TableSizeAllDefault); // "###SizeAll" All stretch or mixed
|
||||||
if (MenuItem(size_all_desc, NULL))
|
if (MenuItem(size_all_desc, NULL))
|
||||||
TableSetColumnWidthAutoAll(table);
|
TableSetColumnWidthAutoAll(table);
|
||||||
want_separator = true;
|
want_separator = true;
|
||||||
@@ -3071,7 +3139,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
|
|||||||
// Ordering
|
// Ordering
|
||||||
if (table->Flags & ImGuiTableFlags_Reorderable)
|
if (table->Flags & ImGuiTableFlags_Reorderable)
|
||||||
{
|
{
|
||||||
if (MenuItem("Reset order", NULL, false, !table->IsDefaultDisplayOrder))
|
if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableResetOrder), NULL, false, !table->IsDefaultDisplayOrder))
|
||||||
table->IsResetDisplayOrderRequest = true;
|
table->IsResetDisplayOrderRequest = true;
|
||||||
want_separator = true;
|
want_separator = true;
|
||||||
}
|
}
|
||||||
@@ -3428,12 +3496,12 @@ static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandle
|
|||||||
if (!save_column)
|
if (!save_column)
|
||||||
continue;
|
continue;
|
||||||
buf->appendf("Column %-2d", column_n);
|
buf->appendf("Column %-2d", column_n);
|
||||||
if (column->UserID != 0) buf->appendf(" UserID=%08X", column->UserID);
|
if (column->UserID != 0) { buf->appendf(" UserID=%08X", column->UserID); }
|
||||||
if (save_size && column->IsStretch) buf->appendf(" Weight=%.4f", column->WidthOrWeight);
|
if (save_size && column->IsStretch) { buf->appendf(" Weight=%.4f", column->WidthOrWeight); }
|
||||||
if (save_size && !column->IsStretch) buf->appendf(" Width=%d", (int)column->WidthOrWeight);
|
if (save_size && !column->IsStretch) { buf->appendf(" Width=%d", (int)column->WidthOrWeight); }
|
||||||
if (save_visible) buf->appendf(" Visible=%d", column->IsEnabled);
|
if (save_visible) { buf->appendf(" Visible=%d", column->IsEnabled); }
|
||||||
if (save_order) buf->appendf(" Order=%d", column->DisplayOrder);
|
if (save_order) { buf->appendf(" Order=%d", column->DisplayOrder); }
|
||||||
if (save_sort && column->SortOrder != -1) buf->appendf(" Sort=%d%c", column->SortOrder, (column->SortDirection == ImGuiSortDirection_Ascending) ? 'v' : '^');
|
if (save_sort && column->SortOrder != -1) { buf->appendf(" Sort=%d%c", column->SortOrder, (column->SortDirection == ImGuiSortDirection_Ascending) ? 'v' : '^'); }
|
||||||
buf->append("\n");
|
buf->append("\n");
|
||||||
}
|
}
|
||||||
buf->append("\n");
|
buf->append("\n");
|
||||||
@@ -3481,7 +3549,7 @@ void ImGui::TableGcCompactTransientBuffers(ImGuiTable* table)
|
|||||||
IM_ASSERT(table->MemoryCompacted == false);
|
IM_ASSERT(table->MemoryCompacted == false);
|
||||||
table->SortSpecs.Specs = NULL;
|
table->SortSpecs.Specs = NULL;
|
||||||
table->SortSpecsMulti.clear();
|
table->SortSpecsMulti.clear();
|
||||||
table->IsSortSpecsDirty = true; // FIXME: shouldn't have to leak into user performing a sort
|
table->IsSortSpecsDirty = true; // FIXME: In theory shouldn't have to leak into user performing a sort on resume.
|
||||||
table->ColumnsNames.clear();
|
table->ColumnsNames.clear();
|
||||||
table->MemoryCompacted = true;
|
table->MemoryCompacted = true;
|
||||||
for (int n = 0; n < table->ColumnsCount; n++)
|
for (int n = 0; n < table->ColumnsCount; n++)
|
||||||
@@ -3534,13 +3602,9 @@ static const char* DebugNodeTableGetSizingPolicyDesc(ImGuiTableFlags sizing_poli
|
|||||||
|
|
||||||
void ImGui::DebugNodeTable(ImGuiTable* table)
|
void ImGui::DebugNodeTable(ImGuiTable* table)
|
||||||
{
|
{
|
||||||
char buf[512];
|
const bool is_active = (table->LastFrameActive >= GetFrameCount() - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
|
||||||
char* p = buf;
|
|
||||||
const char* buf_end = buf + IM_ARRAYSIZE(buf);
|
|
||||||
const bool is_active = (table->LastFrameActive >= ImGui::GetFrameCount() - 2); // Note that fully clipped early out scrolling tables will appear as inactive here.
|
|
||||||
ImFormatString(p, buf_end - p, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
|
|
||||||
if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
|
if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); }
|
||||||
bool open = TreeNode(table, "%s", buf);
|
bool open = TreeNode(table, "Table 0x%08X (%d columns, in '%s')%s", table->ID, table->ColumnsCount, table->OuterWindow->Name, is_active ? "" : " *Inactive*");
|
||||||
if (!is_active) { PopStyleColor(); }
|
if (!is_active) { PopStyleColor(); }
|
||||||
if (IsItemHovered())
|
if (IsItemHovered())
|
||||||
GetForegroundDrawList()->AddRect(table->OuterRect.Min, table->OuterRect.Max, IM_COL32(255, 255, 0, 255));
|
GetForegroundDrawList()->AddRect(table->OuterRect.Min, table->OuterRect.Max, IM_COL32(255, 255, 0, 255));
|
||||||
@@ -3549,13 +3613,18 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
|
|||||||
if (!open)
|
if (!open)
|
||||||
return;
|
return;
|
||||||
if (table->InstanceCurrent > 0)
|
if (table->InstanceCurrent > 0)
|
||||||
ImGui::Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
|
Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
|
||||||
bool clear_settings = SmallButton("Clear settings");
|
bool clear_settings = SmallButton("Clear settings");
|
||||||
BulletText("OuterRect: Pos: (%.1f,%.1f) Size: (%.1f,%.1f) Sizing: '%s'", table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.GetWidth(), table->OuterRect.GetHeight(), DebugNodeTableGetSizingPolicyDesc(table->Flags));
|
BulletText("OuterRect: Pos: (%.1f,%.1f) Size: (%.1f,%.1f) Sizing: '%s'", table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.GetWidth(), table->OuterRect.GetHeight(), DebugNodeTableGetSizingPolicyDesc(table->Flags));
|
||||||
BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : "");
|
BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : "");
|
||||||
BulletText("CellPaddingX: %.1f, CellSpacingX: %.1f/%.1f, OuterPaddingX: %.1f", table->CellPaddingX, table->CellSpacingX1, table->CellSpacingX2, table->OuterPaddingX);
|
BulletText("CellPaddingX: %.1f, CellSpacingX: %.1f/%.1f, OuterPaddingX: %.1f", table->CellPaddingX, table->CellSpacingX1, table->CellSpacingX2, table->OuterPaddingX);
|
||||||
BulletText("HoveredColumnBody: %d, HoveredColumnBorder: %d", table->HoveredColumnBody, table->HoveredColumnBorder);
|
BulletText("HoveredColumnBody: %d, HoveredColumnBorder: %d", table->HoveredColumnBody, table->HoveredColumnBorder);
|
||||||
BulletText("ResizedColumn: %d, ReorderColumn: %d, HeldHeaderColumn: %d", table->ResizedColumn, table->ReorderColumn, table->HeldHeaderColumn);
|
BulletText("ResizedColumn: %d, ReorderColumn: %d, HeldHeaderColumn: %d", table->ResizedColumn, table->ReorderColumn, table->HeldHeaderColumn);
|
||||||
|
for (int n = 0; n < table->InstanceCurrent + 1; n++)
|
||||||
|
{
|
||||||
|
ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, n);
|
||||||
|
BulletText("Instance %d: HoveredRow: %d, LastOuterHeight: %.2f", n, table_instance->HoveredRowLast, table_instance->LastOuterHeight);
|
||||||
|
}
|
||||||
//BulletText("BgDrawChannels: %d/%d", 0, table->BgDrawChannelUnfrozen);
|
//BulletText("BgDrawChannels: %d/%d", 0, table->BgDrawChannelUnfrozen);
|
||||||
float sum_weights = 0.0f;
|
float sum_weights = 0.0f;
|
||||||
for (int n = 0; n < table->ColumnsCount; n++)
|
for (int n = 0; n < table->ColumnsCount; n++)
|
||||||
@@ -3565,6 +3634,7 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
|
|||||||
{
|
{
|
||||||
ImGuiTableColumn* column = &table->Columns[n];
|
ImGuiTableColumn* column = &table->Columns[n];
|
||||||
const char* name = TableGetColumnName(table, n);
|
const char* name = TableGetColumnName(table, n);
|
||||||
|
char buf[512];
|
||||||
ImFormatString(buf, IM_ARRAYSIZE(buf),
|
ImFormatString(buf, IM_ARRAYSIZE(buf),
|
||||||
"Column %d order %d '%s': offset %+.2f to %+.2f%s\n"
|
"Column %d order %d '%s': offset %+.2f to %+.2f%s\n"
|
||||||
"Enabled: %d, VisibleX/Y: %d/%d, RequestOutput: %d, SkipItems: %d, DrawChannels: %d,%d\n"
|
"Enabled: %d, VisibleX/Y: %d/%d, RequestOutput: %d, SkipItems: %d, DrawChannels: %d,%d\n"
|
||||||
@@ -3853,6 +3923,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
|
|||||||
columns->Count = columns_count;
|
columns->Count = columns_count;
|
||||||
columns->Flags = flags;
|
columns->Flags = flags;
|
||||||
window->DC.CurrentColumns = columns;
|
window->DC.CurrentColumns = columns;
|
||||||
|
window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX();
|
||||||
|
|
||||||
columns->HostCursorPosY = window->DC.CursorPos.y;
|
columns->HostCursorPosY = window->DC.CursorPos.y;
|
||||||
columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x;
|
columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x;
|
||||||
@@ -3912,6 +3983,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiOldColumnFl
|
|||||||
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
|
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
|
||||||
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
||||||
window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
|
window->WorkRect.Max.x = window->Pos.x + offset_1 - column_padding;
|
||||||
|
window->WorkRect.Max.y = window->ContentRegionRect.Max.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui::NextColumn()
|
void ImGui::NextColumn()
|
||||||
@@ -3954,6 +4026,7 @@ void ImGui::NextColumn()
|
|||||||
{
|
{
|
||||||
// New row/line: column 0 honor IndentX.
|
// New row/line: column 0 honor IndentX.
|
||||||
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
|
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
|
||||||
|
window->DC.IsSameLine = false;
|
||||||
columns->LineMinY = columns->LineMaxY;
|
columns->LineMinY = columns->LineMaxY;
|
||||||
}
|
}
|
||||||
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
||||||
@@ -4005,8 +4078,7 @@ void ImGui::EndColumns()
|
|||||||
const ImGuiID column_id = columns->ID + ImGuiID(n);
|
const ImGuiID column_id = columns->ID + ImGuiID(n);
|
||||||
const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
|
const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
|
||||||
const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
|
const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
|
||||||
KeepAliveID(column_id);
|
if (!ItemAdd(column_hit_rect, column_id, NULL, ImGuiItemFlags_NoNav))
|
||||||
if (IsClippedEx(column_hit_rect, column_id)) // FIXME: Can be removed or replaced with a lower-level test
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool hovered = false, held = false;
|
bool hovered = false, held = false;
|
||||||
@@ -4043,6 +4115,7 @@ void ImGui::EndColumns()
|
|||||||
window->DC.CurrentColumns = NULL;
|
window->DC.CurrentColumns = NULL;
|
||||||
window->DC.ColumnsOffset.x = 0.0f;
|
window->DC.ColumnsOffset.x = 0.0f;
|
||||||
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
||||||
|
NavUpdateCurrentWindowIsScrollPushableX();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImGui::Columns(int columns_count, const char* id, bool border)
|
void ImGui::Columns(int columns_count, const char* id, bool border)
|
||||||
|
|||||||
+764
-521
File diff suppressed because it is too large
Load Diff
+13
-23
@@ -2,6 +2,7 @@
|
|||||||
// This is a slightly modified version of stb_textedit.h 1.14.
|
// This is a slightly modified version of stb_textedit.h 1.14.
|
||||||
// Those changes would need to be pushed into nothings/stb:
|
// Those changes would need to be pushed into nothings/stb:
|
||||||
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
|
// - Fix in stb_textedit_discard_redo (see https://github.com/nothings/stb/issues/321)
|
||||||
|
// - Fix in stb_textedit_find_charpos to handle last line (see https://github.com/ocornut/imgui/issues/6000)
|
||||||
// Grep for [DEAR IMGUI] to find the changes.
|
// Grep for [DEAR IMGUI] to find the changes.
|
||||||
|
|
||||||
// stb_textedit.h - v1.14 - public domain - Sean Barrett
|
// stb_textedit.h - v1.14 - public domain - Sean Barrett
|
||||||
@@ -524,29 +525,14 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s
|
|||||||
int z = STB_TEXTEDIT_STRINGLEN(str);
|
int z = STB_TEXTEDIT_STRINGLEN(str);
|
||||||
int i=0, first;
|
int i=0, first;
|
||||||
|
|
||||||
if (n == z) {
|
if (n == z && single_line) {
|
||||||
// if it's at the end, then find the last line -- simpler than trying to
|
// special case if it's at the end (may not be needed?)
|
||||||
// explicitly handle this case in the regular code
|
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
|
||||||
if (single_line) {
|
find->y = 0;
|
||||||
STB_TEXTEDIT_LAYOUTROW(&r, str, 0);
|
find->first_char = 0;
|
||||||
find->y = 0;
|
find->length = z;
|
||||||
find->first_char = 0;
|
find->height = r.ymax - r.ymin;
|
||||||
find->length = z;
|
find->x = r.x1;
|
||||||
find->height = r.ymax - r.ymin;
|
|
||||||
find->x = r.x1;
|
|
||||||
} else {
|
|
||||||
find->y = 0;
|
|
||||||
find->x = 0;
|
|
||||||
find->height = 1;
|
|
||||||
while (i < z) {
|
|
||||||
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
|
|
||||||
prev_start = i;
|
|
||||||
i += r.num_chars;
|
|
||||||
}
|
|
||||||
find->first_char = i;
|
|
||||||
find->length = 0;
|
|
||||||
find->prev_first = prev_start;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,9 +543,13 @@ static void stb_textedit_find_charpos(StbFindState *find, STB_TEXTEDIT_STRING *s
|
|||||||
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
|
STB_TEXTEDIT_LAYOUTROW(&r, str, i);
|
||||||
if (n < i + r.num_chars)
|
if (n < i + r.num_chars)
|
||||||
break;
|
break;
|
||||||
|
if (i + r.num_chars == z && z > 0 && STB_TEXTEDIT_GETCHAR(str, z - 1) != STB_TEXTEDIT_NEWLINE) // [DEAR IMGUI] special handling for last line
|
||||||
|
break; // [DEAR IMGUI]
|
||||||
prev_start = i;
|
prev_start = i;
|
||||||
i += r.num_chars;
|
i += r.num_chars;
|
||||||
find->y += r.baseline_y_delta;
|
find->y += r.baseline_y_delta;
|
||||||
|
if (i == z) // [DEAR IMGUI]
|
||||||
|
break; // [DEAR IMGUI]
|
||||||
}
|
}
|
||||||
|
|
||||||
find->first_char = first = i;
|
find->first_char = first = i;
|
||||||
|
|||||||
+1
-1
@@ -2008,7 +2008,7 @@ static stbtt__buf stbtt__cid_get_glyph_subrs(const stbtt_fontinfo *info, int gly
|
|||||||
start = end;
|
start = end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fdselector == -1) stbtt__new_buf(NULL, 0);
|
if (fdselector == -1) return stbtt__new_buf(NULL, 0); // [DEAR IMGUI] fixed, see #6007 and nothings/stb#1422
|
||||||
return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector));
|
return stbtt__get_subrs(info->cff, stbtt__cff_index_get(info->fontdicts, fdselector));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+167
-4
@@ -1,6 +1,169 @@
|
|||||||
|
|
||||||
This is a list of major changes in SDL's version history.
|
This is a list of major changes in SDL's version history.
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.28.2:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
General:
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_WGI to control whether to use Windows.Gaming.Input for controllers
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.28.0:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Added SDL_HasWindowSurface() and SDL_DestroyWindowSurface() to switch between the window surface and rendering APIs
|
||||||
|
* Added a display event SDL_DISPLAYEVENT_MOVED which is sent when the primary monitor changes or displays change position relative to each other
|
||||||
|
* Added the hint SDL_HINT_ENABLE_SCREEN_KEYBOARD to control whether the on-screen keyboard should be shown when text input is active
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.26.0:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Updated OpenGL headers to the latest API from The Khronos Group Inc.
|
||||||
|
* Added SDL_GetWindowSizeInPixels() to get the window size in pixels, which may differ from the window coordinate size for windows with high-DPI support
|
||||||
|
* Added simulated vsync synchronization for the software renderer
|
||||||
|
* Added the mouse position to SDL_MouseWheelEvent
|
||||||
|
* Added SDL_ResetHints() to reset all hints to their default values
|
||||||
|
* Added SDL_GetJoystickGUIDInfo() to get device information encoded in a joystick GUID
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 to control whether the HIDAPI driver for XBox 360 controllers should be used
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED to control whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS to control whether the HIDAPI driver for XBox 360 wireless controllers should be used
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE to control whether the HIDAPI driver for XBox One controllers should be used
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED to control the brightness of the XBox One guide button LED
|
||||||
|
* Added support for PS3 controllers to the HIDAPI driver, enabled by default on macOS, controlled by the SDL_HINT_JOYSTICK_HIDAPI_PS3 hint
|
||||||
|
* Added support for Nintendo Wii controllers to the HIDAPI driver, not enabled by default, controlled by the SDL_HINT_JOYSTICK_HIDAPI_WII hint
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS to control whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver
|
||||||
|
* Added access to the individual left and right gyro sensors of the combined Joy-Cons controller
|
||||||
|
* Added a microsecond timestamp to SDL_SensorEvent and SDL_ControllerSensorEvent, when the hardware provides that information
|
||||||
|
* Added SDL_SensorGetDataWithTimestamp() and SDL_GameControllerGetSensorDataWithTimestamp() to retrieve the last sensor data with the associated microsecond timestamp
|
||||||
|
* Added the hint SDL_HINT_HIDAPI_IGNORE_DEVICES to have the SDL HID API ignore specific devices
|
||||||
|
* SDL_GetRevision() now includes more information about the SDL build, including the git commit hash if available
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
* Added the hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether the system mouse acceleration curve is used for relative mouse motion
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
* Implemented vsync synchronization on macOS 12
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
* Added SDL_SetPrimarySelectionText(), SDL_GetPrimarySelectionText(), and SDL_HasPrimarySelectionText() to interact with the X11 primary selection clipboard
|
||||||
|
* Added the hint SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP to control whether mouse pointer warp emulation is enabled under Wayland
|
||||||
|
|
||||||
|
Android:
|
||||||
|
* Enabled IME soft keyboard input
|
||||||
|
* Added version checking to make sure the SDL Java and C code are compatible
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.24.0:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* New version numbering scheme, similar to GLib and Flatpak.
|
||||||
|
* An even number in the minor version (second component) indicates a production-ready stable release such as 2.24.0, which would have been 2.0.24 under the old system.
|
||||||
|
* The patchlevel (micro version, third component) indicates a bugfix-only update: for example, 2.24.1 would be a bugfix-only release to fix bugs in 2.24.0, without adding new features.
|
||||||
|
* An odd number in the minor version indicates a prerelease such as 2.23.0. Stable distributions should not use these prereleases.
|
||||||
|
* The patchlevel indicates successive prereleases, for example 2.23.1 and 2.23.2 would be prereleases during development of the SDL 2.24.0 stable release.
|
||||||
|
* Added SDL_GetPointDisplayIndex() and SDL_GetRectDisplayIndex() to get the display associated with a point and rectangle in screen space
|
||||||
|
* Added SDL_bsearch(), SDL_crc16(), and SDL_utf8strnlen() to the stdlib routines
|
||||||
|
* Added SDL_CPUPauseInstruction() as a macro in SDL_atomic.h
|
||||||
|
* Added SDL_size_mul_overflow() and SDL_size_add_overflow() for better size overflow protection
|
||||||
|
* Added SDL_ResetHint() to reset a hint to the default value
|
||||||
|
* Added SDL_ResetKeyboard() to reset SDL's internal keyboard state, generating key up events for all currently pressed keys
|
||||||
|
* Added the hint SDL_HINT_MOUSE_RELATIVE_WARP_MOTION to control whether mouse warping generates motion events in relative mode. This hint defaults off.
|
||||||
|
* Added the hint SDL_HINT_TRACKPAD_IS_TOUCH_ONLY to control whether trackpads are treated as touch devices or mice. By default touchpads are treated as mouse input.
|
||||||
|
* The hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS now defaults on
|
||||||
|
* Added support for mini-gamepad mode for Nintendo Joy-Con controllers using the HIDAPI driver
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS to control whether Joy-Con controllers are automatically merged into a unified gamepad when using the HIDAPI driver. This hint defaults on.
|
||||||
|
* The hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED can be set to a floating point value to set the brightness of the Home LED on Nintendo Switch controllers
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED to set the Home LED brightness for the Nintendo Joy-Con controllers. By default the Home LED is not modified.
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED to control whether the player LED should be lit on the Nintendo Joy-Con controllers
|
||||||
|
* Added support for Nintendo Online classic controllers using the HIDAPI driver
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC to control whether the HIDAPI driver for Nintendo Online classic controllers should be used
|
||||||
|
* Added support for the NVIDIA Shield Controller to the HIDAPI driver, supporting rumble and battery status
|
||||||
|
* Added support for NVIDIA SHIELD controller to the HIDAPI driver, and a hint SDL_HINT_JOYSTICK_HIDAPI_SHIELD to control whether this is used
|
||||||
|
* Added functions to get the platform dependent name for a joystick or game controller:
|
||||||
|
* SDL_JoystickPathForIndex()
|
||||||
|
* SDL_JoystickPath()
|
||||||
|
* SDL_GameControllerPathForIndex()
|
||||||
|
* SDL_GameControllerPath()
|
||||||
|
* Added SDL_GameControllerGetFirmwareVersion() and SDL_JoystickGetFirmwareVersion(), currently implemented for DualSense(tm) Wireless Controllers using HIDAPI
|
||||||
|
* Added SDL_JoystickAttachVirtualEx() for extended virtual controller support
|
||||||
|
* Added joystick event SDL_JOYBATTERYUPDATED for when battery status changes
|
||||||
|
* Added SDL_GUIDToString() and SDL_GUIDFromString() to convert between SDL GUID and string
|
||||||
|
* Added SDL_HasLSX() and SDL_HasLASX() to detect LoongArch SIMD support
|
||||||
|
* Added SDL_GetOriginalMemoryFunctions()
|
||||||
|
* Added SDL_GetDefaultAudioInfo() to get the name and format of the default audio device, currently implemented for PipeWire, PulseAudio, WASAPI, and DirectSound
|
||||||
|
* Added HIDAPI driver for the NVIDIA SHIELD controller (2017 model) to enable support for battery status and rumble
|
||||||
|
* Added support for opening audio devices with 3 or 5 channels (2.1, 4.1). All channel counts from Mono to 7.1 are now supported.
|
||||||
|
* Rewrote audio channel converters used by SDL_AudioCVT, based on the channel matrix coefficients used as the default for FAudio voices
|
||||||
|
* SDL log messages are no longer limited to 4K and can be any length
|
||||||
|
* Fixed a long-standing calling convention issue with dynapi affecting OpenWatcom or OS/2 builds
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
* Added initial support for building for Windows and Xbox with Microsoft's Game Development Kit (GDK), see docs/README-gdk.md for details
|
||||||
|
* Added a D3D12 renderer implementation and SDL_RenderGetD3D12Device() to retrieve the D3D12 device associated with it
|
||||||
|
* Added the hint SDL_HINT_WINDOWS_DPI_AWARENESS to set whether the application is DPI-aware. This hint must be set before initializing the video subsystem
|
||||||
|
* Added the hint SDL_HINT_WINDOWS_DPI_SCALING to control whether the SDL coordinates are in DPI-scaled points or pixels
|
||||||
|
* Added the hint SDL_HINT_DIRECTINPUT_ENABLED to control whether the DirectInput driver should be used
|
||||||
|
* Added support for SDL_GetAudioDeviceSpec to the DirectSound backend
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
* Support for XVidMode has been removed, mode changes are only supported using the XRandR extension
|
||||||
|
* Added the hint SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION to control whether to expose a set of emulated modes in addition to the native resolution modes available on Wayland
|
||||||
|
* Added the hint SDL_HINT_KMSDRM_DEVICE_INDEX to specify which KMSDRM device to use if the default is not desired
|
||||||
|
* Added the hint SDL_HINT_LINUX_DIGITAL_HATS to control whether to treat hats as digital rather than checking to see if they may be analog
|
||||||
|
* Added the hint SDL_HINT_LINUX_HAT_DEADZONES to control whether to use deadzones on analog hats
|
||||||
|
|
||||||
|
macOS:
|
||||||
|
* Bumped minimum OS deployment version to macOS 10.9
|
||||||
|
* Added SDL_GL_FLOATBUFFERS to allow Cocoa GL contexts to use EDR
|
||||||
|
* Added the hint SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH to control whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing. This hint defaults to blocking, which is the safer option on modern macOS.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
2.0.22:
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
* Added SDL_RenderGetWindow() to get the window associated with a renderer
|
||||||
|
* Added floating point rectangle functions:
|
||||||
|
* SDL_PointInFRect()
|
||||||
|
* SDL_FRectEmpty()
|
||||||
|
* SDL_FRectEquals()
|
||||||
|
* SDL_FRectEqualsEpsilon()
|
||||||
|
* SDL_HasIntersectionF()
|
||||||
|
* SDL_IntersectFRect()
|
||||||
|
* SDL_UnionFRect()
|
||||||
|
* SDL_EncloseFPoints()
|
||||||
|
* SDL_IntersectFRectAndLine()
|
||||||
|
* Added SDL_IsTextInputShown() which returns whether the IME window is currently shown
|
||||||
|
* Added SDL_ClearComposition() to dismiss the composition window without disabling IME input
|
||||||
|
* Added SDL_TEXTEDITING_EXT event for handling long composition text, and a hint SDL_HINT_IME_SUPPORT_EXTENDED_TEXT to enable it
|
||||||
|
* Added the hint SDL_HINT_MOUSE_RELATIVE_MODE_CENTER to control whether the mouse should be constrained to the whole window or the center of the window when relative mode is enabled
|
||||||
|
* The mouse is now automatically captured when mouse buttons are pressed, and the hint SDL_HINT_MOUSE_AUTO_CAPTURE allows you to control this behavior
|
||||||
|
* Added the hint SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL to let SDL know that a foreign window will be used with OpenGL
|
||||||
|
* Added the hint SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN to let SDL know that a foreign window will be used with Vulkan
|
||||||
|
* Added the hint SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE to specify whether an SDL_QUIT event will be delivered when the last application window is closed
|
||||||
|
* Added the hint SDL_HINT_JOYSTICK_ROG_CHAKRAM to control whether ROG Chakram mice show up as joysticks
|
||||||
|
|
||||||
|
Windows:
|
||||||
|
* Added support for SDL_BLENDOPERATION_MINIMUM and SDL_BLENDOPERATION_MAXIMUM to the D3D9 renderer
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
* Compiling with Wayland support requires libwayland-client version 1.18.0 or later
|
||||||
|
* Added the hint SDL_HINT_X11_WINDOW_TYPE to specify the _NET_WM_WINDOW_TYPE of SDL windows
|
||||||
|
* Added the hint SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR to allow using libdecor with compositors that support xdg-decoration
|
||||||
|
|
||||||
|
Android:
|
||||||
|
* Added SDL_AndroidSendMessage() to send a custom command to the SDL java activity
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
2.0.20:
|
2.0.20:
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
@@ -499,7 +662,7 @@ iOS:
|
|||||||
|
|
||||||
tvOS:
|
tvOS:
|
||||||
* Added support for Apple TV
|
* Added support for Apple TV
|
||||||
* Added a hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION to control whether he Apple TV remote's joystick axes will automatically match the rotation of the remote.
|
* Added a hint SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION to control whether he Apple TV remote's joystick axes will automatically match the rotation of the remote.
|
||||||
|
|
||||||
Android:
|
Android:
|
||||||
* Fixed SDL not resizing window when Android screen resolution changes
|
* Fixed SDL not resizing window when Android screen resolution changes
|
||||||
@@ -644,8 +807,8 @@ Linux:
|
|||||||
* Added experimental Wayland and Mir support, disabled by default
|
* Added experimental Wayland and Mir support, disabled by default
|
||||||
|
|
||||||
Android:
|
Android:
|
||||||
* Joystick support (minimum SDK version required to build SDL is now 12,
|
* Joystick support (minimum SDK version required to build SDL is now 12,
|
||||||
the required runtime version remains at 10, but on such devices joystick
|
the required runtime version remains at 10, but on such devices joystick
|
||||||
support won't be available).
|
support won't be available).
|
||||||
* Hotplugging support for joysticks
|
* Hotplugging support for joysticks
|
||||||
* Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
|
* Added a hint SDL_HINT_ACCELEROMETER_AS_JOYSTICK to control whether the accelerometer should be listed as a 3 axis joystick, which it will by default.
|
||||||
@@ -698,7 +861,7 @@ iOS:
|
|||||||
|
|
||||||
Android:
|
Android:
|
||||||
IMPORTANT: You MUST get the updated SDLActivity.java to match C code
|
IMPORTANT: You MUST get the updated SDLActivity.java to match C code
|
||||||
* Moved EGL initialization to native code
|
* Moved EGL initialization to native code
|
||||||
* Fixed the accelerometer axis rotation relative to the device rotation
|
* Fixed the accelerometer axis rotation relative to the device rotation
|
||||||
* Fixed race conditions when handling the EGL context on pause/resume
|
* Fixed race conditions when handling the EGL context on pause/resume
|
||||||
* Touch devices are available for enumeration immediately after init
|
* Touch devices are available for enumeration immediately after init
|
||||||
|
|||||||
Vendored
+2
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
#include "SDL_events.h"
|
#include "SDL_events.h"
|
||||||
#include "SDL_filesystem.h"
|
#include "SDL_filesystem.h"
|
||||||
#include "SDL_gamecontroller.h"
|
#include "SDL_gamecontroller.h"
|
||||||
|
#include "SDL_guid.h"
|
||||||
#include "SDL_haptic.h"
|
#include "SDL_haptic.h"
|
||||||
#include "SDL_hidapi.h"
|
#include "SDL_hidapi.h"
|
||||||
#include "SDL_hints.h"
|
#include "SDL_hints.h"
|
||||||
|
|||||||
+8
-12
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
#ifndef SDL_assert_h_
|
#ifndef SDL_assert_h_
|
||||||
#define SDL_assert_h_
|
#define SDL_assert_h_
|
||||||
|
|
||||||
#include "SDL_config.h"
|
#include "SDL_stdinc.h"
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
@@ -51,6 +51,8 @@ assert can have unique static variables associated with it.
|
|||||||
/* Don't include intrin.h here because it contains C++ code */
|
/* Don't include intrin.h here because it contains C++ code */
|
||||||
extern void __cdecl __debugbreak(void);
|
extern void __cdecl __debugbreak(void);
|
||||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||||
|
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
|
||||||
|
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
||||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||||
@@ -69,7 +71,7 @@ assert can have unique static variables associated with it.
|
|||||||
|
|
||||||
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
|
||||||
# define SDL_FUNCTION __func__
|
# define SDL_FUNCTION __func__
|
||||||
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
|
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
|
||||||
# define SDL_FUNCTION __FUNCTION__
|
# define SDL_FUNCTION __FUNCTION__
|
||||||
#else
|
#else
|
||||||
# define SDL_FUNCTION "???"
|
# define SDL_FUNCTION "???"
|
||||||
@@ -123,12 +125,10 @@ typedef struct SDL_AssertData
|
|||||||
const struct SDL_AssertData *next;
|
const struct SDL_AssertData *next;
|
||||||
} SDL_AssertData;
|
} SDL_AssertData;
|
||||||
|
|
||||||
#if (SDL_ASSERT_LEVEL > 0)
|
|
||||||
|
|
||||||
/* Never call this directly. Use the SDL_assert* macros. */
|
/* Never call this directly. Use the SDL_assert* macros. */
|
||||||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
||||||
const char *,
|
const char *,
|
||||||
const char *, int)
|
const char *, int)
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#if __has_feature(attribute_analyzer_noreturn)
|
#if __has_feature(attribute_analyzer_noreturn)
|
||||||
/* this tells Clang's static analysis that we're a custom assert function,
|
/* this tells Clang's static analysis that we're a custom assert function,
|
||||||
@@ -149,9 +149,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
|||||||
#define SDL_enabled_assert(condition) \
|
#define SDL_enabled_assert(condition) \
|
||||||
do { \
|
do { \
|
||||||
while ( !(condition) ) { \
|
while ( !(condition) ) { \
|
||||||
static struct SDL_AssertData sdl_assert_data = { \
|
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
|
||||||
0, 0, #condition, 0, 0, 0, 0 \
|
|
||||||
}; \
|
|
||||||
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
|
||||||
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
|
||||||
continue; /* go again. */ \
|
continue; /* go again. */ \
|
||||||
@@ -162,8 +160,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
|
|||||||
} \
|
} \
|
||||||
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
} while (SDL_NULL_WHILE_LOOP_CONDITION)
|
||||||
|
|
||||||
#endif /* enabled assertions support code */
|
|
||||||
|
|
||||||
/* Enable various levels of assertions. */
|
/* Enable various levels of assertions. */
|
||||||
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
|
||||||
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
# define SDL_assert(condition) SDL_disabled_assert(condition)
|
||||||
|
|||||||
+20
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -237,6 +237,25 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
|
||||||
|
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
|
||||||
|
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
|
||||||
|
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
|
||||||
|
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
|
||||||
|
#elif (defined(__powerpc__) || defined(__powerpc64__))
|
||||||
|
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
|
||||||
|
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
|
||||||
|
#define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
|
||||||
|
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
|
||||||
|
#define SDL_CPUPauseInstruction() __yield()
|
||||||
|
#elif defined(__WATCOMC__) && defined(__386__)
|
||||||
|
extern __inline void SDL_CPUPauseInstruction(void);
|
||||||
|
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
|
||||||
|
#else
|
||||||
|
#define SDL_CPUPauseInstruction()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A type representing an atomic integer value. It is a struct
|
* \brief A type representing an atomic integer value. It is a struct
|
||||||
* so people don't accidentally use numeric operations on it.
|
* so people don't accidentally use numeric operations on it.
|
||||||
|
|||||||
+47
-11
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -169,13 +169,13 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
|
|||||||
* The calculated values in this structure are calculated by SDL_OpenAudio().
|
* The calculated values in this structure are calculated by SDL_OpenAudio().
|
||||||
*
|
*
|
||||||
* For multi-channel audio, the default SDL channel mapping is:
|
* For multi-channel audio, the default SDL channel mapping is:
|
||||||
* 2: FL FR (stereo)
|
* 2: FL FR (stereo)
|
||||||
* 3: FL FR LFE (2.1 surround)
|
* 3: FL FR LFE (2.1 surround)
|
||||||
* 4: FL FR BL BR (quad)
|
* 4: FL FR BL BR (quad)
|
||||||
* 5: FL FR FC BL BR (quad + center)
|
* 5: FL FR LFE BL BR (4.1 surround)
|
||||||
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
|
||||||
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
* 7: FL FR FC LFE BC SL SR (6.1 surround)
|
||||||
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
|
||||||
*/
|
*/
|
||||||
typedef struct SDL_AudioSpec
|
typedef struct SDL_AudioSpec
|
||||||
{
|
{
|
||||||
@@ -487,6 +487,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
|
|||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetNumAudioDevices
|
* \sa SDL_GetNumAudioDevices
|
||||||
|
* \sa SDL_GetDefaultAudioInfo
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
||||||
int iscapture);
|
int iscapture);
|
||||||
@@ -500,9 +501,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
|||||||
* hardware.
|
* hardware.
|
||||||
*
|
*
|
||||||
* `spec` will be filled with the sample rate, sample format, and channel
|
* `spec` will be filled with the sample rate, sample format, and channel
|
||||||
* count. All other values in the structure are filled with 0. When the
|
* count.
|
||||||
* supported struct members are 0, SDL was unable to get the property from the
|
|
||||||
* backend.
|
|
||||||
*
|
*
|
||||||
* \param index the index of the audio device; valid values range from 0 to
|
* \param index the index of the audio device; valid values range from 0 to
|
||||||
* SDL_GetNumAudioDevices() - 1
|
* SDL_GetNumAudioDevices() - 1
|
||||||
@@ -514,12 +513,48 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
|
|||||||
* \since This function is available since SDL 2.0.16.
|
* \since This function is available since SDL 2.0.16.
|
||||||
*
|
*
|
||||||
* \sa SDL_GetNumAudioDevices
|
* \sa SDL_GetNumAudioDevices
|
||||||
|
* \sa SDL_GetDefaultAudioInfo
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
|
extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
|
||||||
int iscapture,
|
int iscapture,
|
||||||
SDL_AudioSpec *spec);
|
SDL_AudioSpec *spec);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name and preferred format of the default audio device.
|
||||||
|
*
|
||||||
|
* Some (but not all!) platforms have an isolated mechanism to get information
|
||||||
|
* about the "default" device. This can actually be a completely different
|
||||||
|
* device that's not in the list you get from SDL_GetAudioDeviceSpec(). It can
|
||||||
|
* even be a network address! (This is discussed in SDL_OpenAudioDevice().)
|
||||||
|
*
|
||||||
|
* As a result, this call is not guaranteed to be performant, as it can query
|
||||||
|
* the sound server directly every time, unlike the other query functions. You
|
||||||
|
* should call this function sparingly!
|
||||||
|
*
|
||||||
|
* `spec` will be filled with the sample rate, sample format, and channel
|
||||||
|
* count, if a default device exists on the system. If `name` is provided,
|
||||||
|
* will be filled with either a dynamically-allocated UTF-8 string or NULL.
|
||||||
|
*
|
||||||
|
* \param name A pointer to be filled with the name of the default device (can
|
||||||
|
* be NULL). Please call SDL_free() when you are done with this
|
||||||
|
* pointer!
|
||||||
|
* \param spec The SDL_AudioSpec to be initialized by this function.
|
||||||
|
* \param iscapture non-zero to query the default recording device, zero to
|
||||||
|
* query the default output device.
|
||||||
|
* \returns 0 on success, nonzero on error
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetAudioDeviceName
|
||||||
|
* \sa SDL_GetAudioDeviceSpec
|
||||||
|
* \sa SDL_OpenAudioDevice
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name,
|
||||||
|
SDL_AudioSpec *spec,
|
||||||
|
int iscapture);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a specific audio device.
|
* Open a specific audio device.
|
||||||
*
|
*
|
||||||
@@ -586,6 +621,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
|
|||||||
* - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE`
|
* - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE`
|
||||||
* - `SDL_AUDIO_ALLOW_FORMAT_CHANGE`
|
* - `SDL_AUDIO_ALLOW_FORMAT_CHANGE`
|
||||||
* - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE`
|
* - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE`
|
||||||
|
* - `SDL_AUDIO_ALLOW_SAMPLES_CHANGE`
|
||||||
* - `SDL_AUDIO_ALLOW_ANY_CHANGE`
|
* - `SDL_AUDIO_ALLOW_ANY_CHANGE`
|
||||||
*
|
*
|
||||||
* These flags specify how SDL should behave when a device cannot offer a
|
* These flags specify how SDL should behave when a device cannot offer a
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+6
-8
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -52,7 +52,7 @@ typedef enum
|
|||||||
dstA = dstA */
|
dstA = dstA */
|
||||||
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
|
||||||
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
|
||||||
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
|
dstA = dstA */
|
||||||
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
|
||||||
|
|
||||||
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
|
||||||
@@ -67,9 +67,8 @@ typedef enum
|
|||||||
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */
|
||||||
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||||
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */
|
||||||
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */
|
SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */
|
||||||
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */
|
SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */
|
||||||
|
|
||||||
} SDL_BlendOperation;
|
} SDL_BlendOperation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,7 +86,6 @@ typedef enum
|
|||||||
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
|
SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */
|
||||||
SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */
|
SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */
|
||||||
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
|
SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */
|
||||||
|
|
||||||
} SDL_BlendFactor;
|
} SDL_BlendFactor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -135,10 +133,10 @@ typedef enum
|
|||||||
* SDL 2.0.6. All renderers support the four blend modes listed in the
|
* SDL 2.0.6. All renderers support the four blend modes listed in the
|
||||||
* SDL_BlendMode enumeration.
|
* SDL_BlendMode enumeration.
|
||||||
*
|
*
|
||||||
* - **direct3d**: Supports `SDL_BLENDOPERATION_ADD` with all factors.
|
* - **direct3d**: Supports all operations with all factors. However, some
|
||||||
* - **direct3d11**: Supports all operations with all factors. However, some
|
|
||||||
* factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
|
* factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
|
||||||
* `SDL_BLENDOPERATION_MAXIMUM`.
|
* `SDL_BLENDOPERATION_MAXIMUM`.
|
||||||
|
* - **direct3d11**: Same as Direct3D 9.
|
||||||
* - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
|
* - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
|
||||||
* factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL
|
* factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL
|
||||||
* 2.0.6.
|
* 2.0.6.
|
||||||
|
|||||||
+48
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -82,6 +82,53 @@ extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Put UTF-8 text into the primary selection.
|
||||||
|
*
|
||||||
|
* \param text the text to store in the primary selection
|
||||||
|
* \returns 0 on success or a negative error code on failure; call
|
||||||
|
* SDL_GetError() for more information.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.26.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetPrimarySelectionText
|
||||||
|
* \sa SDL_HasPrimarySelectionText
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get UTF-8 text from the primary selection, which must be freed with
|
||||||
|
* SDL_free().
|
||||||
|
*
|
||||||
|
* This functions returns empty string if there was not enough memory left for
|
||||||
|
* a copy of the primary selection's content.
|
||||||
|
*
|
||||||
|
* \returns the primary selection text on success or an empty string on
|
||||||
|
* failure; call SDL_GetError() for more information. Caller must
|
||||||
|
* call SDL_free() on the returned pointer when done with it (even if
|
||||||
|
* there was an error).
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.26.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasPrimarySelectionText
|
||||||
|
* \sa SDL_SetPrimarySelectionText
|
||||||
|
*/
|
||||||
|
extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query whether the primary selection exists and contains a non-empty text
|
||||||
|
* string.
|
||||||
|
*
|
||||||
|
* \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it
|
||||||
|
* does not.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.26.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetPrimarySelectionText
|
||||||
|
* \sa SDL_SetPrimarySelectionText
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
|
||||||
|
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
/* Ends C function definitions when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
+73
-47
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -38,12 +38,23 @@
|
|||||||
#include <winsdkver.h>
|
#include <winsdkver.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* sdkddkver.h defines more specific SDK version numbers. This is needed because older versions of the
|
||||||
|
* Windows 10 SDK have broken declarations for the C API for DirectX 12. */
|
||||||
|
#if !defined(HAVE_SDKDDKVER_H) && defined(__has_include)
|
||||||
|
#if __has_include(<sdkddkver.h>)
|
||||||
|
#define HAVE_SDKDDKVER_H 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_SDKDDKVER_H
|
||||||
|
#include <sdkddkver.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
/* This is a set of defines to configure the SDL features */
|
||||||
|
|
||||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
|
||||||
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) || defined(__BORLANDC__) || defined(__CODEGEARC__)
|
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
||||||
#define HAVE_STDINT_H 1
|
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
typedef signed __int8 int8_t;
|
typedef signed __int8 int8_t;
|
||||||
typedef unsigned __int8 uint8_t;
|
typedef unsigned __int8 uint8_t;
|
||||||
typedef signed __int16 int16_t;
|
typedef signed __int16 int16_t;
|
||||||
@@ -60,28 +71,9 @@ typedef unsigned int uintptr_t;
|
|||||||
#endif
|
#endif
|
||||||
#define _UINTPTR_T_DEFINED
|
#define _UINTPTR_T_DEFINED
|
||||||
#endif
|
#endif
|
||||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
#else
|
||||||
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
#define HAVE_STDINT_H 1
|
||||||
#define DWORD_PTR DWORD
|
#endif /* Visual Studio 2008 */
|
||||||
#endif
|
|
||||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
|
||||||
#define LONG_PTR LONG
|
|
||||||
#endif
|
|
||||||
#else /* !__GNUC__ && !_MSC_VER */
|
|
||||||
typedef signed char int8_t;
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
typedef signed short int16_t;
|
|
||||||
typedef unsigned short uint16_t;
|
|
||||||
typedef signed int int32_t;
|
|
||||||
typedef unsigned int uint32_t;
|
|
||||||
typedef signed long long int64_t;
|
|
||||||
typedef unsigned long long uint64_t;
|
|
||||||
#ifndef _SIZE_T_DEFINED_
|
|
||||||
#define _SIZE_T_DEFINED_
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
#endif
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
#endif /* __GNUC__ || _MSC_VER */
|
|
||||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
||||||
|
|
||||||
#ifdef _WIN64
|
#ifdef _WIN64
|
||||||
@@ -90,9 +82,14 @@ typedef unsigned int uintptr_t;
|
|||||||
# define SIZEOF_VOIDP 4
|
# define SIZEOF_VOIDP 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
# define HAVE_GCC_ATOMICS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HAVE_DDRAW_H 1
|
#define HAVE_DDRAW_H 1
|
||||||
#define HAVE_DINPUT_H 1
|
#define HAVE_DINPUT_H 1
|
||||||
#define HAVE_DSOUND_H 1
|
#define HAVE_DSOUND_H 1
|
||||||
|
#ifndef __WATCOMC__
|
||||||
#define HAVE_DXGI_H 1
|
#define HAVE_DXGI_H 1
|
||||||
#define HAVE_XINPUT_H 1
|
#define HAVE_XINPUT_H 1
|
||||||
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */
|
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */
|
||||||
@@ -100,11 +97,19 @@ typedef unsigned int uintptr_t;
|
|||||||
#endif
|
#endif
|
||||||
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602 /* Windows 8 SDK */
|
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602 /* Windows 8 SDK */
|
||||||
#define HAVE_D3D11_H 1
|
#define HAVE_D3D11_H 1
|
||||||
|
#define HAVE_ROAPI_H 1
|
||||||
|
#endif
|
||||||
|
#if defined(WDK_NTDDI_VERSION) && WDK_NTDDI_VERSION > 0x0A000008 /* 10.0.19041.0 */
|
||||||
|
#define HAVE_D3D12_H 1
|
||||||
|
#endif
|
||||||
|
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */
|
||||||
|
#define HAVE_SHELLSCALINGAPI_H 1
|
||||||
#endif
|
#endif
|
||||||
#define HAVE_MMDEVICEAPI_H 1
|
#define HAVE_MMDEVICEAPI_H 1
|
||||||
#define HAVE_AUDIOCLIENT_H 1
|
#define HAVE_AUDIOCLIENT_H 1
|
||||||
#define HAVE_TPCSHRD_H 1
|
#define HAVE_TPCSHRD_H 1
|
||||||
#define HAVE_SENSORSAPI_H 1
|
#define HAVE_SENSORSAPI_H 1
|
||||||
|
#endif
|
||||||
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
|
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
|
||||||
#define HAVE_IMMINTRIN_H 1
|
#define HAVE_IMMINTRIN_H 1
|
||||||
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
|
||||||
@@ -131,7 +136,11 @@ typedef unsigned int uintptr_t;
|
|||||||
#define HAVE_REALLOC 1
|
#define HAVE_REALLOC 1
|
||||||
#define HAVE_FREE 1
|
#define HAVE_FREE 1
|
||||||
#define HAVE_ALLOCA 1
|
#define HAVE_ALLOCA 1
|
||||||
|
/* OpenWatcom requires specific calling conventions for qsort and bsearch */
|
||||||
|
#ifndef __WATCOMC__
|
||||||
#define HAVE_QSORT 1
|
#define HAVE_QSORT 1
|
||||||
|
#define HAVE_BSEARCH 1
|
||||||
|
#endif
|
||||||
#define HAVE_ABS 1
|
#define HAVE_ABS 1
|
||||||
#define HAVE_MEMSET 1
|
#define HAVE_MEMSET 1
|
||||||
#define HAVE_MEMCPY 1
|
#define HAVE_MEMCPY 1
|
||||||
@@ -162,37 +171,40 @@ typedef unsigned int uintptr_t;
|
|||||||
#define HAVE__WCSNICMP 1
|
#define HAVE__WCSNICMP 1
|
||||||
#define HAVE__WCSDUP 1
|
#define HAVE__WCSDUP 1
|
||||||
#define HAVE_ACOS 1
|
#define HAVE_ACOS 1
|
||||||
#define HAVE_ACOSF 1
|
|
||||||
#define HAVE_ASIN 1
|
#define HAVE_ASIN 1
|
||||||
#define HAVE_ASINF 1
|
|
||||||
#define HAVE_ATAN 1
|
#define HAVE_ATAN 1
|
||||||
#define HAVE_ATANF 1
|
|
||||||
#define HAVE_ATAN2 1
|
#define HAVE_ATAN2 1
|
||||||
|
#define HAVE_CEIL 1
|
||||||
|
#define HAVE_COS 1
|
||||||
|
#define HAVE_EXP 1
|
||||||
|
#define HAVE_FABS 1
|
||||||
|
#define HAVE_FLOOR 1
|
||||||
|
#define HAVE_FMOD 1
|
||||||
|
#define HAVE_LOG 1
|
||||||
|
#define HAVE_LOG10 1
|
||||||
|
#define HAVE_POW 1
|
||||||
|
#define HAVE_SIN 1
|
||||||
|
#define HAVE_SQRT 1
|
||||||
|
#define HAVE_TAN 1
|
||||||
|
#ifndef __WATCOMC__
|
||||||
|
#define HAVE_ACOSF 1
|
||||||
|
#define HAVE_ASINF 1
|
||||||
|
#define HAVE_ATANF 1
|
||||||
#define HAVE_ATAN2F 1
|
#define HAVE_ATAN2F 1
|
||||||
#define HAVE_CEILF 1
|
#define HAVE_CEILF 1
|
||||||
#define HAVE__COPYSIGN 1
|
#define HAVE__COPYSIGN 1
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
#define HAVE_COSF 1
|
||||||
#define HAVE_EXP 1
|
|
||||||
#define HAVE_EXPF 1
|
#define HAVE_EXPF 1
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FABSF 1
|
#define HAVE_FABSF 1
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_FLOORF 1
|
#define HAVE_FLOORF 1
|
||||||
#define HAVE_FMOD 1
|
|
||||||
#define HAVE_FMODF 1
|
#define HAVE_FMODF 1
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_LOGF 1
|
#define HAVE_LOGF 1
|
||||||
#define HAVE_LOG10 1
|
|
||||||
#define HAVE_LOG10F 1
|
#define HAVE_LOG10F 1
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_POWF 1
|
#define HAVE_POWF 1
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
#define HAVE_SINF 1
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
#define HAVE_SQRTF 1
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
#define HAVE_TANF 1
|
||||||
|
#endif
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
/* These functions were added with the VC++ 2013 C runtime library */
|
/* These functions were added with the VC++ 2013 C runtime library */
|
||||||
#if _MSC_VER >= 1800
|
#if _MSC_VER >= 1800
|
||||||
@@ -212,8 +224,18 @@ typedef unsigned int uintptr_t;
|
|||||||
#if _MSC_VER >= 1400
|
#if _MSC_VER >= 1400
|
||||||
#define HAVE__FSEEKI64 1
|
#define HAVE__FSEEKI64 1
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _USE_MATH_DEFINES
|
||||||
|
#define HAVE_M_PI 1
|
||||||
#endif
|
#endif
|
||||||
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
|
#elif defined(__WATCOMC__)
|
||||||
|
#define HAVE__FSEEKI64 1
|
||||||
|
#define HAVE_STRTOLL 1
|
||||||
|
#define HAVE_STRTOULL 1
|
||||||
|
#define HAVE_VSSCANF 1
|
||||||
|
#define HAVE_ROUND 1
|
||||||
|
#define HAVE_SCALBN 1
|
||||||
|
#define HAVE_TRUNC 1
|
||||||
|
#else
|
||||||
#define HAVE_M_PI 1
|
#define HAVE_M_PI 1
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
@@ -222,7 +244,9 @@ typedef unsigned int uintptr_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
/* Enable various audio drivers */
|
||||||
|
#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)
|
||||||
#define SDL_AUDIO_DRIVER_WASAPI 1
|
#define SDL_AUDIO_DRIVER_WASAPI 1
|
||||||
|
#endif
|
||||||
#define SDL_AUDIO_DRIVER_DSOUND 1
|
#define SDL_AUDIO_DRIVER_DSOUND 1
|
||||||
#define SDL_AUDIO_DRIVER_WINMM 1
|
#define SDL_AUDIO_DRIVER_WINMM 1
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
#define SDL_AUDIO_DRIVER_DISK 1
|
||||||
@@ -243,7 +267,11 @@ typedef unsigned int uintptr_t;
|
|||||||
#define SDL_HAPTIC_XINPUT 1
|
#define SDL_HAPTIC_XINPUT 1
|
||||||
|
|
||||||
/* Enable the sensor driver */
|
/* Enable the sensor driver */
|
||||||
|
#ifdef HAVE_SENSORSAPI_H
|
||||||
#define SDL_SENSOR_WINDOWS 1
|
#define SDL_SENSOR_WINDOWS 1
|
||||||
|
#else
|
||||||
|
#define SDL_SENSOR_DUMMY 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
/* Enable various shared object loading systems */
|
||||||
#define SDL_LOADSO_WINDOWS 1
|
#define SDL_LOADSO_WINDOWS 1
|
||||||
@@ -265,6 +293,9 @@ typedef unsigned int uintptr_t;
|
|||||||
#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
|
#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
|
||||||
#define SDL_VIDEO_RENDER_D3D11 1
|
#define SDL_VIDEO_RENDER_D3D11 1
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
|
||||||
|
#define SDL_VIDEO_RENDER_D3D12 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
/* Enable OpenGL support */
|
||||||
#ifndef SDL_VIDEO_OPENGL
|
#ifndef SDL_VIDEO_OPENGL
|
||||||
@@ -295,11 +326,6 @@ typedef unsigned int uintptr_t;
|
|||||||
/* Enable filesystem support */
|
/* Enable filesystem support */
|
||||||
#define SDL_FILESYSTEM_WINDOWS 1
|
#define SDL_FILESYSTEM_WINDOWS 1
|
||||||
|
|
||||||
/* Enable assembly routines (Win64 doesn't have inline asm) */
|
|
||||||
#ifndef _WIN64
|
|
||||||
#define SDL_ASSEMBLY_ROUTINES 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_windows_h_ */
|
#endif /* SDL_config_windows_h_ */
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
|
|||||||
-445
@@ -1,445 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_config.h.in
|
|
||||||
*
|
|
||||||
* This is a set of defines to configure the SDL features
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* General platform specific identifiers */
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/* C language features */
|
|
||||||
#cmakedefine const @HAVE_CONST@
|
|
||||||
#cmakedefine inline @HAVE_INLINE@
|
|
||||||
#cmakedefine volatile @HAVE_VOLATILE@
|
|
||||||
|
|
||||||
/* C datatypes */
|
|
||||||
/* Define SIZEOF_VOIDP for 64/32 architectures */
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@
|
|
||||||
#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@
|
|
||||||
|
|
||||||
#cmakedefine HAVE_D3D_H @HAVE_D3D_H@
|
|
||||||
#cmakedefine HAVE_D3D11_H @HAVE_D3D11_H@
|
|
||||||
#cmakedefine HAVE_DDRAW_H @HAVE_DDRAW_H@
|
|
||||||
#cmakedefine HAVE_DSOUND_H @HAVE_DSOUND_H@
|
|
||||||
#cmakedefine HAVE_DINPUT_H @HAVE_DINPUT_H@
|
|
||||||
#cmakedefine HAVE_XAUDIO2_H @HAVE_XAUDIO2_H@
|
|
||||||
#cmakedefine HAVE_XINPUT_H @HAVE_XINPUT_H@
|
|
||||||
#cmakedefine HAVE_DXGI_H @HAVE_DXGI_H@
|
|
||||||
#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
|
|
||||||
#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
|
|
||||||
|
|
||||||
/* Comment this if you want to build without any C library requirements */
|
|
||||||
#cmakedefine HAVE_LIBC 1
|
|
||||||
#if HAVE_LIBC
|
|
||||||
|
|
||||||
/* Useful headers */
|
|
||||||
#cmakedefine HAVE_ALLOCA_H 1
|
|
||||||
#cmakedefine HAVE_SYS_TYPES_H 1
|
|
||||||
#cmakedefine HAVE_STDIO_H 1
|
|
||||||
#cmakedefine STDC_HEADERS 1
|
|
||||||
#cmakedefine HAVE_STDLIB_H 1
|
|
||||||
#cmakedefine HAVE_STDARG_H 1
|
|
||||||
#cmakedefine HAVE_MALLOC_H 1
|
|
||||||
#cmakedefine HAVE_MEMORY_H 1
|
|
||||||
#cmakedefine HAVE_STRING_H 1
|
|
||||||
#cmakedefine HAVE_STRINGS_H 1
|
|
||||||
#cmakedefine HAVE_WCHAR_H 1
|
|
||||||
#cmakedefine HAVE_INTTYPES_H 1
|
|
||||||
#cmakedefine HAVE_STDINT_H 1
|
|
||||||
#cmakedefine HAVE_CTYPE_H 1
|
|
||||||
#cmakedefine HAVE_MATH_H 1
|
|
||||||
#cmakedefine HAVE_ICONV_H 1
|
|
||||||
#cmakedefine HAVE_SIGNAL_H 1
|
|
||||||
#cmakedefine HAVE_ALTIVEC_H 1
|
|
||||||
#cmakedefine HAVE_PTHREAD_NP_H 1
|
|
||||||
#cmakedefine HAVE_LIBUDEV_H 1
|
|
||||||
#cmakedefine HAVE_DBUS_DBUS_H 1
|
|
||||||
#cmakedefine HAVE_IBUS_IBUS_H 1
|
|
||||||
#cmakedefine HAVE_FCITX_FRONTEND_H 1
|
|
||||||
#cmakedefine HAVE_LIBSAMPLERATE_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#cmakedefine HAVE_MALLOC 1
|
|
||||||
#cmakedefine HAVE_CALLOC 1
|
|
||||||
#cmakedefine HAVE_REALLOC 1
|
|
||||||
#cmakedefine HAVE_FREE 1
|
|
||||||
#cmakedefine HAVE_ALLOCA 1
|
|
||||||
#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
|
|
||||||
#cmakedefine HAVE_GETENV 1
|
|
||||||
#cmakedefine HAVE_SETENV 1
|
|
||||||
#cmakedefine HAVE_PUTENV 1
|
|
||||||
#cmakedefine HAVE_UNSETENV 1
|
|
||||||
#endif
|
|
||||||
#cmakedefine HAVE_QSORT 1
|
|
||||||
#cmakedefine HAVE_ABS 1
|
|
||||||
#cmakedefine HAVE_BCOPY 1
|
|
||||||
#cmakedefine HAVE_MEMSET 1
|
|
||||||
#cmakedefine HAVE_MEMCPY 1
|
|
||||||
#cmakedefine HAVE_MEMMOVE 1
|
|
||||||
#cmakedefine HAVE_MEMCMP 1
|
|
||||||
#cmakedefine HAVE_WCSLEN 1
|
|
||||||
#cmakedefine HAVE_WCSLCPY 1
|
|
||||||
#cmakedefine HAVE_WCSLCAT 1
|
|
||||||
#cmakedefine HAVE_WCSCMP 1
|
|
||||||
#cmakedefine HAVE_STRLEN 1
|
|
||||||
#cmakedefine HAVE_STRLCPY 1
|
|
||||||
#cmakedefine HAVE_STRLCAT 1
|
|
||||||
#cmakedefine HAVE_STRDUP 1
|
|
||||||
#cmakedefine HAVE__STRREV 1
|
|
||||||
#cmakedefine HAVE__STRUPR 1
|
|
||||||
#cmakedefine HAVE__STRLWR 1
|
|
||||||
#cmakedefine HAVE_INDEX 1
|
|
||||||
#cmakedefine HAVE_RINDEX 1
|
|
||||||
#cmakedefine HAVE_STRCHR 1
|
|
||||||
#cmakedefine HAVE_STRRCHR 1
|
|
||||||
#cmakedefine HAVE_STRSTR 1
|
|
||||||
#cmakedefine HAVE_ITOA 1
|
|
||||||
#cmakedefine HAVE__LTOA 1
|
|
||||||
#cmakedefine HAVE__UITOA 1
|
|
||||||
#cmakedefine HAVE__ULTOA 1
|
|
||||||
#cmakedefine HAVE_STRTOL 1
|
|
||||||
#cmakedefine HAVE_STRTOUL 1
|
|
||||||
#cmakedefine HAVE__I64TOA 1
|
|
||||||
#cmakedefine HAVE__UI64TOA 1
|
|
||||||
#cmakedefine HAVE_STRTOLL 1
|
|
||||||
#cmakedefine HAVE_STRTOULL 1
|
|
||||||
#cmakedefine HAVE_STRTOD 1
|
|
||||||
#cmakedefine HAVE_ATOI 1
|
|
||||||
#cmakedefine HAVE_ATOF 1
|
|
||||||
#cmakedefine HAVE_STRCMP 1
|
|
||||||
#cmakedefine HAVE_STRNCMP 1
|
|
||||||
#cmakedefine HAVE__STRICMP 1
|
|
||||||
#cmakedefine HAVE_STRCASECMP 1
|
|
||||||
#cmakedefine HAVE__STRNICMP 1
|
|
||||||
#cmakedefine HAVE_STRNCASECMP 1
|
|
||||||
#cmakedefine HAVE_VSSCANF 1
|
|
||||||
#cmakedefine HAVE_VSNPRINTF 1
|
|
||||||
#cmakedefine HAVE_M_PI 1
|
|
||||||
#cmakedefine HAVE_ATAN 1
|
|
||||||
#cmakedefine HAVE_ATAN2 1
|
|
||||||
#cmakedefine HAVE_ACOS 1
|
|
||||||
#cmakedefine HAVE_ASIN 1
|
|
||||||
#cmakedefine HAVE_CEIL 1
|
|
||||||
#cmakedefine HAVE_COPYSIGN 1
|
|
||||||
#cmakedefine HAVE_COS 1
|
|
||||||
#cmakedefine HAVE_COSF 1
|
|
||||||
#cmakedefine HAVE_FABS 1
|
|
||||||
#cmakedefine HAVE_FLOOR 1
|
|
||||||
#cmakedefine HAVE_LOG 1
|
|
||||||
#cmakedefine HAVE_POW 1
|
|
||||||
#cmakedefine HAVE_SCALBN 1
|
|
||||||
#cmakedefine HAVE_SIN 1
|
|
||||||
#cmakedefine HAVE_SINF 1
|
|
||||||
#cmakedefine HAVE_SQRT 1
|
|
||||||
#cmakedefine HAVE_SQRTF 1
|
|
||||||
#cmakedefine HAVE_TAN 1
|
|
||||||
#cmakedefine HAVE_TANF 1
|
|
||||||
#cmakedefine HAVE_FOPEN64 1
|
|
||||||
#cmakedefine HAVE_FSEEKO 1
|
|
||||||
#cmakedefine HAVE_FSEEKO64 1
|
|
||||||
#cmakedefine HAVE_SIGACTION 1
|
|
||||||
#cmakedefine HAVE_SA_SIGACTION 1
|
|
||||||
#cmakedefine HAVE_SETJMP 1
|
|
||||||
#cmakedefine HAVE_NANOSLEEP 1
|
|
||||||
#cmakedefine HAVE_SYSCONF 1
|
|
||||||
#cmakedefine HAVE_SYSCTLBYNAME 1
|
|
||||||
#cmakedefine HAVE_CLOCK_GETTIME 1
|
|
||||||
#cmakedefine HAVE_GETPAGESIZE 1
|
|
||||||
#cmakedefine HAVE_MPROTECT 1
|
|
||||||
#cmakedefine HAVE_ICONV 1
|
|
||||||
#cmakedefine HAVE_PTHREAD_SETNAME_NP 1
|
|
||||||
#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1
|
|
||||||
#cmakedefine HAVE_SEM_TIMEDWAIT 1
|
|
||||||
#cmakedefine HAVE_GETAUXVAL 1
|
|
||||||
#cmakedefine HAVE_POLL 1
|
|
||||||
|
|
||||||
#elif __WIN32__
|
|
||||||
#cmakedefine HAVE_STDARG_H 1
|
|
||||||
#cmakedefine HAVE_STDDEF_H 1
|
|
||||||
#else
|
|
||||||
/* We may need some replacement for stdarg.h here */
|
|
||||||
#include <stdarg.h>
|
|
||||||
#endif /* HAVE_LIBC */
|
|
||||||
|
|
||||||
/* SDL internal assertion support */
|
|
||||||
#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
|
|
||||||
|
|
||||||
/* Allow disabling of core subsystems */
|
|
||||||
#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@
|
|
||||||
#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@
|
|
||||||
#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@
|
|
||||||
#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@
|
|
||||||
#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
|
|
||||||
#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
|
|
||||||
#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
|
|
||||||
#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
|
|
||||||
#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
|
|
||||||
#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
|
|
||||||
#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@
|
|
||||||
#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@
|
|
||||||
#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@
|
|
||||||
#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_ANDROID @SDL_AUDIO_DRIVER_ANDROID@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_EMSCRIPTEN @SDL_AUDIO_DRIVER_EMSCRIPTEN@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_HAIKU @SDL_AUDIO_DRIVER_HAIKU@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_JACK @SDL_AUDIO_DRIVER_JACK@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_JACK_DYNAMIC @SDL_AUDIO_DRIVER_JACK_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_NETBSD @SDL_AUDIO_DRIVER_NETBSD@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_WASAPI @SDL_AUDIO_DRIVER_WASAPI@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@
|
|
||||||
#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@
|
|
||||||
#cmakedefine SDL_INPUT_LINUXKD @SDL_INPUT_LINUXKD@
|
|
||||||
#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@
|
|
||||||
#cmakedefine SDL_JOYSTICK_ANDROID @SDL_JOYSTICK_ANDROID@
|
|
||||||
#cmakedefine SDL_JOYSTICK_HAIKU @SDL_JOYSTICK_HAIKU@
|
|
||||||
#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@
|
|
||||||
#cmakedefine SDL_JOYSTICK_XINPUT @SDL_JOYSTICK_XINPUT@
|
|
||||||
#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@
|
|
||||||
#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@
|
|
||||||
#cmakedefine SDL_JOYSTICK_MFI @SDL_JOYSTICK_MFI@
|
|
||||||
#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@
|
|
||||||
#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@
|
|
||||||
#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@
|
|
||||||
#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@
|
|
||||||
#cmakedefine SDL_JOYSTICK_EMSCRIPTEN @SDL_JOYSTICK_EMSCRIPTEN@
|
|
||||||
#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@
|
|
||||||
#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@
|
|
||||||
#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@
|
|
||||||
#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@
|
|
||||||
#cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
|
|
||||||
#cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
|
|
||||||
#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
|
|
||||||
#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@
|
|
||||||
#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@
|
|
||||||
#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@
|
|
||||||
#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@
|
|
||||||
#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#cmakedefine SDL_TIMER_HAIKU @SDL_TIMER_HAIKU@
|
|
||||||
#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@
|
|
||||||
#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@
|
|
||||||
#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@
|
|
||||||
#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_ANDROID @SDL_VIDEO_DRIVER_ANDROID@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_HAIKU @SDL_VIDEO_DRIVER_HAIKU@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND @SDL_VIDEO_DRIVER_WAYLAND@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_RPI @SDL_VIDEO_DRIVER_RPI@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE @SDL_VIDEO_DRIVER_VIVANTE@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_VIVANTE_VDK @SDL_VIDEO_DRIVER_VIVANTE_VDK@
|
|
||||||
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM @SDL_VIDEO_DRIVER_KMSDRM@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM @SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM@
|
|
||||||
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH @SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@
|
|
||||||
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@
|
|
||||||
#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@
|
|
||||||
|
|
||||||
#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@
|
|
||||||
#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@
|
|
||||||
#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@
|
|
||||||
#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@
|
|
||||||
#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@
|
|
||||||
#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@
|
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_ES2 @SDL_VIDEO_OPENGL_ES2@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_EGL @SDL_VIDEO_OPENGL_EGL@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@
|
|
||||||
#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@
|
|
||||||
|
|
||||||
/* Enable Vulkan support */
|
|
||||||
#cmakedefine SDL_VIDEO_VULKAN @SDL_VIDEO_VULKAN@
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@
|
|
||||||
#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@
|
|
||||||
#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@
|
|
||||||
#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@
|
|
||||||
#cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@
|
|
||||||
#cmakedefine SDL_POWER_EMSCRIPTEN @SDL_POWER_EMSCRIPTEN@
|
|
||||||
#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@
|
|
||||||
|
|
||||||
/* Enable system filesystem support */
|
|
||||||
#cmakedefine SDL_FILESYSTEM_ANDROID @SDL_FILESYSTEM_ANDROID@
|
|
||||||
#cmakedefine SDL_FILESYSTEM_HAIKU @SDL_FILESYSTEM_HAIKU@
|
|
||||||
#cmakedefine SDL_FILESYSTEM_COCOA @SDL_FILESYSTEM_COCOA@
|
|
||||||
#cmakedefine SDL_FILESYSTEM_DUMMY @SDL_FILESYSTEM_DUMMY@
|
|
||||||
#cmakedefine SDL_FILESYSTEM_UNIX @SDL_FILESYSTEM_UNIX@
|
|
||||||
#cmakedefine SDL_FILESYSTEM_WINDOWS @SDL_FILESYSTEM_WINDOWS@
|
|
||||||
#cmakedefine SDL_FILESYSTEM_EMSCRIPTEN @SDL_FILESYSTEM_EMSCRIPTEN@
|
|
||||||
|
|
||||||
/* Enable assembly routines */
|
|
||||||
#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@
|
|
||||||
#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@
|
|
||||||
|
|
||||||
/* Enable dynamic libsamplerate support */
|
|
||||||
#cmakedefine SDL_LIBSAMPLERATE_DYNAMIC @SDL_LIBSAMPLERATE_DYNAMIC@
|
|
||||||
|
|
||||||
/* Platform specific definitions */
|
|
||||||
#if !defined(__WIN32__)
|
|
||||||
# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
typedef signed char int8_t;
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
typedef signed short int16_t;
|
|
||||||
typedef unsigned short uint16_t;
|
|
||||||
typedef signed int int32_t;
|
|
||||||
typedef unsigned int uint32_t;
|
|
||||||
typedef signed long long int64_t;
|
|
||||||
typedef unsigned long long uint64_t;
|
|
||||||
typedef unsigned long uintptr_t;
|
|
||||||
# endif /* if (stdint.h isn't available) */
|
|
||||||
#else /* __WIN32__ */
|
|
||||||
# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H)
|
|
||||||
# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
# elif defined(_MSC_VER)
|
|
||||||
typedef signed __int8 int8_t;
|
|
||||||
typedef unsigned __int8 uint8_t;
|
|
||||||
typedef signed __int16 int16_t;
|
|
||||||
typedef unsigned __int16 uint16_t;
|
|
||||||
typedef signed __int32 int32_t;
|
|
||||||
typedef unsigned __int32 uint32_t;
|
|
||||||
typedef signed __int64 int64_t;
|
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
# ifndef _UINTPTR_T_DEFINED
|
|
||||||
# ifdef _WIN64
|
|
||||||
typedef unsigned __int64 uintptr_t;
|
|
||||||
# else
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
# endif
|
|
||||||
#define _UINTPTR_T_DEFINED
|
|
||||||
# endif
|
|
||||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
|
||||||
# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
|
||||||
#define DWORD_PTR DWORD
|
|
||||||
# endif
|
|
||||||
# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
|
||||||
#define LONG_PTR LONG
|
|
||||||
# endif
|
|
||||||
# else /* !__GNUC__ && !_MSC_VER */
|
|
||||||
typedef signed char int8_t;
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
typedef signed short int16_t;
|
|
||||||
typedef unsigned short uint16_t;
|
|
||||||
typedef signed int int32_t;
|
|
||||||
typedef unsigned int uint32_t;
|
|
||||||
typedef signed long long int64_t;
|
|
||||||
typedef unsigned long long uint64_t;
|
|
||||||
# ifndef _SIZE_T_DEFINED_
|
|
||||||
#define _SIZE_T_DEFINED_
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
# endif
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
# endif /* __GNUC__ || _MSC_VER */
|
|
||||||
# endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
|
||||||
#endif /* __WIN32__ */
|
|
||||||
|
|
||||||
#endif /* SDL_config_h_ */
|
|
||||||
-389
@@ -1,389 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_config.h.in
|
|
||||||
*
|
|
||||||
* This is a set of defines to configure the SDL features
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* General platform specific identifiers */
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/* Make sure that this isn't included by Visual C++ */
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
#error You should run hg revert SDL_config.h
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* C language features */
|
|
||||||
#undef const
|
|
||||||
#undef inline
|
|
||||||
#undef volatile
|
|
||||||
|
|
||||||
/* C datatypes */
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
#undef HAVE_GCC_ATOMICS
|
|
||||||
#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET
|
|
||||||
|
|
||||||
#undef HAVE_DDRAW_H
|
|
||||||
#undef HAVE_DINPUT_H
|
|
||||||
#undef HAVE_DSOUND_H
|
|
||||||
#undef HAVE_DXGI_H
|
|
||||||
#undef HAVE_XINPUT_H
|
|
||||||
#undef HAVE_XINPUT_GAMEPAD_EX
|
|
||||||
#undef HAVE_XINPUT_STATE_EX
|
|
||||||
|
|
||||||
/* Comment this if you want to build without any C library requirements */
|
|
||||||
#undef HAVE_LIBC
|
|
||||||
#if HAVE_LIBC
|
|
||||||
|
|
||||||
/* Useful headers */
|
|
||||||
#undef HAVE_ALLOCA_H
|
|
||||||
#undef HAVE_SYS_TYPES_H
|
|
||||||
#undef HAVE_STDIO_H
|
|
||||||
#undef STDC_HEADERS
|
|
||||||
#undef HAVE_STDLIB_H
|
|
||||||
#undef HAVE_STDARG_H
|
|
||||||
#undef HAVE_MALLOC_H
|
|
||||||
#undef HAVE_MEMORY_H
|
|
||||||
#undef HAVE_STRING_H
|
|
||||||
#undef HAVE_STRINGS_H
|
|
||||||
#undef HAVE_WCHAR_H
|
|
||||||
#undef HAVE_INTTYPES_H
|
|
||||||
#undef HAVE_STDINT_H
|
|
||||||
#undef HAVE_CTYPE_H
|
|
||||||
#undef HAVE_MATH_H
|
|
||||||
#undef HAVE_ICONV_H
|
|
||||||
#undef HAVE_SIGNAL_H
|
|
||||||
#undef HAVE_ALTIVEC_H
|
|
||||||
#undef HAVE_PTHREAD_NP_H
|
|
||||||
#undef HAVE_LIBUDEV_H
|
|
||||||
#undef HAVE_DBUS_DBUS_H
|
|
||||||
#undef HAVE_IBUS_IBUS_H
|
|
||||||
#undef HAVE_FCITX_FRONTEND_H
|
|
||||||
#undef HAVE_LIBSAMPLERATE_H
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#undef HAVE_MALLOC
|
|
||||||
#undef HAVE_CALLOC
|
|
||||||
#undef HAVE_REALLOC
|
|
||||||
#undef HAVE_FREE
|
|
||||||
#undef HAVE_ALLOCA
|
|
||||||
#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
|
|
||||||
#undef HAVE_GETENV
|
|
||||||
#undef HAVE_SETENV
|
|
||||||
#undef HAVE_PUTENV
|
|
||||||
#undef HAVE_UNSETENV
|
|
||||||
#endif
|
|
||||||
#undef HAVE_QSORT
|
|
||||||
#undef HAVE_ABS
|
|
||||||
#undef HAVE_BCOPY
|
|
||||||
#undef HAVE_MEMSET
|
|
||||||
#undef HAVE_MEMCPY
|
|
||||||
#undef HAVE_MEMMOVE
|
|
||||||
#undef HAVE_MEMCMP
|
|
||||||
#undef HAVE_WCSLEN
|
|
||||||
#undef HAVE_WCSLCPY
|
|
||||||
#undef HAVE_WCSLCAT
|
|
||||||
#undef HAVE_WCSCMP
|
|
||||||
#undef HAVE_STRLEN
|
|
||||||
#undef HAVE_STRLCPY
|
|
||||||
#undef HAVE_STRLCAT
|
|
||||||
#undef HAVE_STRDUP
|
|
||||||
#undef HAVE__STRREV
|
|
||||||
#undef HAVE__STRUPR
|
|
||||||
#undef HAVE__STRLWR
|
|
||||||
#undef HAVE_INDEX
|
|
||||||
#undef HAVE_RINDEX
|
|
||||||
#undef HAVE_STRCHR
|
|
||||||
#undef HAVE_STRRCHR
|
|
||||||
#undef HAVE_STRSTR
|
|
||||||
#undef HAVE_ITOA
|
|
||||||
#undef HAVE__LTOA
|
|
||||||
#undef HAVE__UITOA
|
|
||||||
#undef HAVE__ULTOA
|
|
||||||
#undef HAVE_STRTOL
|
|
||||||
#undef HAVE_STRTOUL
|
|
||||||
#undef HAVE__I64TOA
|
|
||||||
#undef HAVE__UI64TOA
|
|
||||||
#undef HAVE_STRTOLL
|
|
||||||
#undef HAVE_STRTOULL
|
|
||||||
#undef HAVE_STRTOD
|
|
||||||
#undef HAVE_ATOI
|
|
||||||
#undef HAVE_ATOF
|
|
||||||
#undef HAVE_STRCMP
|
|
||||||
#undef HAVE_STRNCMP
|
|
||||||
#undef HAVE__STRICMP
|
|
||||||
#undef HAVE_STRCASECMP
|
|
||||||
#undef HAVE__STRNICMP
|
|
||||||
#undef HAVE_STRNCASECMP
|
|
||||||
#undef HAVE_SSCANF
|
|
||||||
#undef HAVE_VSSCANF
|
|
||||||
#undef HAVE_SNPRINTF
|
|
||||||
#undef HAVE_VSNPRINTF
|
|
||||||
#undef HAVE_M_PI
|
|
||||||
#undef HAVE_ATAN
|
|
||||||
#undef HAVE_ATAN2
|
|
||||||
#undef HAVE_ACOS
|
|
||||||
#undef HAVE_ASIN
|
|
||||||
#undef HAVE_CEIL
|
|
||||||
#undef HAVE_COPYSIGN
|
|
||||||
#undef HAVE_COS
|
|
||||||
#undef HAVE_COSF
|
|
||||||
#undef HAVE_FABS
|
|
||||||
#undef HAVE_FLOOR
|
|
||||||
#undef HAVE_LOG
|
|
||||||
#undef HAVE_POW
|
|
||||||
#undef HAVE_SCALBN
|
|
||||||
#undef HAVE_SIN
|
|
||||||
#undef HAVE_SINF
|
|
||||||
#undef HAVE_SQRT
|
|
||||||
#undef HAVE_SQRTF
|
|
||||||
#undef HAVE_TAN
|
|
||||||
#undef HAVE_TANF
|
|
||||||
#undef HAVE_FOPEN64
|
|
||||||
#undef HAVE_FSEEKO
|
|
||||||
#undef HAVE_FSEEKO64
|
|
||||||
#undef HAVE_SIGACTION
|
|
||||||
#undef HAVE_SA_SIGACTION
|
|
||||||
#undef HAVE_SETJMP
|
|
||||||
#undef HAVE_NANOSLEEP
|
|
||||||
#undef HAVE_SYSCONF
|
|
||||||
#undef HAVE_SYSCTLBYNAME
|
|
||||||
#undef HAVE_CLOCK_GETTIME
|
|
||||||
#undef HAVE_GETPAGESIZE
|
|
||||||
#undef HAVE_MPROTECT
|
|
||||||
#undef HAVE_ICONV
|
|
||||||
#undef HAVE_PTHREAD_SETNAME_NP
|
|
||||||
#undef HAVE_PTHREAD_SET_NAME_NP
|
|
||||||
#undef HAVE_SEM_TIMEDWAIT
|
|
||||||
#undef HAVE_GETAUXVAL
|
|
||||||
#undef HAVE_POLL
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_STDDEF_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#endif /* HAVE_LIBC */
|
|
||||||
|
|
||||||
/* SDL internal assertion support */
|
|
||||||
#undef SDL_DEFAULT_ASSERT_LEVEL
|
|
||||||
|
|
||||||
/* Allow disabling of core subsystems */
|
|
||||||
#undef SDL_ATOMIC_DISABLED
|
|
||||||
#undef SDL_AUDIO_DISABLED
|
|
||||||
#undef SDL_CPUINFO_DISABLED
|
|
||||||
#undef SDL_EVENTS_DISABLED
|
|
||||||
#undef SDL_FILE_DISABLED
|
|
||||||
#undef SDL_JOYSTICK_DISABLED
|
|
||||||
#undef SDL_HAPTIC_DISABLED
|
|
||||||
#undef SDL_LOADSO_DISABLED
|
|
||||||
#undef SDL_RENDER_DISABLED
|
|
||||||
#undef SDL_THREADS_DISABLED
|
|
||||||
#undef SDL_TIMERS_DISABLED
|
|
||||||
#undef SDL_VIDEO_DISABLED
|
|
||||||
#undef SDL_POWER_DISABLED
|
|
||||||
#undef SDL_FILESYSTEM_DISABLED
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#undef SDL_AUDIO_DRIVER_ALSA
|
|
||||||
#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_ANDROID
|
|
||||||
#undef SDL_AUDIO_DRIVER_ARTS
|
|
||||||
#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_COREAUDIO
|
|
||||||
#undef SDL_AUDIO_DRIVER_DISK
|
|
||||||
#undef SDL_AUDIO_DRIVER_DSOUND
|
|
||||||
#undef SDL_AUDIO_DRIVER_DUMMY
|
|
||||||
#undef SDL_AUDIO_DRIVER_EMSCRIPTEN
|
|
||||||
#undef SDL_AUDIO_DRIVER_ESD
|
|
||||||
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_FUSIONSOUND
|
|
||||||
#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_HAIKU
|
|
||||||
#undef SDL_AUDIO_DRIVER_JACK
|
|
||||||
#undef SDL_AUDIO_DRIVER_JACK_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_NACL
|
|
||||||
#undef SDL_AUDIO_DRIVER_NAS
|
|
||||||
#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_NETBSD
|
|
||||||
#undef SDL_AUDIO_DRIVER_OSS
|
|
||||||
#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H
|
|
||||||
#undef SDL_AUDIO_DRIVER_PAUDIO
|
|
||||||
#undef SDL_AUDIO_DRIVER_PULSEAUDIO
|
|
||||||
#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_QSA
|
|
||||||
#undef SDL_AUDIO_DRIVER_SNDIO
|
|
||||||
#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC
|
|
||||||
#undef SDL_AUDIO_DRIVER_SUNAUDIO
|
|
||||||
#undef SDL_AUDIO_DRIVER_WASAPI
|
|
||||||
#undef SDL_AUDIO_DRIVER_WINMM
|
|
||||||
#undef SDL_AUDIO_DRIVER_XAUDIO2
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#undef SDL_INPUT_LINUXEV
|
|
||||||
#undef SDL_INPUT_LINUXKD
|
|
||||||
#undef SDL_INPUT_TSLIB
|
|
||||||
#undef SDL_JOYSTICK_HAIKU
|
|
||||||
#undef SDL_JOYSTICK_DINPUT
|
|
||||||
#undef SDL_JOYSTICK_XINPUT
|
|
||||||
#undef SDL_JOYSTICK_DUMMY
|
|
||||||
#undef SDL_JOYSTICK_IOKIT
|
|
||||||
#undef SDL_JOYSTICK_LINUX
|
|
||||||
#undef SDL_JOYSTICK_ANDROID
|
|
||||||
#undef SDL_JOYSTICK_WINMM
|
|
||||||
#undef SDL_JOYSTICK_USBHID
|
|
||||||
#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
|
|
||||||
#undef SDL_JOYSTICK_EMSCRIPTEN
|
|
||||||
#undef SDL_HAPTIC_DUMMY
|
|
||||||
#undef SDL_HAPTIC_LINUX
|
|
||||||
#undef SDL_HAPTIC_IOKIT
|
|
||||||
#undef SDL_HAPTIC_DINPUT
|
|
||||||
#undef SDL_HAPTIC_XINPUT
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#undef SDL_LOADSO_DLOPEN
|
|
||||||
#undef SDL_LOADSO_DUMMY
|
|
||||||
#undef SDL_LOADSO_LDG
|
|
||||||
#undef SDL_LOADSO_WINDOWS
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#undef SDL_THREAD_PTHREAD
|
|
||||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
|
|
||||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
|
|
||||||
#undef SDL_THREAD_WINDOWS
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#undef SDL_TIMER_HAIKU
|
|
||||||
#undef SDL_TIMER_DUMMY
|
|
||||||
#undef SDL_TIMER_UNIX
|
|
||||||
#undef SDL_TIMER_WINDOWS
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#undef SDL_VIDEO_DRIVER_HAIKU
|
|
||||||
#undef SDL_VIDEO_DRIVER_COCOA
|
|
||||||
#undef SDL_VIDEO_DRIVER_DIRECTFB
|
|
||||||
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
|
|
||||||
#undef SDL_VIDEO_DRIVER_DUMMY
|
|
||||||
#undef SDL_VIDEO_DRIVER_WINDOWS
|
|
||||||
#undef SDL_VIDEO_DRIVER_WAYLAND
|
|
||||||
#undef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
|
|
||||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC
|
|
||||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
|
|
||||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
|
|
||||||
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
|
|
||||||
#undef SDL_VIDEO_DRIVER_MIR
|
|
||||||
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC
|
|
||||||
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11
|
|
||||||
#undef SDL_VIDEO_DRIVER_RPI
|
|
||||||
#undef SDL_VIDEO_DRIVER_KMSDRM
|
|
||||||
#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC
|
|
||||||
#undef SDL_VIDEO_DRIVER_KMSDRM_DYNAMIC_GBM
|
|
||||||
#undef SDL_VIDEO_DRIVER_ANDROID
|
|
||||||
#undef SDL_VIDEO_DRIVER_EMSCRIPTEN
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XCURSOR
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XDBE
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XINERAMA
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XINPUT2
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XRANDR
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XSHAPE
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_XVIDMODE
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM
|
|
||||||
#undef SDL_VIDEO_DRIVER_NACL
|
|
||||||
#undef SDL_VIDEO_DRIVER_VIVANTE
|
|
||||||
#undef SDL_VIDEO_DRIVER_VIVANTE_VDK
|
|
||||||
#undef SDL_VIDEO_DRIVER_QNX
|
|
||||||
|
|
||||||
#undef SDL_VIDEO_RENDER_D3D
|
|
||||||
#undef SDL_VIDEO_RENDER_D3D11
|
|
||||||
#undef SDL_VIDEO_RENDER_OGL
|
|
||||||
#undef SDL_VIDEO_RENDER_OGL_ES
|
|
||||||
#undef SDL_VIDEO_RENDER_OGL_ES2
|
|
||||||
#undef SDL_VIDEO_RENDER_DIRECTFB
|
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
|
||||||
#undef SDL_VIDEO_OPENGL
|
|
||||||
#undef SDL_VIDEO_OPENGL_ES
|
|
||||||
#undef SDL_VIDEO_OPENGL_ES2
|
|
||||||
#undef SDL_VIDEO_OPENGL_BGL
|
|
||||||
#undef SDL_VIDEO_OPENGL_CGL
|
|
||||||
#undef SDL_VIDEO_OPENGL_EGL
|
|
||||||
#undef SDL_VIDEO_OPENGL_GLX
|
|
||||||
#undef SDL_VIDEO_OPENGL_WGL
|
|
||||||
#undef SDL_VIDEO_OPENGL_OSMESA
|
|
||||||
#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC
|
|
||||||
|
|
||||||
/* Enable Vulkan support */
|
|
||||||
#undef SDL_VIDEO_VULKAN
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#undef SDL_POWER_LINUX
|
|
||||||
#undef SDL_POWER_WINDOWS
|
|
||||||
#undef SDL_POWER_MACOSX
|
|
||||||
#undef SDL_POWER_HAIKU
|
|
||||||
#undef SDL_POWER_ANDROID
|
|
||||||
#undef SDL_POWER_EMSCRIPTEN
|
|
||||||
#undef SDL_POWER_HARDWIRED
|
|
||||||
|
|
||||||
/* Enable system filesystem support */
|
|
||||||
#undef SDL_FILESYSTEM_HAIKU
|
|
||||||
#undef SDL_FILESYSTEM_COCOA
|
|
||||||
#undef SDL_FILESYSTEM_DUMMY
|
|
||||||
#undef SDL_FILESYSTEM_UNIX
|
|
||||||
#undef SDL_FILESYSTEM_WINDOWS
|
|
||||||
#undef SDL_FILESYSTEM_NACL
|
|
||||||
#undef SDL_FILESYSTEM_ANDROID
|
|
||||||
#undef SDL_FILESYSTEM_EMSCRIPTEN
|
|
||||||
|
|
||||||
/* Enable assembly routines */
|
|
||||||
#undef SDL_ASSEMBLY_ROUTINES
|
|
||||||
#undef SDL_ALTIVEC_BLITTERS
|
|
||||||
|
|
||||||
/* Enable ime support */
|
|
||||||
#undef SDL_USE_IME
|
|
||||||
|
|
||||||
/* Enable dynamic udev support */
|
|
||||||
#undef SDL_UDEV_DYNAMIC
|
|
||||||
|
|
||||||
/* Enable dynamic libsamplerate support */
|
|
||||||
#undef SDL_LIBSAMPLERATE_DYNAMIC
|
|
||||||
|
|
||||||
#endif /* SDL_config_h_ */
|
|
||||||
-157
@@ -1,157 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_android_h_
|
|
||||||
#define SDL_config_android_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_config_android.h
|
|
||||||
*
|
|
||||||
* This is a configuration that can be used to build SDL for Android
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
#define HAVE_GCC_ATOMICS 1
|
|
||||||
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRLCPY 1
|
|
||||||
#define HAVE_STRLCAT 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
#define HAVE_SYSCONF 1
|
|
||||||
#define HAVE_CLOCK_GETTIME 1
|
|
||||||
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#define SDL_AUDIO_DRIVER_ANDROID 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#define SDL_JOYSTICK_ANDROID 1
|
|
||||||
#define SDL_HAPTIC_ANDROID 1
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_ANDROID 1
|
|
||||||
|
|
||||||
/* Enable OpenGL ES */
|
|
||||||
#define SDL_VIDEO_OPENGL_ES 1
|
|
||||||
#define SDL_VIDEO_OPENGL_ES2 1
|
|
||||||
#define SDL_VIDEO_OPENGL_EGL 1
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
|
||||||
|
|
||||||
/* Enable Vulkan support */
|
|
||||||
/* Android does not support Vulkan in native code using the "armeabi" ABI. */
|
|
||||||
#if defined(__ARM_ARCH) && __ARM_ARCH < 7
|
|
||||||
#define SDL_VIDEO_VULKAN 0
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_VULKAN 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_ANDROID 1
|
|
||||||
|
|
||||||
/* Enable the filesystem driver */
|
|
||||||
#define SDL_FILESYSTEM_ANDROID 1
|
|
||||||
|
|
||||||
#endif /* SDL_config_android_h_ */
|
|
||||||
-166
@@ -1,166 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_iphoneos_h_
|
|
||||||
#define SDL_config_iphoneos_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_GCC_ATOMICS 1
|
|
||||||
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRLCPY 1
|
|
||||||
#define HAVE_STRLCAT 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
#define HAVE_SYSCONF 1
|
|
||||||
#define HAVE_SYSCTLBYNAME 1
|
|
||||||
|
|
||||||
/* enable iPhone version of Core Audio driver */
|
|
||||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
|
||||||
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
|
|
||||||
#define SDL_HAPTIC_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable MFi joystick support */
|
|
||||||
#define SDL_JOYSTICK_MFI 1
|
|
||||||
|
|
||||||
/* Enable Unix style SO loading */
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
|
|
||||||
/* Supported video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_UIKIT 1
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* enable OpenGL ES */
|
|
||||||
#define SDL_VIDEO_OPENGL_ES2 1
|
|
||||||
#define SDL_VIDEO_OPENGL_ES 1
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
|
||||||
|
|
||||||
/* Enable Vulkan support */
|
|
||||||
#if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM // Only 64-bit devices have Metal
|
|
||||||
#define SDL_VIDEO_VULKAN 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_VULKAN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_UIKIT 1
|
|
||||||
|
|
||||||
/* enable iPhone keyboard support */
|
|
||||||
#define SDL_IPHONE_KEYBOARD 1
|
|
||||||
|
|
||||||
/* enable iOS extended launch screen */
|
|
||||||
#define SDL_IPHONE_LAUNCHSCREEN 1
|
|
||||||
|
|
||||||
/* Set max recognized G-force from accelerometer
|
|
||||||
See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed
|
|
||||||
*/
|
|
||||||
#define SDL_IPHONE_MAX_GFORCE 5.0
|
|
||||||
|
|
||||||
/* enable filesystem support */
|
|
||||||
#define SDL_FILESYSTEM_COCOA 1
|
|
||||||
|
|
||||||
#endif /* SDL_config_iphoneos_h_ */
|
|
||||||
-197
@@ -1,197 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_macosx_h_
|
|
||||||
#define SDL_config_macosx_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
|
|
||||||
#include <AvailabilityMacros.h>
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Useful headers */
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRLCPY 1
|
|
||||||
#define HAVE_STRLCAT 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
#define HAVE_SYSCONF 1
|
|
||||||
#define HAVE_SYSCTLBYNAME 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#define SDL_JOYSTICK_IOKIT 1
|
|
||||||
#define SDL_HAPTIC_IOKIT 1
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_COCOA 1
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XDBE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
|
|
||||||
|
|
||||||
#ifdef MAC_OS_X_VERSION_10_8
|
|
||||||
/*
|
|
||||||
* No matter the versions targeted, this is the 10.8 or later SDK, so you have
|
|
||||||
* to use the external Xquartz, which is a more modern Xlib. Previous SDKs
|
|
||||||
* used an older Xlib.
|
|
||||||
*/
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL
|
|
||||||
#define SDL_VIDEO_RENDER_OGL 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
|
||||||
#ifndef SDL_VIDEO_OPENGL
|
|
||||||
#define SDL_VIDEO_OPENGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_CGL
|
|
||||||
#define SDL_VIDEO_OPENGL_CGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_GLX
|
|
||||||
#define SDL_VIDEO_OPENGL_GLX 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable Vulkan support */
|
|
||||||
/* Metal/MoltenVK/Vulkan only supported on 64-bit architectures with 10.11+ */
|
|
||||||
#if TARGET_CPU_X86_64 && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101100)
|
|
||||||
#define SDL_VIDEO_VULKAN 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_VULKAN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_MACOSX 1
|
|
||||||
|
|
||||||
/* enable filesystem support */
|
|
||||||
#define SDL_FILESYSTEM_COCOA 1
|
|
||||||
|
|
||||||
/* Enable assembly routines */
|
|
||||||
#define SDL_ASSEMBLY_ROUTINES 1
|
|
||||||
#ifdef __ppc__
|
|
||||||
#define SDL_ALTIVEC_BLITTERS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_macosx_h_ */
|
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <[email protected]>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_macosx_h_
|
|
||||||
#define SDL_config_macosx_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */
|
|
||||||
#include <AvailabilityMacros.h>
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Useful headers */
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRLCPY 1
|
|
||||||
#define HAVE_STRLCAT 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
#define HAVE_SYSCONF 1
|
|
||||||
#define HAVE_SYSCTLBYNAME 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#define SDL_AUDIO_DRIVER_COREAUDIO 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#define SDL_JOYSTICK_IOKIT 1
|
|
||||||
#define SDL_HAPTIC_IOKIT 1
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_COCOA 1
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
#undef SDL_VIDEO_DRIVER_X11
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XDBE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XINERAMA 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XRANDR 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XSHAPE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
|
|
||||||
|
|
||||||
#ifdef MAC_OS_X_VERSION_10_8
|
|
||||||
/*
|
|
||||||
* No matter the versions targeted, this is the 10.8 or later SDK, so you have
|
|
||||||
* to use the external Xquartz, which is a more modern Xlib. Previous SDKs
|
|
||||||
* used an older Xlib.
|
|
||||||
*/
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL
|
|
||||||
#define SDL_VIDEO_RENDER_OGL 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
|
||||||
#ifndef SDL_VIDEO_OPENGL
|
|
||||||
#define SDL_VIDEO_OPENGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_CGL
|
|
||||||
#define SDL_VIDEO_OPENGL_CGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_GLX
|
|
||||||
#define SDL_VIDEO_OPENGL_GLX 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable Vulkan support */
|
|
||||||
/* Metal/MoltenVK/Vulkan only supported on 64-bit architectures and 10.11+ */
|
|
||||||
#if TARGET_CPU_X86_64
|
|
||||||
#define SDL_VIDEO_VULKAN 1
|
|
||||||
#else
|
|
||||||
#define SDL_VIDEO_VULKAN 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_MACOSX 1
|
|
||||||
|
|
||||||
/* enable filesystem support */
|
|
||||||
#define SDL_FILESYSTEM_COCOA 1
|
|
||||||
|
|
||||||
/* Enable assembly routines */
|
|
||||||
#define SDL_ASSEMBLY_ROUTINES 1
|
|
||||||
#ifdef __ppc__
|
|
||||||
#define SDL_ALTIVEC_BLITTERS 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_macosx_h_ */
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_minimal_h_
|
|
||||||
#define SDL_config_minimal_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \file SDL_config_minimal.h
|
|
||||||
*
|
|
||||||
* This is the minimal configuration that can be used to build SDL.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_STDDEF_H 1
|
|
||||||
|
|
||||||
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
|
||||||
/* Here are some reasonable defaults */
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
typedef signed char int8_t;
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
typedef signed short int16_t;
|
|
||||||
typedef unsigned short uint16_t;
|
|
||||||
typedef signed int int32_t;
|
|
||||||
typedef unsigned int uint32_t;
|
|
||||||
typedef signed long long int64_t;
|
|
||||||
typedef unsigned long long uint64_t;
|
|
||||||
typedef unsigned long uintptr_t;
|
|
||||||
#else
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#endif /* Visual Studio 2008 */
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */
|
|
||||||
#define SDL_JOYSTICK_DISABLED 1
|
|
||||||
|
|
||||||
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
|
|
||||||
#define SDL_HAPTIC_DISABLED 1
|
|
||||||
|
|
||||||
/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
|
|
||||||
#define SDL_LOADSO_DISABLED 1
|
|
||||||
|
|
||||||
/* Enable the stub thread support (src/thread/generic/\*.c) */
|
|
||||||
#define SDL_THREADS_DISABLED 1
|
|
||||||
|
|
||||||
/* Enable the stub timer support (src/timer/dummy/\*.c) */
|
|
||||||
#define SDL_TIMERS_DISABLED 1
|
|
||||||
|
|
||||||
/* Enable the dummy video driver (src/video/dummy/\*.c) */
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */
|
|
||||||
#define SDL_FILESYSTEM_DUMMY 1
|
|
||||||
|
|
||||||
#endif /* SDL_config_minimal_h_ */
|
|
||||||
-128
@@ -1,128 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_pandora_h_
|
|
||||||
#define SDL_config_pandora_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
/* General platform specific identifiers */
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
#ifdef __LP64__
|
|
||||||
#define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
#define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SDL_BYTEORDER 1234
|
|
||||||
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_MALLOC_H 1
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_ICONV_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
#define SDL_AUDIO_DRIVER_OSS 1
|
|
||||||
|
|
||||||
#define SDL_INPUT_LINUXEV 1
|
|
||||||
#define SDL_INPUT_TSLIB 1
|
|
||||||
#define SDL_JOYSTICK_LINUX 1
|
|
||||||
#define SDL_HAPTIC_LINUX 1
|
|
||||||
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
|
|
||||||
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
#define SDL_FILESYSTEM_UNIX 1
|
|
||||||
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
#define SDL_VIDEO_DRIVER_X11 1
|
|
||||||
#define SDL_VIDEO_DRIVER_PANDORA 1
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
|
||||||
#define SDL_VIDEO_OPENGL_ES 1
|
|
||||||
|
|
||||||
#endif /* SDL_config_pandora_h_ */
|
|
||||||
-144
@@ -1,144 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_psp_h_
|
|
||||||
#define SDL_config_psp_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_GCC_ATOMICS 1
|
|
||||||
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRLCPY 1
|
|
||||||
#define HAVE_STRLCAT 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
/* #define HAVE_SYSCONF 1 */
|
|
||||||
/* #define HAVE_SIGACTION 1 */
|
|
||||||
|
|
||||||
|
|
||||||
/* PSP isn't that sophisticated */
|
|
||||||
#define LACKS_SYS_MMAN_H 1
|
|
||||||
|
|
||||||
/* Enable the stub thread support (src/thread/psp/\*.c) */
|
|
||||||
#define SDL_THREAD_PSP 1
|
|
||||||
|
|
||||||
/* Enable the stub timer support (src/timer/psp/\*.c) */
|
|
||||||
#define SDL_TIMERS_PSP 1
|
|
||||||
|
|
||||||
/* Enable the stub joystick driver (src/joystick/psp/\*.c) */
|
|
||||||
#define SDL_JOYSTICK_PSP 1
|
|
||||||
|
|
||||||
/* Enable the stub audio driver (src/audio/psp/\*.c) */
|
|
||||||
#define SDL_AUDIO_DRIVER_PSP 1
|
|
||||||
|
|
||||||
/* PSP video dirver */
|
|
||||||
#define SDL_VIDEO_DRIVER_PSP 1
|
|
||||||
|
|
||||||
/* PSP render dirver */
|
|
||||||
#define SDL_VIDEO_RENDER_PSP 1
|
|
||||||
|
|
||||||
#define SDL_POWER_PSP 1
|
|
||||||
|
|
||||||
/* !!! FIXME: what does PSP do for filesystem stuff? */
|
|
||||||
#define SDL_FILESYSTEM_DUMMY 1
|
|
||||||
|
|
||||||
/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */
|
|
||||||
#define SDL_HAPTIC_DISABLED 1
|
|
||||||
|
|
||||||
/* PSP can't load shared object (src/loadso/dummy/\*.c) */
|
|
||||||
#define SDL_LOADSO_DISABLED 1
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* SDL_config_psp_h_ */
|
|
||||||
-225
@@ -1,225 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_windows_h_
|
|
||||||
#define SDL_config_windows_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
|
||||||
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
typedef signed __int8 int8_t;
|
|
||||||
typedef unsigned __int8 uint8_t;
|
|
||||||
typedef signed __int16 int16_t;
|
|
||||||
typedef unsigned __int16 uint16_t;
|
|
||||||
typedef signed __int32 int32_t;
|
|
||||||
typedef unsigned __int32 uint32_t;
|
|
||||||
typedef signed __int64 int64_t;
|
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
#ifndef _UINTPTR_T_DEFINED
|
|
||||||
#ifdef _WIN64
|
|
||||||
typedef unsigned __int64 uintptr_t;
|
|
||||||
#else
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
#endif
|
|
||||||
#define _UINTPTR_T_DEFINED
|
|
||||||
#endif
|
|
||||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
|
||||||
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
|
||||||
#define DWORD_PTR DWORD
|
|
||||||
#endif
|
|
||||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
|
||||||
#define LONG_PTR LONG
|
|
||||||
#endif
|
|
||||||
#else /* !__GNUC__ && !_MSC_VER */
|
|
||||||
typedef signed char int8_t;
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
typedef signed short int16_t;
|
|
||||||
typedef unsigned short uint16_t;
|
|
||||||
typedef signed int int32_t;
|
|
||||||
typedef unsigned int uint32_t;
|
|
||||||
typedef signed long long int64_t;
|
|
||||||
typedef unsigned long long uint64_t;
|
|
||||||
#ifndef _SIZE_T_DEFINED_
|
|
||||||
#define _SIZE_T_DEFINED_
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
#endif
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
#endif /* __GNUC__ || _MSC_VER */
|
|
||||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
# define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
# define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define HAVE_DDRAW_H 1
|
|
||||||
#define HAVE_DINPUT_H 1
|
|
||||||
#define HAVE_DSOUND_H 1
|
|
||||||
#define HAVE_DXGI_H 1
|
|
||||||
#define HAVE_XINPUT_H 1
|
|
||||||
|
|
||||||
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
|
|
||||||
#ifdef HAVE_LIBC
|
|
||||||
/* Useful headers */
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE__STRREV 1
|
|
||||||
#define HAVE__STRUPR 1
|
|
||||||
#define HAVE__STRLWR 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE__LTOA 1
|
|
||||||
#define HAVE__ULTOA 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE__STRICMP 1
|
|
||||||
#define HAVE__STRNICMP 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_ACOS 1
|
|
||||||
#define HAVE_ASIN 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#if _MSC_VER >= 1800
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#endif
|
|
||||||
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_STDDEF_H 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#define SDL_AUDIO_DRIVER_WASAPI 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DSOUND 1
|
|
||||||
#define SDL_AUDIO_DRIVER_XAUDIO2 0
|
|
||||||
#define SDL_AUDIO_DRIVER_WINMM 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#define SDL_JOYSTICK_DINPUT 1
|
|
||||||
#define SDL_JOYSTICK_XINPUT 1
|
|
||||||
#define SDL_HAPTIC_DINPUT 1
|
|
||||||
#define SDL_HAPTIC_XINPUT 1
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#define SDL_LOADSO_WINDOWS 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#define SDL_THREAD_WINDOWS 1
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_WINDOWS 1
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
#define SDL_VIDEO_DRIVER_WINDOWS 1
|
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_RENDER_D3D
|
|
||||||
#define SDL_VIDEO_RENDER_D3D 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_RENDER_D3D11
|
|
||||||
#define SDL_VIDEO_RENDER_D3D11 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable OpenGL support */
|
|
||||||
#ifndef SDL_VIDEO_OPENGL
|
|
||||||
#define SDL_VIDEO_OPENGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_WGL
|
|
||||||
#define SDL_VIDEO_OPENGL_WGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL
|
|
||||||
#define SDL_VIDEO_RENDER_OGL 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_RENDER_OGL_ES2
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_ES2
|
|
||||||
#define SDL_VIDEO_OPENGL_ES2 1
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_OPENGL_EGL
|
|
||||||
#define SDL_VIDEO_OPENGL_EGL 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable Vulkan support */
|
|
||||||
#define SDL_VIDEO_VULKAN 1
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_WINDOWS 1
|
|
||||||
|
|
||||||
/* Enable filesystem support */
|
|
||||||
#define SDL_FILESYSTEM_WINDOWS 1
|
|
||||||
|
|
||||||
/* Enable assembly routines (Win64 doesn't have inline asm) */
|
|
||||||
#ifndef _WIN64
|
|
||||||
#define SDL_ASSEMBLY_ROUTINES 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_windows_h_ */
|
|
||||||
-215
@@ -1,215 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_winrt_h_
|
|
||||||
#define SDL_config_winrt_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used
|
|
||||||
by SDL to determine which version of the Windows SDK is being used.
|
|
||||||
*/
|
|
||||||
#include <sdkddkver.h>
|
|
||||||
|
|
||||||
/* Define possibly-undefined NTDDI values (used when compiling SDL against
|
|
||||||
older versions of the Windows SDK.
|
|
||||||
*/
|
|
||||||
#ifndef NTDDI_WINBLUE
|
|
||||||
#define NTDDI_WINBLUE 0x06030000
|
|
||||||
#endif
|
|
||||||
#ifndef NTDDI_WIN10
|
|
||||||
#define NTDDI_WIN10 0x0A000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
|
|
||||||
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__)
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#elif defined(_MSC_VER)
|
|
||||||
typedef signed __int8 int8_t;
|
|
||||||
typedef unsigned __int8 uint8_t;
|
|
||||||
typedef signed __int16 int16_t;
|
|
||||||
typedef unsigned __int16 uint16_t;
|
|
||||||
typedef signed __int32 int32_t;
|
|
||||||
typedef unsigned __int32 uint32_t;
|
|
||||||
typedef signed __int64 int64_t;
|
|
||||||
typedef unsigned __int64 uint64_t;
|
|
||||||
#ifndef _UINTPTR_T_DEFINED
|
|
||||||
#ifdef _WIN64
|
|
||||||
typedef unsigned __int64 uintptr_t;
|
|
||||||
#else
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
#endif
|
|
||||||
#define _UINTPTR_T_DEFINED
|
|
||||||
#endif
|
|
||||||
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
|
|
||||||
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
|
|
||||||
#define DWORD_PTR DWORD
|
|
||||||
#endif
|
|
||||||
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
|
|
||||||
#define LONG_PTR LONG
|
|
||||||
#endif
|
|
||||||
#else /* !__GNUC__ && !_MSC_VER */
|
|
||||||
typedef signed char int8_t;
|
|
||||||
typedef unsigned char uint8_t;
|
|
||||||
typedef signed short int16_t;
|
|
||||||
typedef unsigned short uint16_t;
|
|
||||||
typedef signed int int32_t;
|
|
||||||
typedef unsigned int uint32_t;
|
|
||||||
typedef signed long long int64_t;
|
|
||||||
typedef unsigned long long uint64_t;
|
|
||||||
#ifndef _SIZE_T_DEFINED_
|
|
||||||
#define _SIZE_T_DEFINED_
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
#endif
|
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
#endif /* __GNUC__ || _MSC_VER */
|
|
||||||
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
|
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
# define SIZEOF_VOIDP 8
|
|
||||||
#else
|
|
||||||
# define SIZEOF_VOIDP 4
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Useful headers */
|
|
||||||
#define HAVE_DXGI_H 1
|
|
||||||
#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
|
|
||||||
#define HAVE_XINPUT_H 1
|
|
||||||
#endif
|
|
||||||
#define HAVE_LIBC 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_FLOAT_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
|
|
||||||
/* C library functions */
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_MEMCMP 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE__STRREV 1
|
|
||||||
#define HAVE__STRUPR 1
|
|
||||||
//#define HAVE__STRLWR 1 // TODO, WinRT: consider using _strlwr_s instead
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
//#define HAVE_ITOA 1 // TODO, WinRT: consider using _itoa_s instead
|
|
||||||
//#define HAVE__LTOA 1 // TODO, WinRT: consider using _ltoa_s instead
|
|
||||||
//#define HAVE__ULTOA 1 // TODO, WinRT: consider using _ultoa_s instead
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
//#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOD 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE__STRICMP 1
|
|
||||||
#define HAVE__STRNICMP 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
//#define HAVE_SSCANF 1 // TODO, WinRT: consider using sscanf_s instead
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_ATAN 1
|
|
||||||
#define HAVE_ATAN2 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE__COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
//#define HAVE_SCALBN 1
|
|
||||||
#define HAVE__SCALB 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE__FSEEKI64 1
|
|
||||||
|
|
||||||
/* Enable various audio drivers */
|
|
||||||
#define SDL_AUDIO_DRIVER_XAUDIO2 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DISK 1
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable various input drivers */
|
|
||||||
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
|
||||||
#define SDL_JOYSTICK_DISABLED 1
|
|
||||||
#define SDL_HAPTIC_DISABLED 1
|
|
||||||
#else
|
|
||||||
#define SDL_JOYSTICK_XINPUT 1
|
|
||||||
#define SDL_HAPTIC_XINPUT 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable various shared object loading systems */
|
|
||||||
#define SDL_LOADSO_WINDOWS 1
|
|
||||||
|
|
||||||
/* Enable various threading systems */
|
|
||||||
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
|
|
||||||
#define SDL_THREAD_WINDOWS 1
|
|
||||||
#else
|
|
||||||
/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */
|
|
||||||
#define SDL_THREAD_STDCPP 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable various timer systems */
|
|
||||||
#define SDL_TIMER_WINDOWS 1
|
|
||||||
|
|
||||||
/* Enable various video drivers */
|
|
||||||
#define SDL_VIDEO_DRIVER_WINRT 1
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
|
|
||||||
/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */
|
|
||||||
#define SDL_VIDEO_OPENGL_ES2 1
|
|
||||||
#define SDL_VIDEO_OPENGL_EGL 1
|
|
||||||
|
|
||||||
/* Enable appropriate renderer(s) */
|
|
||||||
#define SDL_VIDEO_RENDER_D3D11 1
|
|
||||||
|
|
||||||
#if SDL_VIDEO_OPENGL_ES2
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES2 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable system power support */
|
|
||||||
#define SDL_POWER_WINRT 1
|
|
||||||
|
|
||||||
/* Enable assembly routines (Win64 doesn't have inline asm) */
|
|
||||||
#ifndef _WIN64
|
|
||||||
#define SDL_ASSEMBLY_ROUTINES 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* SDL_config_winrt_h_ */
|
|
||||||
-121
@@ -1,121 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SDL_config_wiz_h_
|
|
||||||
#define SDL_config_wiz_h_
|
|
||||||
#define SDL_config_h_
|
|
||||||
|
|
||||||
/* This is a set of defines to configure the SDL features */
|
|
||||||
|
|
||||||
/* General platform specific identifiers */
|
|
||||||
#include "SDL_platform.h"
|
|
||||||
|
|
||||||
#define SDL_BYTEORDER 1234
|
|
||||||
|
|
||||||
#define HAVE_ALLOCA_H 1
|
|
||||||
#define HAVE_SYS_TYPES_H 1
|
|
||||||
#define HAVE_STDIO_H 1
|
|
||||||
#define STDC_HEADERS 1
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
#define HAVE_STDARG_H 1
|
|
||||||
#define HAVE_MALLOC_H 1
|
|
||||||
#define HAVE_MEMORY_H 1
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
#define HAVE_STRINGS_H 1
|
|
||||||
#define HAVE_INTTYPES_H 1
|
|
||||||
#define HAVE_STDINT_H 1
|
|
||||||
#define HAVE_CTYPE_H 1
|
|
||||||
#define HAVE_MATH_H 1
|
|
||||||
#define HAVE_ICONV_H 1
|
|
||||||
#define HAVE_SIGNAL_H 1
|
|
||||||
#define HAVE_MALLOC 1
|
|
||||||
#define HAVE_CALLOC 1
|
|
||||||
#define HAVE_REALLOC 1
|
|
||||||
#define HAVE_FREE 1
|
|
||||||
#define HAVE_ALLOCA 1
|
|
||||||
#define HAVE_GETENV 1
|
|
||||||
#define HAVE_SETENV 1
|
|
||||||
#define HAVE_PUTENV 1
|
|
||||||
#define HAVE_UNSETENV 1
|
|
||||||
#define HAVE_QSORT 1
|
|
||||||
#define HAVE_ABS 1
|
|
||||||
#define HAVE_BCOPY 1
|
|
||||||
#define HAVE_MEMSET 1
|
|
||||||
#define HAVE_MEMCPY 1
|
|
||||||
#define HAVE_MEMMOVE 1
|
|
||||||
#define HAVE_STRLEN 1
|
|
||||||
#define HAVE_STRDUP 1
|
|
||||||
#define HAVE_STRCHR 1
|
|
||||||
#define HAVE_STRRCHR 1
|
|
||||||
#define HAVE_STRSTR 1
|
|
||||||
#define HAVE_STRTOL 1
|
|
||||||
#define HAVE_STRTOUL 1
|
|
||||||
#define HAVE_STRTOLL 1
|
|
||||||
#define HAVE_STRTOULL 1
|
|
||||||
#define HAVE_ATOI 1
|
|
||||||
#define HAVE_ATOF 1
|
|
||||||
#define HAVE_STRCMP 1
|
|
||||||
#define HAVE_STRNCMP 1
|
|
||||||
#define HAVE_STRCASECMP 1
|
|
||||||
#define HAVE_STRNCASECMP 1
|
|
||||||
#define HAVE_VSSCANF 1
|
|
||||||
#define HAVE_VSNPRINTF 1
|
|
||||||
#define HAVE_M_PI 1
|
|
||||||
#define HAVE_CEIL 1
|
|
||||||
#define HAVE_COPYSIGN 1
|
|
||||||
#define HAVE_COS 1
|
|
||||||
#define HAVE_COSF 1
|
|
||||||
#define HAVE_FABS 1
|
|
||||||
#define HAVE_FLOOR 1
|
|
||||||
#define HAVE_LOG 1
|
|
||||||
#define HAVE_SCALBN 1
|
|
||||||
#define HAVE_SIN 1
|
|
||||||
#define HAVE_SINF 1
|
|
||||||
#define HAVE_SQRT 1
|
|
||||||
#define HAVE_SQRTF 1
|
|
||||||
#define HAVE_TAN 1
|
|
||||||
#define HAVE_TANF 1
|
|
||||||
#define HAVE_SIGACTION 1
|
|
||||||
#define HAVE_SETJMP 1
|
|
||||||
#define HAVE_NANOSLEEP 1
|
|
||||||
#define HAVE_POW 1
|
|
||||||
|
|
||||||
#define SDL_AUDIO_DRIVER_DUMMY 1
|
|
||||||
#define SDL_AUDIO_DRIVER_OSS 1
|
|
||||||
|
|
||||||
#define SDL_INPUT_LINUXEV 1
|
|
||||||
#define SDL_INPUT_TSLIB 1
|
|
||||||
#define SDL_JOYSTICK_LINUX 1
|
|
||||||
#define SDL_HAPTIC_LINUX 1
|
|
||||||
|
|
||||||
#define SDL_LOADSO_DLOPEN 1
|
|
||||||
|
|
||||||
#define SDL_THREAD_PTHREAD 1
|
|
||||||
#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1
|
|
||||||
|
|
||||||
#define SDL_TIMER_UNIX 1
|
|
||||||
|
|
||||||
#define SDL_VIDEO_DRIVER_DUMMY 1
|
|
||||||
#define SDL_VIDEO_DRIVER_PANDORA 1
|
|
||||||
#define SDL_VIDEO_RENDER_OGL_ES 1
|
|
||||||
#define SDL_VIDEO_OPENGL_ES 1
|
|
||||||
|
|
||||||
#endif /* SDL_config_wiz_h_ */
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
/*
|
|
||||||
Simple DirectMedia Layer
|
|
||||||
Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
|
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
|
||||||
warranty. In no event will the authors be held liable for any damages
|
|
||||||
arising from the use of this software.
|
|
||||||
|
|
||||||
Permission is granted to anyone to use this software for any purpose,
|
|
||||||
including commercial applications, and to alter it and redistribute it
|
|
||||||
freely, subject to the following restrictions:
|
|
||||||
|
|
||||||
1. The origin of this software must not be misrepresented; you must not
|
|
||||||
claim that you wrote the original software. If you use this software
|
|
||||||
in a product, an acknowledgment in the product documentation would be
|
|
||||||
appreciated but is not required.
|
|
||||||
2. Altered source versions must be plainly marked as such, and must not be
|
|
||||||
misrepresented as being the original software.
|
|
||||||
3. This notice may not be removed or altered from any source distribution.
|
|
||||||
*/
|
|
||||||
+40
-5
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -79,7 +79,7 @@ _m_prefetch(void *__P)
|
|||||||
#if !defined(SDL_DISABLE_ARM_NEON_H)
|
#if !defined(SDL_DISABLE_ARM_NEON_H)
|
||||||
# if defined(__ARM_NEON)
|
# if defined(__ARM_NEON)
|
||||||
# include <arm_neon.h>
|
# include <arm_neon.h>
|
||||||
# elif defined(__WINDOWS__) || defined(__WINRT__)
|
# elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
|
||||||
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
|
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
|
||||||
# if defined(_M_ARM)
|
# if defined(_M_ARM)
|
||||||
# include <armintr.h>
|
# include <armintr.h>
|
||||||
@@ -90,6 +90,7 @@ _m_prefetch(void *__P)
|
|||||||
# include <arm64intr.h>
|
# include <arm64intr.h>
|
||||||
# include <arm64_neon.h>
|
# include <arm64_neon.h>
|
||||||
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
|
||||||
|
# define __ARM_ARCH 8
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@@ -98,6 +99,14 @@ _m_prefetch(void *__P)
|
|||||||
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
|
||||||
#include <mm3dnow.h>
|
#include <mm3dnow.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H)
|
||||||
|
#include <lsxintrin.h>
|
||||||
|
#define __LSX__
|
||||||
|
#endif
|
||||||
|
#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H)
|
||||||
|
#include <lasxintrin.h>
|
||||||
|
#define __LASX__
|
||||||
|
#endif
|
||||||
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
#else
|
#else
|
||||||
@@ -433,10 +442,36 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
||||||
|
* sets.
|
||||||
|
*
|
||||||
|
* \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if
|
||||||
|
* not.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
|
||||||
|
*
|
||||||
|
* This always returns false on CPUs that aren't using LOONGARCH instruction
|
||||||
|
* sets.
|
||||||
|
*
|
||||||
|
* \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if
|
||||||
|
* not.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the amount of RAM configured in the system.
|
* Get the amount of RAM configured in the system.
|
||||||
*
|
*
|
||||||
* \returns the amount of RAM configured in the system in MB.
|
* \returns the amount of RAM configured in the system in MiB.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.1.
|
* \since This function is available since SDL 2.0.1.
|
||||||
*/
|
*/
|
||||||
@@ -494,7 +529,7 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.10.
|
* \since This function is available since SDL 2.0.10.
|
||||||
*
|
*
|
||||||
* \sa SDL_SIMDAlignment
|
* \sa SDL_SIMDGetAlignment
|
||||||
* \sa SDL_SIMDRealloc
|
* \sa SDL_SIMDRealloc
|
||||||
* \sa SDL_SIMDFree
|
* \sa SDL_SIMDFree
|
||||||
*/
|
*/
|
||||||
@@ -518,7 +553,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.14.
|
* \since This function is available since SDL 2.0.14.
|
||||||
*
|
*
|
||||||
* \sa SDL_SIMDAlignment
|
* \sa SDL_SIMDGetAlignment
|
||||||
* \sa SDL_SIMDAlloc
|
* \sa SDL_SIMDAlloc
|
||||||
* \sa SDL_SIMDFree
|
* \sa SDL_SIMDFree
|
||||||
*/
|
*/
|
||||||
|
|||||||
+60
-10
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -192,6 +192,20 @@ typedef int64_t khronos_int64_t;
|
|||||||
typedef uint64_t khronos_uint64_t;
|
typedef uint64_t khronos_uint64_t;
|
||||||
#define KHRONOS_SUPPORT_INT64 1
|
#define KHRONOS_SUPPORT_INT64 1
|
||||||
#define KHRONOS_SUPPORT_FLOAT 1
|
#define KHRONOS_SUPPORT_FLOAT 1
|
||||||
|
/*
|
||||||
|
* To support platform where unsigned long cannot be used interchangeably with
|
||||||
|
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||||
|
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||||
|
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||||
|
* unsigned long long or similar (this results in different C++ name mangling).
|
||||||
|
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||||
|
* platforms where the size of a pointer is larger than the size of long.
|
||||||
|
*/
|
||||||
|
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||||
|
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||||
|
#define KHRONOS_USE_INTPTR_T
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif defined(__VMS ) || defined(__sgi)
|
#elif defined(__VMS ) || defined(__sgi)
|
||||||
|
|
||||||
@@ -274,14 +288,21 @@ typedef unsigned short int khronos_uint16_t;
|
|||||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||||
* to be the only LLP64 architecture in current use.
|
* to be the only LLP64 architecture in current use.
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN64
|
#ifdef KHRONOS_USE_INTPTR_T
|
||||||
|
typedef intptr_t khronos_intptr_t;
|
||||||
|
typedef uintptr_t khronos_uintptr_t;
|
||||||
|
#elif defined(_WIN64)
|
||||||
typedef signed long long int khronos_intptr_t;
|
typedef signed long long int khronos_intptr_t;
|
||||||
typedef unsigned long long int khronos_uintptr_t;
|
typedef unsigned long long int khronos_uintptr_t;
|
||||||
typedef signed long long int khronos_ssize_t;
|
|
||||||
typedef unsigned long long int khronos_usize_t;
|
|
||||||
#else
|
#else
|
||||||
typedef signed long int khronos_intptr_t;
|
typedef signed long int khronos_intptr_t;
|
||||||
typedef unsigned long int khronos_uintptr_t;
|
typedef unsigned long int khronos_uintptr_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN64)
|
||||||
|
typedef signed long long int khronos_ssize_t;
|
||||||
|
typedef unsigned long long int khronos_usize_t;
|
||||||
|
#else
|
||||||
typedef signed long int khronos_ssize_t;
|
typedef signed long int khronos_ssize_t;
|
||||||
typedef unsigned long int khronos_usize_t;
|
typedef unsigned long int khronos_usize_t;
|
||||||
#endif
|
#endif
|
||||||
@@ -516,7 +537,7 @@ extern "C" {
|
|||||||
** used to make the header, and the header can be found at
|
** used to make the header, and the header can be found at
|
||||||
** http://www.khronos.org/registry/egl
|
** http://www.khronos.org/registry/egl
|
||||||
**
|
**
|
||||||
** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
|
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*#include <EGL/eglplatform.h>*/
|
/*#include <EGL/eglplatform.h>*/
|
||||||
@@ -525,7 +546,7 @@ extern "C" {
|
|||||||
#define EGL_EGL_PROTOTYPES 1
|
#define EGL_EGL_PROTOTYPES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Generated on date 20210901 */
|
/* Generated on date 20220525 */
|
||||||
|
|
||||||
/* Generated C header for:
|
/* Generated C header for:
|
||||||
* API: egl
|
* API: egl
|
||||||
@@ -860,12 +881,12 @@ extern "C" {
|
|||||||
** used to make the header, and the header can be found at
|
** used to make the header, and the header can be found at
|
||||||
** http://www.khronos.org/registry/egl
|
** http://www.khronos.org/registry/egl
|
||||||
**
|
**
|
||||||
** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
|
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*#include <EGL/eglplatform.h>*/
|
/*#include <EGL/eglplatform.h>*/
|
||||||
|
|
||||||
#define EGL_EGLEXT_VERSION 20210901
|
#define EGL_EGLEXT_VERSION 20220525
|
||||||
|
|
||||||
/* Generated C header for:
|
/* Generated C header for:
|
||||||
* API: egl
|
* API: egl
|
||||||
@@ -1569,6 +1590,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLi
|
|||||||
#define EGL_RENDERER_EXT 0x335F
|
#define EGL_RENDERER_EXT 0x335F
|
||||||
#endif /* EGL_EXT_device_query_name */
|
#endif /* EGL_EXT_device_query_name */
|
||||||
|
|
||||||
|
#ifndef EGL_EXT_explicit_device
|
||||||
|
#define EGL_EXT_explicit_device 1
|
||||||
|
#endif /* EGL_EXT_explicit_device */
|
||||||
|
|
||||||
#ifndef EGL_EXT_gl_colorspace_bt2020_linear
|
#ifndef EGL_EXT_gl_colorspace_bt2020_linear
|
||||||
#define EGL_EXT_gl_colorspace_bt2020_linear 1
|
#define EGL_EXT_gl_colorspace_bt2020_linear 1
|
||||||
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
|
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
|
||||||
@@ -1794,6 +1819,31 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr
|
|||||||
#define EGL_METADATA_SCALING_EXT 50000
|
#define EGL_METADATA_SCALING_EXT 50000
|
||||||
#endif /* EGL_EXT_surface_SMPTE2086_metadata */
|
#endif /* EGL_EXT_surface_SMPTE2086_metadata */
|
||||||
|
|
||||||
|
#ifndef EGL_EXT_surface_compression
|
||||||
|
#define EGL_EXT_surface_compression 1
|
||||||
|
#define EGL_SURFACE_COMPRESSION_EXT 0x34B0
|
||||||
|
#define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E
|
||||||
|
#define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE
|
||||||
|
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF
|
||||||
|
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
|
||||||
|
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||||
|
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
|
||||||
|
#endif
|
||||||
|
#endif /* EGL_EXT_surface_compression */
|
||||||
|
|
||||||
#ifndef EGL_EXT_swap_buffers_with_damage
|
#ifndef EGL_EXT_swap_buffers_with_damage
|
||||||
#define EGL_EXT_swap_buffers_with_damage 1
|
#define EGL_EXT_swap_buffers_with_damage 1
|
||||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
|
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
|
||||||
@@ -2028,12 +2078,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
|
|||||||
#define EGL_STREAM_IMAGE_ADD_NV 0x3374
|
#define EGL_STREAM_IMAGE_ADD_NV 0x3374
|
||||||
#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
|
#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
|
||||||
#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
|
#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
|
||||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
|
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
|
||||||
typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
|
typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
|
||||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
|
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
|
||||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
|
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
|
||||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
|
EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
|
||||||
EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
|
EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
|
||||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
|
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
|
||||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
|
EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
|
||||||
|
|||||||
+38
-7
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||||
_m_prefetch(void *__P)
|
_m_prefetch(void *__P)
|
||||||
{
|
{
|
||||||
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
|
__builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */);
|
||||||
}
|
}
|
||||||
#endif /* __PRFCHWINTRIN_H */
|
#endif /* __PRFCHWINTRIN_H */
|
||||||
#endif /* __clang__ */
|
#endif /* __clang__ */
|
||||||
@@ -59,17 +59,26 @@ _m_prefetch(void *__P)
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#define SDL_BYTEORDER __BYTE_ORDER
|
#define SDL_BYTEORDER __BYTE_ORDER
|
||||||
#elif defined(__OpenBSD__)
|
#elif defined(__OpenBSD__) || defined(__DragonFly__)
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#define SDL_BYTEORDER BYTE_ORDER
|
#define SDL_BYTEORDER BYTE_ORDER
|
||||||
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
||||||
#include <sys/endian.h>
|
#include <sys/endian.h>
|
||||||
#define SDL_BYTEORDER BYTE_ORDER
|
#define SDL_BYTEORDER BYTE_ORDER
|
||||||
|
/* predefs from newer gcc and clang versions: */
|
||||||
|
#elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__)
|
||||||
|
#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||||
|
#define SDL_BYTEORDER SDL_LIL_ENDIAN
|
||||||
|
#elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||||
|
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
#error Unsupported endianness
|
||||||
|
#endif /**/
|
||||||
#else
|
#else
|
||||||
#if defined(__hppa__) || \
|
#if defined(__hppa__) || \
|
||||||
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
|
||||||
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
(defined(__MIPS__) && defined(__MIPSEB__)) || \
|
||||||
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
|
defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
|
||||||
defined(__sparc__)
|
defined(__sparc__)
|
||||||
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
#define SDL_BYTEORDER SDL_BIG_ENDIAN
|
||||||
#else
|
#else
|
||||||
@@ -78,6 +87,28 @@ _m_prefetch(void *__P)
|
|||||||
#endif /* __linux__ */
|
#endif /* __linux__ */
|
||||||
#endif /* !SDL_BYTEORDER */
|
#endif /* !SDL_BYTEORDER */
|
||||||
|
|
||||||
|
#ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */
|
||||||
|
/* predefs from newer gcc versions: */
|
||||||
|
#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
|
||||||
|
#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||||
|
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
||||||
|
#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||||||
|
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
#error Unsupported endianness
|
||||||
|
#endif /**/
|
||||||
|
#elif defined(__MAVERICK__)
|
||||||
|
/* For Maverick, float words are always little-endian. */
|
||||||
|
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
|
||||||
|
#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
|
||||||
|
/* For FPA, float words are always big-endian. */
|
||||||
|
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
|
||||||
|
#else
|
||||||
|
/* By default, assume that floats words follow the memory system mode. */
|
||||||
|
#define SDL_FLOATWORDORDER SDL_BYTEORDER
|
||||||
|
#endif /* __FLOAT_WORD_ORDER__ */
|
||||||
|
#endif /* !SDL_FLOATWORDORDER */
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
@@ -109,7 +140,7 @@ extern "C" {
|
|||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP16
|
#if HAS_BUILTIN_BSWAP16
|
||||||
#define SDL_Swap16(x) __builtin_bswap16(x)
|
#define SDL_Swap16(x) __builtin_bswap16(x)
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
||||||
#pragma intrinsic(_byteswap_ushort)
|
#pragma intrinsic(_byteswap_ushort)
|
||||||
#define SDL_Swap16(x) _byteswap_ushort(x)
|
#define SDL_Swap16(x) _byteswap_ushort(x)
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||||
@@ -158,7 +189,7 @@ SDL_Swap16(Uint16 x)
|
|||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP32
|
#if HAS_BUILTIN_BSWAP32
|
||||||
#define SDL_Swap32(x) __builtin_bswap32(x)
|
#define SDL_Swap32(x) __builtin_bswap32(x)
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
||||||
#pragma intrinsic(_byteswap_ulong)
|
#pragma intrinsic(_byteswap_ulong)
|
||||||
#define SDL_Swap32(x) _byteswap_ulong(x)
|
#define SDL_Swap32(x) _byteswap_ulong(x)
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||||
@@ -210,7 +241,7 @@ SDL_Swap32(Uint32 x)
|
|||||||
|
|
||||||
#if HAS_BUILTIN_BSWAP64
|
#if HAS_BUILTIN_BSWAP64
|
||||||
#define SDL_Swap64(x) __builtin_bswap64(x)
|
#define SDL_Swap64(x) __builtin_bswap64(x)
|
||||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
|
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
|
||||||
#pragma intrinsic(_byteswap_uint64)
|
#pragma intrinsic(_byteswap_uint64)
|
||||||
#define SDL_Swap64(x) _byteswap_uint64(x)
|
#define SDL_Swap64(x) _byteswap_uint64(x)
|
||||||
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+33
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -102,6 +102,7 @@ typedef enum
|
|||||||
SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
|
SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
|
||||||
input language or keyboard layout change.
|
input language or keyboard layout change.
|
||||||
*/
|
*/
|
||||||
|
SDL_TEXTEDITING_EXT, /**< Extended keyboard text editing (composition) */
|
||||||
|
|
||||||
/* Mouse events */
|
/* Mouse events */
|
||||||
SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
|
SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
|
||||||
@@ -117,6 +118,7 @@ typedef enum
|
|||||||
SDL_JOYBUTTONUP, /**< Joystick button released */
|
SDL_JOYBUTTONUP, /**< Joystick button released */
|
||||||
SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
|
SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
|
||||||
SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
|
SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
|
||||||
|
SDL_JOYBATTERYUPDATED, /**< Joystick battery level change */
|
||||||
|
|
||||||
/* Game controller events */
|
/* Game controller events */
|
||||||
SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
|
SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
|
||||||
@@ -141,7 +143,7 @@ typedef enum
|
|||||||
SDL_MULTIGESTURE,
|
SDL_MULTIGESTURE,
|
||||||
|
|
||||||
/* Clipboard events */
|
/* Clipboard events */
|
||||||
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
|
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard or primary selection changed */
|
||||||
|
|
||||||
/* Drag and drop events */
|
/* Drag and drop events */
|
||||||
SDL_DROPFILE = 0x1000, /**< The system requests a file open */
|
SDL_DROPFILE = 0x1000, /**< The system requests a file open */
|
||||||
@@ -243,6 +245,19 @@ typedef struct SDL_TextEditingEvent
|
|||||||
Sint32 length; /**< The length of selected editing text */
|
Sint32 length; /**< The length of selected editing text */
|
||||||
} SDL_TextEditingEvent;
|
} SDL_TextEditingEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Extended keyboard text editing event structure (event.editExt.*) when text would be
|
||||||
|
* truncated if stored in the text buffer SDL_TextEditingEvent
|
||||||
|
*/
|
||||||
|
typedef struct SDL_TextEditingExtEvent
|
||||||
|
{
|
||||||
|
Uint32 type; /**< ::SDL_TEXTEDITING_EXT */
|
||||||
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
|
Uint32 windowID; /**< The window with keyboard focus, if any */
|
||||||
|
char* text; /**< The editing text, which should be freed with SDL_free(), and will not be NULL */
|
||||||
|
Sint32 start; /**< The start cursor of selected editing text */
|
||||||
|
Sint32 length; /**< The length of selected editing text */
|
||||||
|
} SDL_TextEditingExtEvent;
|
||||||
|
|
||||||
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
|
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
|
||||||
/**
|
/**
|
||||||
@@ -303,6 +318,8 @@ typedef struct SDL_MouseWheelEvent
|
|||||||
Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
|
||||||
float preciseX; /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
|
float preciseX; /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
|
||||||
float preciseY; /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
|
float preciseY; /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
|
||||||
|
Sint32 mouseX; /**< X coordinate, relative to window (added in 2.26.0) */
|
||||||
|
Sint32 mouseY; /**< Y coordinate, relative to window (added in 2.26.0) */
|
||||||
} SDL_MouseWheelEvent;
|
} SDL_MouseWheelEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -381,6 +398,16 @@ typedef struct SDL_JoyDeviceEvent
|
|||||||
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
|
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
|
||||||
} SDL_JoyDeviceEvent;
|
} SDL_JoyDeviceEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Joysick battery level change event structure (event.jbattery.*)
|
||||||
|
*/
|
||||||
|
typedef struct SDL_JoyBatteryEvent
|
||||||
|
{
|
||||||
|
Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */
|
||||||
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
|
SDL_JoystickPowerLevel level; /**< The joystick battery level */
|
||||||
|
} SDL_JoyBatteryEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Game controller axis motion event structure (event.caxis.*)
|
* \brief Game controller axis motion event structure (event.caxis.*)
|
||||||
@@ -449,6 +476,7 @@ typedef struct SDL_ControllerSensorEvent
|
|||||||
SDL_JoystickID which; /**< The joystick instance id */
|
SDL_JoystickID which; /**< The joystick instance id */
|
||||||
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
|
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
|
||||||
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
|
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
|
||||||
|
Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
|
||||||
} SDL_ControllerSensorEvent;
|
} SDL_ControllerSensorEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -540,6 +568,7 @@ typedef struct SDL_SensorEvent
|
|||||||
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
|
||||||
Sint32 which; /**< The instance ID of the sensor */
|
Sint32 which; /**< The instance ID of the sensor */
|
||||||
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
|
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
|
||||||
|
Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
|
||||||
} SDL_SensorEvent;
|
} SDL_SensorEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -601,6 +630,7 @@ typedef union SDL_Event
|
|||||||
SDL_WindowEvent window; /**< Window event data */
|
SDL_WindowEvent window; /**< Window event data */
|
||||||
SDL_KeyboardEvent key; /**< Keyboard event data */
|
SDL_KeyboardEvent key; /**< Keyboard event data */
|
||||||
SDL_TextEditingEvent edit; /**< Text editing event data */
|
SDL_TextEditingEvent edit; /**< Text editing event data */
|
||||||
|
SDL_TextEditingExtEvent editExt; /**< Extended text editing event data */
|
||||||
SDL_TextInputEvent text; /**< Text input event data */
|
SDL_TextInputEvent text; /**< Text input event data */
|
||||||
SDL_MouseMotionEvent motion; /**< Mouse motion event data */
|
SDL_MouseMotionEvent motion; /**< Mouse motion event data */
|
||||||
SDL_MouseButtonEvent button; /**< Mouse button event data */
|
SDL_MouseButtonEvent button; /**< Mouse button event data */
|
||||||
@@ -610,6 +640,7 @@ typedef union SDL_Event
|
|||||||
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
|
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
|
||||||
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
|
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
|
||||||
SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
|
SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
|
||||||
|
SDL_JoyBatteryEvent jbattery; /**< Joystick battery event data */
|
||||||
SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
|
SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
|
||||||
SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
|
SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
|
||||||
SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
|
SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
|
||||||
|
|||||||
+6
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -60,6 +60,10 @@ extern "C" {
|
|||||||
* - `parent`: the containing directory of the bundle. For example:
|
* - `parent`: the containing directory of the bundle. For example:
|
||||||
* `/Applications/SDLApp/`
|
* `/Applications/SDLApp/`
|
||||||
*
|
*
|
||||||
|
* **Nintendo 3DS Specific Functionality**: This function returns "romfs"
|
||||||
|
* directory of the application as it is uncommon to store resources outside
|
||||||
|
* the executable. As such it is not a writable directory.
|
||||||
|
*
|
||||||
* The returned path is guaranteed to end with a path separator ('\' on
|
* The returned path is guaranteed to end with a path separator ('\' on
|
||||||
* Windows, '/' on most other platforms).
|
* Windows, '/' on most other platforms).
|
||||||
*
|
*
|
||||||
@@ -92,7 +96,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
|
|||||||
*
|
*
|
||||||
* `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
|
* `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
|
||||||
*
|
*
|
||||||
* On Linux, the string might look like"
|
* On Linux, the string might look like:
|
||||||
*
|
*
|
||||||
* `/home/bob/.local/share/My Program Name/`
|
* `/home/bob/.local/share/My Program Name/`
|
||||||
*
|
*
|
||||||
|
|||||||
+83
-10
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -69,7 +69,11 @@ typedef enum
|
|||||||
SDL_CONTROLLER_TYPE_VIRTUAL,
|
SDL_CONTROLLER_TYPE_VIRTUAL,
|
||||||
SDL_CONTROLLER_TYPE_PS5,
|
SDL_CONTROLLER_TYPE_PS5,
|
||||||
SDL_CONTROLLER_TYPE_AMAZON_LUNA,
|
SDL_CONTROLLER_TYPE_AMAZON_LUNA,
|
||||||
SDL_CONTROLLER_TYPE_GOOGLE_STADIA
|
SDL_CONTROLLER_TYPE_GOOGLE_STADIA,
|
||||||
|
SDL_CONTROLLER_TYPE_NVIDIA_SHIELD,
|
||||||
|
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
|
||||||
|
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
|
||||||
|
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
|
||||||
} SDL_GameControllerType;
|
} SDL_GameControllerType;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
@@ -289,6 +293,25 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
|
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the implementation dependent path for the game controller.
|
||||||
|
*
|
||||||
|
* This function can be called before any controllers are opened.
|
||||||
|
*
|
||||||
|
* `joystick_index` is the same as the `device_index` passed to
|
||||||
|
* SDL_JoystickOpen().
|
||||||
|
*
|
||||||
|
* \param joystick_index the device_index of a device, from zero to
|
||||||
|
* SDL_NumJoysticks()-1
|
||||||
|
* \returns the implementation-dependent path for the game controller, or NULL
|
||||||
|
* if there is no path or the index is invalid.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GameControllerPath
|
||||||
|
*/
|
||||||
|
extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of a game controller.
|
* Get the type of a game controller.
|
||||||
*
|
*
|
||||||
@@ -386,6 +409,23 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(in
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the implementation-dependent path for an opened game controller.
|
||||||
|
*
|
||||||
|
* This is the same path as returned by SDL_GameControllerNameForIndex(), but
|
||||||
|
* it takes a controller identifier instead of the (unstable) device index.
|
||||||
|
*
|
||||||
|
* \param gamecontroller a game controller identifier previously returned by
|
||||||
|
* SDL_GameControllerOpen()
|
||||||
|
* \returns the implementation dependent path for the game controller, or NULL
|
||||||
|
* if there is no path or the identifier passed is invalid.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GameControllerPathForIndex
|
||||||
|
*/
|
||||||
|
extern DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type of this currently opened controller
|
* Get the type of this currently opened controller
|
||||||
*
|
*
|
||||||
@@ -415,7 +455,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController
|
|||||||
* Set the player index of an opened game controller.
|
* Set the player index of an opened game controller.
|
||||||
*
|
*
|
||||||
* \param gamecontroller the game controller object to adjust.
|
* \param gamecontroller the game controller object to adjust.
|
||||||
* \param player_index Player index to assign to this controller.
|
* \param player_index Player index to assign to this controller, or -1 to
|
||||||
|
* clear the player index and turn off player LEDs.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.12.
|
* \since This function is available since SDL 2.0.12.
|
||||||
*/
|
*/
|
||||||
@@ -457,6 +498,18 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the firmware version of an opened controller, if available.
|
||||||
|
*
|
||||||
|
* If the firmware version isn't available this function returns 0.
|
||||||
|
*
|
||||||
|
* \param gamecontroller the game controller object to query.
|
||||||
|
* \return the controller firmware version, or zero if unavailable.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the serial number of an opened controller, if available.
|
* Get the serial number of an opened controller, if available.
|
||||||
*
|
*
|
||||||
@@ -671,10 +724,10 @@ typedef enum
|
|||||||
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
|
||||||
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
|
||||||
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
|
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
|
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
|
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
|
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */
|
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */
|
||||||
SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
|
||||||
SDL_CONTROLLER_BUTTON_MAX
|
SDL_CONTROLLER_BUTTON_MAX
|
||||||
} SDL_GameControllerButton;
|
} SDL_GameControllerButton;
|
||||||
@@ -701,7 +754,7 @@ extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFrom
|
|||||||
* The caller should not SDL_free() the returned string.
|
* The caller should not SDL_free() the returned string.
|
||||||
*
|
*
|
||||||
* \param button an enum value for a given SDL_GameControllerButton
|
* \param button an enum value for a given SDL_GameControllerButton
|
||||||
* \returns a string for the given button, or NULL if an invalid axis is
|
* \returns a string for the given button, or NULL if an invalid button is
|
||||||
* specified. The string returned is of the format used by
|
* specified. The string returned is of the format used by
|
||||||
* SDL_GameController mapping strings.
|
* SDL_GameController mapping strings.
|
||||||
*
|
*
|
||||||
@@ -842,6 +895,25 @@ extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameContro
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
|
extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current state of a game controller sensor with the timestamp of the
|
||||||
|
* last update.
|
||||||
|
*
|
||||||
|
* The number of values and interpretation of the data is sensor dependent.
|
||||||
|
* See SDL_sensor.h for the details for each type of sensor.
|
||||||
|
*
|
||||||
|
* \param gamecontroller The controller to query
|
||||||
|
* \param type The type of sensor to query
|
||||||
|
* \param timestamp A pointer filled with the timestamp in microseconds of the
|
||||||
|
* current sensor reading if available, or 0 if not
|
||||||
|
* \param data A pointer filled with the current sensor state
|
||||||
|
* \param num_values The number of values to write to data
|
||||||
|
* \return 0 or -1 if an error occurred.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.26.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start a rumble effect on a game controller.
|
* Start a rumble effect on a game controller.
|
||||||
*
|
*
|
||||||
@@ -869,8 +941,9 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecon
|
|||||||
* calling it with 0 intensity stops any rumbling.
|
* calling it with 0 intensity stops any rumbling.
|
||||||
*
|
*
|
||||||
* Note that this is rumbling of the _triggers_ and not the game controller as
|
* Note that this is rumbling of the _triggers_ and not the game controller as
|
||||||
* a whole. The first controller to offer this feature was the PlayStation 5's
|
* a whole. This is currently only supported on Xbox One controllers. If you
|
||||||
* DualShock 5.
|
* want the (more common) whole-controller rumble, use
|
||||||
|
* SDL_GameControllerRumble() instead.
|
||||||
*
|
*
|
||||||
* \param gamecontroller The controller to vibrate
|
* \param gamecontroller The controller to vibrate
|
||||||
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
* \param left_rumble The intensity of the left trigger rumble motor, from 0
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+100
@@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
Simple DirectMedia Layer
|
||||||
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied
|
||||||
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software
|
||||||
|
in a product, an acknowledgment in the product documentation would be
|
||||||
|
appreciated but is not required.
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file SDL_guid.h
|
||||||
|
*
|
||||||
|
* Include file for handling ::SDL_GUID values.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SDL_guid_h_
|
||||||
|
#define SDL_guid_h_
|
||||||
|
|
||||||
|
#include "SDL_stdinc.h"
|
||||||
|
#include "SDL_error.h"
|
||||||
|
|
||||||
|
#include "begin_code.h"
|
||||||
|
/* Set up for C function definitions, even when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An SDL_GUID is a 128-bit identifier for an input device that
|
||||||
|
* identifies that device across runs of SDL programs on the same
|
||||||
|
* platform. If the device is detached and then re-attached to a
|
||||||
|
* different port, or if the base system is rebooted, the device
|
||||||
|
* should still report the same GUID.
|
||||||
|
*
|
||||||
|
* GUIDs are as precise as possible but are not guaranteed to
|
||||||
|
* distinguish physically distinct but equivalent devices. For
|
||||||
|
* example, two game controllers from the same vendor with the same
|
||||||
|
* product ID and revision may have the same GUID.
|
||||||
|
*
|
||||||
|
* GUIDs may be platform-dependent (i.e., the same device may report
|
||||||
|
* different GUIDs on different operating systems).
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
Uint8 data[16];
|
||||||
|
} SDL_GUID;
|
||||||
|
|
||||||
|
/* Function prototypes */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an ASCII string representation for a given ::SDL_GUID.
|
||||||
|
*
|
||||||
|
* You should supply at least 33 bytes for pszGUID.
|
||||||
|
*
|
||||||
|
* \param guid the ::SDL_GUID you wish to convert to string
|
||||||
|
* \param pszGUID buffer in which to write the ASCII string
|
||||||
|
* \param cbGUID the size of pszGUID
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GUIDFromString
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert a GUID string into a ::SDL_GUID structure.
|
||||||
|
*
|
||||||
|
* Performs no error checking. If this function is given a string containing
|
||||||
|
* an invalid GUID, the function will silently succeed, but the GUID generated
|
||||||
|
* will not be useful.
|
||||||
|
*
|
||||||
|
* \param pchGUID string containing an ASCII representation of a GUID
|
||||||
|
* \returns a ::SDL_GUID structure.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GUIDToString
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
|
||||||
|
|
||||||
|
/* Ends C function definitions when using C++ */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#include "close_code.h"
|
||||||
|
|
||||||
|
#endif /* SDL_guid_h_ */
|
||||||
|
|
||||||
|
/* vi: set ts=4 sw=4 expandtab: */
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+711
-65
File diff suppressed because it is too large
Load Diff
+136
-13
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -43,6 +43,8 @@
|
|||||||
|
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
#include "SDL_guid.h"
|
||||||
|
#include "SDL_mutex.h"
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
@@ -65,13 +67,14 @@ extern "C" {
|
|||||||
/**
|
/**
|
||||||
* The joystick structure used to identify an SDL joystick
|
* The joystick structure used to identify an SDL joystick
|
||||||
*/
|
*/
|
||||||
|
#ifdef SDL_THREAD_SAFETY_ANALYSIS
|
||||||
|
extern SDL_mutex *SDL_joystick_lock;
|
||||||
|
#endif
|
||||||
struct _SDL_Joystick;
|
struct _SDL_Joystick;
|
||||||
typedef struct _SDL_Joystick SDL_Joystick;
|
typedef struct _SDL_Joystick SDL_Joystick;
|
||||||
|
|
||||||
/* A structure that encodes the stable unique id for a joystick device */
|
/* A structure that encodes the stable unique id for a joystick device */
|
||||||
typedef struct {
|
typedef SDL_GUID SDL_JoystickGUID;
|
||||||
Uint8 data[16];
|
|
||||||
} SDL_JoystickGUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a unique ID for a joystick for the time it is connected to the system,
|
* This is a unique ID for a joystick for the time it is connected to the system,
|
||||||
@@ -125,9 +128,14 @@ typedef enum
|
|||||||
* the API functions that take a joystick index will be valid, and joystick
|
* the API functions that take a joystick index will be valid, and joystick
|
||||||
* and game controller events will not be delivered.
|
* and game controller events will not be delivered.
|
||||||
*
|
*
|
||||||
|
* As of SDL 2.26.0, you can take the joystick lock around reinitializing the
|
||||||
|
* joystick subsystem, to prevent other threads from seeing joysticks in an
|
||||||
|
* uninitialized state. However, all open joysticks will be closed and SDL
|
||||||
|
* functions called with them will fail.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 2.0.7.
|
* \since This function is available since SDL 2.0.7.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -142,7 +150,7 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.7.
|
* \since This function is available since SDL 2.0.7.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count the number of joysticks attached to the system.
|
* Count the number of joysticks attached to the system.
|
||||||
@@ -153,6 +161,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
|
|||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_JoystickName
|
* \sa SDL_JoystickName
|
||||||
|
* \sa SDL_JoystickPath
|
||||||
* \sa SDL_JoystickOpen
|
* \sa SDL_JoystickOpen
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
||||||
@@ -174,6 +183,23 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the implementation dependent path of a joystick.
|
||||||
|
*
|
||||||
|
* This can be called before any joysticks are opened.
|
||||||
|
*
|
||||||
|
* \param device_index the index of the joystick to query (the N'th joystick
|
||||||
|
* on the system)
|
||||||
|
* \returns the path of the selected joystick. If no path can be found, this
|
||||||
|
* function returns NULL; call SDL_GetError() for more information.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_JoystickPath
|
||||||
|
* \sa SDL_JoystickOpen
|
||||||
|
*/
|
||||||
|
extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the player index of a joystick, or -1 if it's not available This can be
|
* Get the player index of a joystick, or -1 if it's not available This can be
|
||||||
* called before any joysticks are opened.
|
* called before any joysticks are opened.
|
||||||
@@ -262,13 +288,12 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
|
|||||||
/**
|
/**
|
||||||
* Get the instance ID of a joystick.
|
* Get the instance ID of a joystick.
|
||||||
*
|
*
|
||||||
* This can be called before any joysticks are opened. If the index is out of
|
* This can be called before any joysticks are opened.
|
||||||
* range, this function will return -1.
|
|
||||||
*
|
*
|
||||||
* \param device_index the index of the joystick to query (the N'th joystick
|
* \param device_index the index of the joystick to query (the N'th joystick
|
||||||
* on the system
|
* on the system
|
||||||
* \returns the instance id of the selected joystick. If called on an invalid
|
* \returns the instance id of the selected joystick. If called on an invalid
|
||||||
* index, this function returns zero
|
* index, this function returns -1.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.6.
|
* \since This function is available since SDL 2.0.6.
|
||||||
*/
|
*/
|
||||||
@@ -330,6 +355,54 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
|
|||||||
int nbuttons,
|
int nbuttons,
|
||||||
int nhats);
|
int nhats);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The structure that defines an extended virtual joystick description
|
||||||
|
*
|
||||||
|
* The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx()
|
||||||
|
* All other elements of this structure are optional and can be left 0.
|
||||||
|
*
|
||||||
|
* \sa SDL_JoystickAttachVirtualEx
|
||||||
|
*/
|
||||||
|
typedef struct SDL_VirtualJoystickDesc
|
||||||
|
{
|
||||||
|
Uint16 version; /**< `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` */
|
||||||
|
Uint16 type; /**< `SDL_JoystickType` */
|
||||||
|
Uint16 naxes; /**< the number of axes on this joystick */
|
||||||
|
Uint16 nbuttons; /**< the number of buttons on this joystick */
|
||||||
|
Uint16 nhats; /**< the number of hats on this joystick */
|
||||||
|
Uint16 vendor_id; /**< the USB vendor ID of this joystick */
|
||||||
|
Uint16 product_id; /**< the USB product ID of this joystick */
|
||||||
|
Uint16 padding; /**< unused */
|
||||||
|
Uint32 button_mask; /**< A mask of which buttons are valid for this controller
|
||||||
|
e.g. (1 << SDL_CONTROLLER_BUTTON_A) */
|
||||||
|
Uint32 axis_mask; /**< A mask of which axes are valid for this controller
|
||||||
|
e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX) */
|
||||||
|
const char *name; /**< the name of the joystick */
|
||||||
|
|
||||||
|
void *userdata; /**< User data pointer passed to callbacks */
|
||||||
|
void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
|
||||||
|
void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
|
||||||
|
int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */
|
||||||
|
int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */
|
||||||
|
int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */
|
||||||
|
int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */
|
||||||
|
|
||||||
|
} SDL_VirtualJoystickDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief The current version of the SDL_VirtualJoystickDesc structure
|
||||||
|
*/
|
||||||
|
#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach a new virtual joystick with extended properties.
|
||||||
|
*
|
||||||
|
* \returns the joystick's device index, or -1 if an error occurred.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detach a virtual joystick.
|
* Detach a virtual joystick.
|
||||||
*
|
*
|
||||||
@@ -360,6 +433,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
|
|||||||
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
|
||||||
* SDL_WaitEvent.
|
* SDL_WaitEvent.
|
||||||
*
|
*
|
||||||
|
* Note that when sending trigger axes, you should scale the value to the full
|
||||||
|
* range of Sint16. For example, a trigger at rest would have the value of
|
||||||
|
* `SDL_JOYSTICK_AXIS_MIN`.
|
||||||
|
*
|
||||||
* \param joystick the virtual joystick on which to set state.
|
* \param joystick the virtual joystick on which to set state.
|
||||||
* \param axis the specific axis on the virtual joystick to set.
|
* \param axis the specific axis on the virtual joystick to set.
|
||||||
* \param value the new value for the specified axis.
|
* \param value the new value for the specified axis.
|
||||||
@@ -419,6 +496,19 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, in
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
|
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the implementation dependent path of a joystick.
|
||||||
|
*
|
||||||
|
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||||
|
* \returns the path of the selected joystick. If no path can be found, this
|
||||||
|
* function returns NULL; call SDL_GetError() for more information.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_JoystickPathForIndex
|
||||||
|
*/
|
||||||
|
extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the player index of an opened joystick.
|
* Get the player index of an opened joystick.
|
||||||
*
|
*
|
||||||
@@ -436,7 +526,8 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
|
|||||||
* Set the player index of an opened joystick.
|
* Set the player index of an opened joystick.
|
||||||
*
|
*
|
||||||
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||||
* \param player_index the player index to set.
|
* \param player_index Player index to assign to this joystick, or -1 to clear
|
||||||
|
* the player index and turn off player LEDs.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.12.
|
* \since This function is available since SDL 2.0.12.
|
||||||
*/
|
*/
|
||||||
@@ -495,6 +586,19 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the firmware version of an opened joystick, if available.
|
||||||
|
*
|
||||||
|
* If the firmware version isn't available this function returns 0.
|
||||||
|
*
|
||||||
|
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
|
||||||
|
* \returns the firmware version of the selected joystick, or 0 if
|
||||||
|
* unavailable.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the serial number of an opened joystick, if available.
|
* Get the serial number of an opened joystick, if available.
|
||||||
*
|
*
|
||||||
@@ -551,6 +655,25 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
|
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the device information encoded in a SDL_JoystickGUID structure
|
||||||
|
*
|
||||||
|
* \param guid the SDL_JoystickGUID you wish to get info about
|
||||||
|
* \param vendor A pointer filled in with the device VID, or 0 if not
|
||||||
|
* available
|
||||||
|
* \param product A pointer filled in with the device PID, or 0 if not
|
||||||
|
* available
|
||||||
|
* \param version A pointer filled in with the device version, or 0 if not
|
||||||
|
* available
|
||||||
|
* \param crc16 A pointer filled in with a CRC used to distinguish different
|
||||||
|
* products with the same VID/PID, or 0 if not available
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.26.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_JoystickGetDeviceGUID
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the status of a specified joystick.
|
* Get the status of a specified joystick.
|
||||||
*
|
*
|
||||||
@@ -829,9 +952,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 lo
|
|||||||
* Each call to this function cancels any previous trigger rumble effect, and
|
* Each call to this function cancels any previous trigger rumble effect, and
|
||||||
* calling it with 0 intensity stops any rumbling.
|
* calling it with 0 intensity stops any rumbling.
|
||||||
*
|
*
|
||||||
* Note that this function is for _trigger_ rumble; the first joystick to
|
* Note that this is rumbling of the _triggers_ and not the game controller as
|
||||||
* support this was the PlayStation 5's DualShock 5 controller. If you want
|
* a whole. This is currently only supported on Xbox One controllers. If you
|
||||||
* the (more common) whole-controller rumble, use SDL_JoystickRumble()
|
* want the (more common) whole-controller rumble, use SDL_JoystickRumble()
|
||||||
* instead.
|
* instead.
|
||||||
*
|
*
|
||||||
* \param joystick The joystick to vibrate
|
* \param joystick The joystick to vibrate
|
||||||
|
|||||||
+39
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -90,9 +90,21 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
|||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_PumpEvents
|
* \sa SDL_PumpEvents
|
||||||
|
* \sa SDL_ResetKeyboard
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the state of the keyboard
|
||||||
|
*
|
||||||
|
* This function will generate key up events for all pressed keys.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*
|
||||||
|
* \sa SDL_GetKeyboardState
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current key modifier state for the keyboard.
|
* Get the current key modifier state for the keyboard.
|
||||||
*
|
*
|
||||||
@@ -268,9 +280,34 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dismiss the composition window/IME without disabling the subsystem.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*
|
||||||
|
* \sa SDL_StartTextInput
|
||||||
|
* \sa SDL_StopTextInput
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns if an IME Composite or Candidate window is currently shown.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the rectangle used to type Unicode text inputs.
|
* Set the rectangle used to type Unicode text inputs.
|
||||||
*
|
*
|
||||||
|
* To start text input in a given location, this function is intended to be
|
||||||
|
* called before SDL_StartTextInput, although some platforms support moving
|
||||||
|
* the rectangle even while text input (and a composition) is active.
|
||||||
|
*
|
||||||
|
* Note: If you want to use the system native IME window, try setting hint
|
||||||
|
* **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you
|
||||||
|
* any feedback.
|
||||||
|
*
|
||||||
* \param rect the SDL_Rect structure representing the rectangle to receive
|
* \param rect the SDL_Rect structure representing the rectangle to receive
|
||||||
* text (ignored if NULL)
|
* text (ignored if NULL)
|
||||||
*
|
*
|
||||||
@@ -278,7 +315,7 @@ extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
|||||||
*
|
*
|
||||||
* \sa SDL_StartTextInput
|
* \sa SDL_StartTextInput
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
|
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether the platform has screen keyboard support.
|
* Check whether the platform has screen keyboard support.
|
||||||
|
|||||||
+8
-3
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
* an SDLK_* constant for those keys that do not generate characters.
|
* an SDLK_* constant for those keys that do not generate characters.
|
||||||
*
|
*
|
||||||
* A special exception is the number keys at the top of the keyboard which
|
* A special exception is the number keys at the top of the keyboard which
|
||||||
* always map to SDLK_0...SDLK_9, regardless of layout.
|
* map to SDLK_0...SDLK_9 on AZERTY layouts.
|
||||||
*/
|
*/
|
||||||
typedef Sint32 SDL_Keycode;
|
typedef Sint32 SDL_Keycode;
|
||||||
|
|
||||||
@@ -318,7 +318,12 @@ typedef enum
|
|||||||
SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
|
SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
|
||||||
|
|
||||||
SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
|
SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
|
||||||
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
|
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD),
|
||||||
|
|
||||||
|
SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT),
|
||||||
|
SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT),
|
||||||
|
SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL),
|
||||||
|
SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
|
||||||
} SDL_KeyCode;
|
} SDL_KeyCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -47,9 +47,9 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief The maximum size of a log message
|
* \brief The maximum size of a log message prior to SDL 2.0.24
|
||||||
*
|
*
|
||||||
* Messages longer than the maximum size will be truncated
|
* As of 2.0.24 there is no limit to the length of SDL log messages.
|
||||||
*/
|
*/
|
||||||
#define SDL_MAX_LOG_MESSAGE 4096
|
#define SDL_MAX_LOG_MESSAGE 4096
|
||||||
|
|
||||||
|
|||||||
+50
-3
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -51,6 +51,15 @@
|
|||||||
*/
|
*/
|
||||||
#define SDL_MAIN_NEEDED
|
#define SDL_MAIN_NEEDED
|
||||||
|
|
||||||
|
#elif defined(__GDK__)
|
||||||
|
/* On GDK, SDL provides a main function that initializes the game runtime.
|
||||||
|
|
||||||
|
Please note that #include'ing SDL_main.h is not enough to get a main()
|
||||||
|
function working. You must either link against SDL2main or, if not possible,
|
||||||
|
call the SDL_GDKRunApp function from your entry point.
|
||||||
|
*/
|
||||||
|
#define SDL_MAIN_NEEDED
|
||||||
|
|
||||||
#elif defined(__IPHONEOS__)
|
#elif defined(__IPHONEOS__)
|
||||||
/* On iOS SDL provides a main function that creates an application delegate
|
/* On iOS SDL provides a main function that creates an application delegate
|
||||||
and starts the iOS application run loop.
|
and starts the iOS application run loop.
|
||||||
@@ -92,6 +101,22 @@
|
|||||||
*/
|
*/
|
||||||
#define SDL_MAIN_AVAILABLE
|
#define SDL_MAIN_AVAILABLE
|
||||||
|
|
||||||
|
#elif defined(__PS2__)
|
||||||
|
#define SDL_MAIN_AVAILABLE
|
||||||
|
|
||||||
|
#define SDL_PS2_SKIP_IOP_RESET() \
|
||||||
|
void reset_IOP(); \
|
||||||
|
void reset_IOP() {}
|
||||||
|
|
||||||
|
#elif defined(__3DS__)
|
||||||
|
/*
|
||||||
|
On N3DS, SDL provides a main function that sets up the screens
|
||||||
|
and storage.
|
||||||
|
|
||||||
|
If you provide this yourself, you may define SDL_MAIN_HANDLED
|
||||||
|
*/
|
||||||
|
#define SDL_MAIN_AVAILABLE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif /* SDL_MAIN_HANDLED */
|
#endif /* SDL_MAIN_HANDLED */
|
||||||
|
|
||||||
@@ -145,7 +170,7 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#if defined(__WIN32__) || defined(__GDK__)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a win32 window class for SDL's use.
|
* Register a win32 window class for SDL's use.
|
||||||
@@ -189,7 +214,7 @@ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
||||||
|
|
||||||
#endif /* __WIN32__ */
|
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WINRT__
|
#ifdef __WINRT__
|
||||||
@@ -224,6 +249,28 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
|
|||||||
|
|
||||||
#endif /* __IPHONEOS__ */
|
#endif /* __IPHONEOS__ */
|
||||||
|
|
||||||
|
#ifdef __GDK__
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize and launch an SDL GDK application.
|
||||||
|
*
|
||||||
|
* \param mainFunction the SDL app's C-style main(), an SDL_main_func
|
||||||
|
* \param reserved reserved for future use; should be NULL
|
||||||
|
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
|
||||||
|
* more information on the failure.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback from the application to let the suspend continue.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.28.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
|
||||||
|
|
||||||
|
#endif /* __GDK__ */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -82,7 +82,7 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.14.
|
* \since This function is available since SDL 2.0.14.
|
||||||
*
|
*
|
||||||
* \sa SDL_MetalCreateView
|
* \sa SDL_Metal_CreateView
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
||||||
|
|
||||||
@@ -92,6 +92,7 @@ extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
|
|||||||
*
|
*
|
||||||
* \param window SDL_Window from which the drawable size should be queried
|
* \param window SDL_Window from which the drawable size should be queried
|
||||||
* \param w Pointer to variable for storing the width in pixels, may be NULL
|
* \param w Pointer to variable for storing the width in pixels, may be NULL
|
||||||
|
* \param h Pointer to variable for storing the height in pixels, may be NULL
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.14.
|
* \since This function is available since SDL 2.0.14.
|
||||||
*
|
*
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+19
-9
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -154,7 +154,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
|
|||||||
/**
|
/**
|
||||||
* Move the mouse cursor to the given position within the window.
|
* Move the mouse cursor to the given position within the window.
|
||||||
*
|
*
|
||||||
* This function generates a mouse motion event.
|
* This function generates a mouse motion event if relative mode is not
|
||||||
|
* enabled. If relative mode is enabled, you can force mouse events for the
|
||||||
|
* warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.
|
||||||
*
|
*
|
||||||
* Note that this function will appear to succeed, but not actually move the
|
* Note that this function will appear to succeed, but not actually move the
|
||||||
* mouse when used over Microsoft Remote Desktop.
|
* mouse when used over Microsoft Remote Desktop.
|
||||||
@@ -196,13 +198,9 @@ extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
|
|||||||
/**
|
/**
|
||||||
* Set relative mouse mode.
|
* Set relative mouse mode.
|
||||||
*
|
*
|
||||||
* While the mouse is in relative mode, the cursor is hidden, and the driver
|
* While the mouse is in relative mode, the cursor is hidden, the mouse
|
||||||
* will try to report continuous motion in the current window. Only relative
|
* position is constrained to the window, and SDL will report continuous
|
||||||
* motion events will be delivered, the mouse position will not change.
|
* relative mouse motion even if the mouse is at the edge of the window.
|
||||||
*
|
|
||||||
* Note that this function will not be able to provide continuous relative
|
|
||||||
* motion when used over Microsoft Remote Desktop, instead motion is limited
|
|
||||||
* to the bounds of the screen.
|
|
||||||
*
|
*
|
||||||
* This function will flush any pending mouse motion.
|
* This function will flush any pending mouse motion.
|
||||||
*
|
*
|
||||||
@@ -245,6 +243,15 @@ extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
|
|||||||
* While capturing is enabled, the current window will have the
|
* While capturing is enabled, the current window will have the
|
||||||
* `SDL_WINDOW_MOUSE_CAPTURE` flag set.
|
* `SDL_WINDOW_MOUSE_CAPTURE` flag set.
|
||||||
*
|
*
|
||||||
|
* Please note that as of SDL 2.0.22, SDL will attempt to "auto capture" the
|
||||||
|
* mouse while the user is pressing a button; this is to try and make mouse
|
||||||
|
* behavior more consistent between platforms, and deal with the common case
|
||||||
|
* of a user dragging the mouse outside of the window. This means that if you
|
||||||
|
* are calling SDL_CaptureMouse() only to deal with this situation, you no
|
||||||
|
* longer have to (although it is safe to do so). If this causes problems for
|
||||||
|
* your app, you can disable auto capture by setting the
|
||||||
|
* `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
|
||||||
|
*
|
||||||
* \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
|
* \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
|
||||||
* \returns 0 on success or -1 if not supported; call SDL_GetError() for more
|
* \returns 0 on success or -1 if not supported; call SDL_GetError() for more
|
||||||
* information.
|
* information.
|
||||||
@@ -378,6 +385,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
|
|||||||
/**
|
/**
|
||||||
* Get the default cursor.
|
* Get the default cursor.
|
||||||
*
|
*
|
||||||
|
* You do not have to call SDL_FreeCursor() on the return value, but it is
|
||||||
|
* safe to do so.
|
||||||
|
*
|
||||||
* \returns the default cursor on success or NULL on failure.
|
* \returns the default cursor on success or NULL on failure.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
|
|||||||
+80
-6
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -31,6 +31,80 @@
|
|||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_error.h"
|
#include "SDL_error.h"
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Enable thread safety attributes only with clang.
|
||||||
|
* The attributes can be safely erased when compiling with other compilers.
|
||||||
|
*/
|
||||||
|
#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \
|
||||||
|
defined(__clang__) && (!defined(SWIG))
|
||||||
|
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
|
||||||
|
#else
|
||||||
|
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) /* no-op */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SDL_CAPABILITY(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
|
||||||
|
|
||||||
|
#define SDL_SCOPED_CAPABILITY \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
|
||||||
|
|
||||||
|
#define SDL_GUARDED_BY(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
|
||||||
|
|
||||||
|
#define SDL_PT_GUARDED_BY(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
|
||||||
|
|
||||||
|
#define SDL_ACQUIRED_BEFORE(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x))
|
||||||
|
|
||||||
|
#define SDL_ACQUIRED_AFTER(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x))
|
||||||
|
|
||||||
|
#define SDL_REQUIRES(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(x))
|
||||||
|
|
||||||
|
#define SDL_REQUIRES_SHARED(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(x))
|
||||||
|
|
||||||
|
#define SDL_ACQUIRE(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(x))
|
||||||
|
|
||||||
|
#define SDL_ACQUIRE_SHARED(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(x))
|
||||||
|
|
||||||
|
#define SDL_RELEASE(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(x))
|
||||||
|
|
||||||
|
#define SDL_RELEASE_SHARED(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(x))
|
||||||
|
|
||||||
|
#define SDL_RELEASE_GENERIC(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(x))
|
||||||
|
|
||||||
|
#define SDL_TRY_ACQUIRE(x, y) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(x, y))
|
||||||
|
|
||||||
|
#define SDL_TRY_ACQUIRE_SHARED(x, y) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(x, y))
|
||||||
|
|
||||||
|
#define SDL_EXCLUDES(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(x))
|
||||||
|
|
||||||
|
#define SDL_ASSERT_CAPABILITY(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
|
||||||
|
|
||||||
|
#define SDL_ASSERT_SHARED_CAPABILITY(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
|
||||||
|
|
||||||
|
#define SDL_RETURN_CAPABILITY(x) \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
|
||||||
|
|
||||||
|
#define SDL_NO_THREAD_SAFETY_ANALYSIS \
|
||||||
|
SDL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@@ -96,7 +170,7 @@ extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
|
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex);
|
||||||
#define SDL_mutexP(m) SDL_LockMutex(m)
|
#define SDL_mutexP(m) SDL_LockMutex(m)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -119,7 +193,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
|
|||||||
* \sa SDL_LockMutex
|
* \sa SDL_LockMutex
|
||||||
* \sa SDL_UnlockMutex
|
* \sa SDL_UnlockMutex
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
|
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex) SDL_TRY_ACQUIRE(0, mutex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unlock the mutex.
|
* Unlock the mutex.
|
||||||
@@ -138,7 +212,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
|
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex);
|
||||||
#define SDL_mutexV(m) SDL_UnlockMutex(m)
|
#define SDL_mutexV(m) SDL_UnlockMutex(m)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -276,7 +350,7 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
|||||||
* successful it will atomically decrement the semaphore value.
|
* successful it will atomically decrement the semaphore value.
|
||||||
*
|
*
|
||||||
* \param sem the semaphore to wait on
|
* \param sem the semaphore to wait on
|
||||||
* \param ms the length of the timeout, in milliseconds
|
* \param timeout the length of the timeout, in milliseconds
|
||||||
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
|
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
|
||||||
* succeed in the allotted time, or a negative error code on failure;
|
* succeed in the allotted time, or a negative error code on failure;
|
||||||
* call SDL_GetError() for more information.
|
* call SDL_GetError() for more information.
|
||||||
@@ -290,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
|
|||||||
* \sa SDL_SemValue
|
* \sa SDL_SemValue
|
||||||
* \sa SDL_SemWait
|
* \sa SDL_SemWait
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
|
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Atomically increment a semaphore's value and wake waiting threads.
|
* Atomically increment a semaphore's value and wake waiting threads.
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-52
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -2107,57 +2107,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* ???. GL_MESA_packed_depth_stencil
|
|
||||||
* XXX obsolete
|
|
||||||
*/
|
|
||||||
#ifndef GL_MESA_packed_depth_stencil
|
|
||||||
#define GL_MESA_packed_depth_stencil 1
|
|
||||||
|
|
||||||
#define GL_DEPTH_STENCIL_MESA 0x8750
|
|
||||||
#define GL_UNSIGNED_INT_24_8_MESA 0x8751
|
|
||||||
#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
|
|
||||||
#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
|
|
||||||
#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
|
|
||||||
|
|
||||||
#endif /* GL_MESA_packed_depth_stencil */
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef GL_ATI_blend_equation_separate
|
|
||||||
#define GL_ATI_blend_equation_separate 1
|
|
||||||
|
|
||||||
#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
|
|
||||||
|
|
||||||
GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
|
|
||||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
|
|
||||||
|
|
||||||
#endif /* GL_ATI_blend_equation_separate */
|
|
||||||
|
|
||||||
|
|
||||||
/* GL_OES_EGL_image */
|
|
||||||
#ifndef GL_OES_EGL_image
|
|
||||||
typedef void* GLeglImageOES;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef GL_OES_EGL_image
|
|
||||||
#define GL_OES_EGL_image 1
|
|
||||||
#ifdef GL_GLEXT_PROTOTYPES
|
|
||||||
GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
|
|
||||||
GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
|
|
||||||
#endif
|
|
||||||
typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
|
|
||||||
typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
** NOTE!!!!! If you add new functions to this file, or update
|
|
||||||
** glext.h be sure to regenerate the gl_mangle.h file. See comments
|
|
||||||
** in that file for details.
|
|
||||||
**/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Begin system-specific stuff
|
* Begin system-specific stuff
|
||||||
*/
|
*/
|
||||||
|
|||||||
+2266
-233
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+376
-341
@@ -1,56 +1,70 @@
|
|||||||
#ifndef __gl2_h_
|
#ifndef __gles2_gl2_h_
|
||||||
#define __gl2_h_
|
#define __gles2_gl2_h_ 1
|
||||||
|
|
||||||
/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
|
|
||||||
|
|
||||||
/*#include <GLES2/gl2platform.h>*/
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This document is licensed under the SGI Free Software B License Version
|
** Copyright 2013-2020 The Khronos Group Inc.
|
||||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
** SPDX-License-Identifier: MIT
|
||||||
|
**
|
||||||
|
** 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
|
||||||
|
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*#include <GLES2/gl2platform.h>*/
|
||||||
|
|
||||||
|
#ifndef GL_APIENTRYP
|
||||||
|
#define GL_APIENTRYP GL_APIENTRY*
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef GL_GLES_PROTOTYPES
|
||||||
|
#define GL_GLES_PROTOTYPES 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Generated on date 20220530 */
|
||||||
|
|
||||||
|
/* Generated C header for:
|
||||||
|
* API: gles2
|
||||||
|
* Profile: common
|
||||||
|
* Versions considered: 2\.[0-9]
|
||||||
|
* Versions emitted: .*
|
||||||
|
* Default extensions included: None
|
||||||
|
* Additional extensions included: _nomatch_^
|
||||||
|
* Extensions removed: _nomatch_^
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
#ifndef GL_ES_VERSION_2_0
|
||||||
* Data type definitions
|
#define GL_ES_VERSION_2_0 1
|
||||||
*-----------------------------------------------------------------------*/
|
/*#include <KHR/khrplatform.h>*/
|
||||||
|
typedef khronos_int8_t GLbyte;
|
||||||
typedef void GLvoid;
|
typedef khronos_float_t GLclampf;
|
||||||
typedef char GLchar;
|
typedef khronos_int32_t GLfixed;
|
||||||
typedef unsigned int GLenum;
|
typedef khronos_int16_t GLshort;
|
||||||
typedef unsigned char GLboolean;
|
typedef khronos_uint16_t GLushort;
|
||||||
typedef unsigned int GLbitfield;
|
typedef void GLvoid;
|
||||||
typedef khronos_int8_t GLbyte;
|
typedef struct __GLsync *GLsync;
|
||||||
typedef short GLshort;
|
typedef khronos_int64_t GLint64;
|
||||||
typedef int GLint;
|
typedef khronos_uint64_t GLuint64;
|
||||||
typedef int GLsizei;
|
typedef unsigned int GLenum;
|
||||||
typedef khronos_uint8_t GLubyte;
|
typedef unsigned int GLuint;
|
||||||
typedef unsigned short GLushort;
|
typedef char GLchar;
|
||||||
typedef unsigned int GLuint;
|
typedef khronos_float_t GLfloat;
|
||||||
typedef khronos_float_t GLfloat;
|
typedef khronos_ssize_t GLsizeiptr;
|
||||||
typedef khronos_float_t GLclampf;
|
|
||||||
typedef khronos_int32_t GLfixed;
|
|
||||||
|
|
||||||
/* GL types for handling large vertex buffer objects */
|
|
||||||
typedef khronos_intptr_t GLintptr;
|
typedef khronos_intptr_t GLintptr;
|
||||||
typedef khronos_ssize_t GLsizeiptr;
|
typedef unsigned int GLbitfield;
|
||||||
|
typedef int GLint;
|
||||||
/* OpenGL ES core versions */
|
typedef unsigned char GLboolean;
|
||||||
#define GL_ES_VERSION_2_0 1
|
typedef int GLsizei;
|
||||||
|
typedef khronos_uint8_t GLubyte;
|
||||||
/* ClearBufferMask */
|
|
||||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
||||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||||
|
|
||||||
/* Boolean */
|
|
||||||
#define GL_FALSE 0
|
#define GL_FALSE 0
|
||||||
#define GL_TRUE 1
|
#define GL_TRUE 1
|
||||||
|
|
||||||
/* BeginMode */
|
|
||||||
#define GL_POINTS 0x0000
|
#define GL_POINTS 0x0000
|
||||||
#define GL_LINES 0x0001
|
#define GL_LINES 0x0001
|
||||||
#define GL_LINE_LOOP 0x0002
|
#define GL_LINE_LOOP 0x0002
|
||||||
@@ -58,18 +72,6 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_TRIANGLES 0x0004
|
#define GL_TRIANGLES 0x0004
|
||||||
#define GL_TRIANGLE_STRIP 0x0005
|
#define GL_TRIANGLE_STRIP 0x0005
|
||||||
#define GL_TRIANGLE_FAN 0x0006
|
#define GL_TRIANGLE_FAN 0x0006
|
||||||
|
|
||||||
/* AlphaFunction (not supported in ES20) */
|
|
||||||
/* GL_NEVER */
|
|
||||||
/* GL_LESS */
|
|
||||||
/* GL_EQUAL */
|
|
||||||
/* GL_LEQUAL */
|
|
||||||
/* GL_GREATER */
|
|
||||||
/* GL_NOTEQUAL */
|
|
||||||
/* GL_GEQUAL */
|
|
||||||
/* GL_ALWAYS */
|
|
||||||
|
|
||||||
/* BlendingFactorDest */
|
|
||||||
#define GL_ZERO 0
|
#define GL_ZERO 0
|
||||||
#define GL_ONE 1
|
#define GL_ONE 1
|
||||||
#define GL_SRC_COLOR 0x0300
|
#define GL_SRC_COLOR 0x0300
|
||||||
@@ -78,29 +80,15 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||||
#define GL_DST_ALPHA 0x0304
|
#define GL_DST_ALPHA 0x0304
|
||||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||||
|
|
||||||
/* BlendingFactorSrc */
|
|
||||||
/* GL_ZERO */
|
|
||||||
/* GL_ONE */
|
|
||||||
#define GL_DST_COLOR 0x0306
|
#define GL_DST_COLOR 0x0306
|
||||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||||
/* GL_SRC_ALPHA */
|
|
||||||
/* GL_ONE_MINUS_SRC_ALPHA */
|
|
||||||
/* GL_DST_ALPHA */
|
|
||||||
/* GL_ONE_MINUS_DST_ALPHA */
|
|
||||||
|
|
||||||
/* BlendEquationSeparate */
|
|
||||||
#define GL_FUNC_ADD 0x8006
|
#define GL_FUNC_ADD 0x8006
|
||||||
#define GL_BLEND_EQUATION 0x8009
|
#define GL_BLEND_EQUATION 0x8009
|
||||||
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
|
#define GL_BLEND_EQUATION_RGB 0x8009
|
||||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
||||||
|
|
||||||
/* BlendSubtract */
|
|
||||||
#define GL_FUNC_SUBTRACT 0x800A
|
#define GL_FUNC_SUBTRACT 0x800A
|
||||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
||||||
|
|
||||||
/* Separate Blend Functions */
|
|
||||||
#define GL_BLEND_DST_RGB 0x80C8
|
#define GL_BLEND_DST_RGB 0x80C8
|
||||||
#define GL_BLEND_SRC_RGB 0x80C9
|
#define GL_BLEND_SRC_RGB 0x80C9
|
||||||
#define GL_BLEND_DST_ALPHA 0x80CA
|
#define GL_BLEND_DST_ALPHA 0x80CA
|
||||||
@@ -110,38 +98,19 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_CONSTANT_ALPHA 0x8003
|
#define GL_CONSTANT_ALPHA 0x8003
|
||||||
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
||||||
#define GL_BLEND_COLOR 0x8005
|
#define GL_BLEND_COLOR 0x8005
|
||||||
|
|
||||||
/* Buffer Objects */
|
|
||||||
#define GL_ARRAY_BUFFER 0x8892
|
#define GL_ARRAY_BUFFER 0x8892
|
||||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||||
|
|
||||||
#define GL_STREAM_DRAW 0x88E0
|
#define GL_STREAM_DRAW 0x88E0
|
||||||
#define GL_STATIC_DRAW 0x88E4
|
#define GL_STATIC_DRAW 0x88E4
|
||||||
#define GL_DYNAMIC_DRAW 0x88E8
|
#define GL_DYNAMIC_DRAW 0x88E8
|
||||||
|
|
||||||
#define GL_BUFFER_SIZE 0x8764
|
#define GL_BUFFER_SIZE 0x8764
|
||||||
#define GL_BUFFER_USAGE 0x8765
|
#define GL_BUFFER_USAGE 0x8765
|
||||||
|
|
||||||
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
||||||
|
|
||||||
/* CullFaceMode */
|
|
||||||
#define GL_FRONT 0x0404
|
#define GL_FRONT 0x0404
|
||||||
#define GL_BACK 0x0405
|
#define GL_BACK 0x0405
|
||||||
#define GL_FRONT_AND_BACK 0x0408
|
#define GL_FRONT_AND_BACK 0x0408
|
||||||
|
|
||||||
/* DepthFunction */
|
|
||||||
/* GL_NEVER */
|
|
||||||
/* GL_LESS */
|
|
||||||
/* GL_EQUAL */
|
|
||||||
/* GL_LEQUAL */
|
|
||||||
/* GL_GREATER */
|
|
||||||
/* GL_NOTEQUAL */
|
|
||||||
/* GL_GEQUAL */
|
|
||||||
/* GL_ALWAYS */
|
|
||||||
|
|
||||||
/* EnableCap */
|
|
||||||
#define GL_TEXTURE_2D 0x0DE1
|
#define GL_TEXTURE_2D 0x0DE1
|
||||||
#define GL_CULL_FACE 0x0B44
|
#define GL_CULL_FACE 0x0B44
|
||||||
#define GL_BLEND 0x0BE2
|
#define GL_BLEND 0x0BE2
|
||||||
@@ -152,19 +121,13 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||||
#define GL_SAMPLE_COVERAGE 0x80A0
|
#define GL_SAMPLE_COVERAGE 0x80A0
|
||||||
|
|
||||||
/* ErrorCode */
|
|
||||||
#define GL_NO_ERROR 0
|
#define GL_NO_ERROR 0
|
||||||
#define GL_INVALID_ENUM 0x0500
|
#define GL_INVALID_ENUM 0x0500
|
||||||
#define GL_INVALID_VALUE 0x0501
|
#define GL_INVALID_VALUE 0x0501
|
||||||
#define GL_INVALID_OPERATION 0x0502
|
#define GL_INVALID_OPERATION 0x0502
|
||||||
#define GL_OUT_OF_MEMORY 0x0505
|
#define GL_OUT_OF_MEMORY 0x0505
|
||||||
|
|
||||||
/* FrontFaceDirection */
|
|
||||||
#define GL_CW 0x0900
|
#define GL_CW 0x0900
|
||||||
#define GL_CCW 0x0901
|
#define GL_CCW 0x0901
|
||||||
|
|
||||||
/* GetPName */
|
|
||||||
#define GL_LINE_WIDTH 0x0B21
|
#define GL_LINE_WIDTH 0x0B21
|
||||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
||||||
@@ -191,7 +154,6 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
||||||
#define GL_VIEWPORT 0x0BA2
|
#define GL_VIEWPORT 0x0BA2
|
||||||
#define GL_SCISSOR_BOX 0x0C10
|
#define GL_SCISSOR_BOX 0x0C10
|
||||||
/* GL_SCISSOR_TEST */
|
|
||||||
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
||||||
#define GL_COLOR_WRITEMASK 0x0C23
|
#define GL_COLOR_WRITEMASK 0x0C23
|
||||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||||
@@ -206,32 +168,18 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_DEPTH_BITS 0x0D56
|
#define GL_DEPTH_BITS 0x0D56
|
||||||
#define GL_STENCIL_BITS 0x0D57
|
#define GL_STENCIL_BITS 0x0D57
|
||||||
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
||||||
/* GL_POLYGON_OFFSET_FILL */
|
|
||||||
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
||||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
#define GL_TEXTURE_BINDING_2D 0x8069
|
||||||
#define GL_SAMPLE_BUFFERS 0x80A8
|
#define GL_SAMPLE_BUFFERS 0x80A8
|
||||||
#define GL_SAMPLES 0x80A9
|
#define GL_SAMPLES 0x80A9
|
||||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
||||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||||
|
|
||||||
/* GetTextureParameter */
|
|
||||||
/* GL_TEXTURE_MAG_FILTER */
|
|
||||||
/* GL_TEXTURE_MIN_FILTER */
|
|
||||||
/* GL_TEXTURE_WRAP_S */
|
|
||||||
/* GL_TEXTURE_WRAP_T */
|
|
||||||
|
|
||||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
||||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
||||||
|
|
||||||
/* HintMode */
|
|
||||||
#define GL_DONT_CARE 0x1100
|
#define GL_DONT_CARE 0x1100
|
||||||
#define GL_FASTEST 0x1101
|
#define GL_FASTEST 0x1101
|
||||||
#define GL_NICEST 0x1102
|
#define GL_NICEST 0x1102
|
||||||
|
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||||
/* HintTarget */
|
|
||||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
|
||||||
|
|
||||||
/* DataType */
|
|
||||||
#define GL_BYTE 0x1400
|
#define GL_BYTE 0x1400
|
||||||
#define GL_UNSIGNED_BYTE 0x1401
|
#define GL_UNSIGNED_BYTE 0x1401
|
||||||
#define GL_SHORT 0x1402
|
#define GL_SHORT 0x1402
|
||||||
@@ -240,44 +188,35 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_UNSIGNED_INT 0x1405
|
#define GL_UNSIGNED_INT 0x1405
|
||||||
#define GL_FLOAT 0x1406
|
#define GL_FLOAT 0x1406
|
||||||
#define GL_FIXED 0x140C
|
#define GL_FIXED 0x140C
|
||||||
|
|
||||||
/* PixelFormat */
|
|
||||||
#define GL_DEPTH_COMPONENT 0x1902
|
#define GL_DEPTH_COMPONENT 0x1902
|
||||||
#define GL_ALPHA 0x1906
|
#define GL_ALPHA 0x1906
|
||||||
#define GL_RGB 0x1907
|
#define GL_RGB 0x1907
|
||||||
#define GL_RGBA 0x1908
|
#define GL_RGBA 0x1908
|
||||||
#define GL_LUMINANCE 0x1909
|
#define GL_LUMINANCE 0x1909
|
||||||
#define GL_LUMINANCE_ALPHA 0x190A
|
#define GL_LUMINANCE_ALPHA 0x190A
|
||||||
|
|
||||||
/* PixelType */
|
|
||||||
/* GL_UNSIGNED_BYTE */
|
|
||||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
||||||
|
#define GL_FRAGMENT_SHADER 0x8B30
|
||||||
/* Shaders */
|
#define GL_VERTEX_SHADER 0x8B31
|
||||||
#define GL_FRAGMENT_SHADER 0x8B30
|
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
||||||
#define GL_VERTEX_SHADER 0x8B31
|
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
|
||||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
#define GL_MAX_VARYING_VECTORS 0x8DFC
|
||||||
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
|
|
||||||
#define GL_MAX_VARYING_VECTORS 0x8DFC
|
|
||||||
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
||||||
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
|
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
|
||||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
||||||
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
|
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
|
||||||
#define GL_SHADER_TYPE 0x8B4F
|
#define GL_SHADER_TYPE 0x8B4F
|
||||||
#define GL_DELETE_STATUS 0x8B80
|
#define GL_DELETE_STATUS 0x8B80
|
||||||
#define GL_LINK_STATUS 0x8B82
|
#define GL_LINK_STATUS 0x8B82
|
||||||
#define GL_VALIDATE_STATUS 0x8B83
|
#define GL_VALIDATE_STATUS 0x8B83
|
||||||
#define GL_ATTACHED_SHADERS 0x8B85
|
#define GL_ATTACHED_SHADERS 0x8B85
|
||||||
#define GL_ACTIVE_UNIFORMS 0x8B86
|
#define GL_ACTIVE_UNIFORMS 0x8B86
|
||||||
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
||||||
#define GL_ACTIVE_ATTRIBUTES 0x8B89
|
#define GL_ACTIVE_ATTRIBUTES 0x8B89
|
||||||
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
||||||
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
|
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
|
||||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
#define GL_CURRENT_PROGRAM 0x8B8D
|
||||||
|
|
||||||
/* StencilFunction */
|
|
||||||
#define GL_NEVER 0x0200
|
#define GL_NEVER 0x0200
|
||||||
#define GL_LESS 0x0201
|
#define GL_LESS 0x0201
|
||||||
#define GL_EQUAL 0x0202
|
#define GL_EQUAL 0x0202
|
||||||
@@ -286,9 +225,6 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_NOTEQUAL 0x0205
|
#define GL_NOTEQUAL 0x0205
|
||||||
#define GL_GEQUAL 0x0206
|
#define GL_GEQUAL 0x0206
|
||||||
#define GL_ALWAYS 0x0207
|
#define GL_ALWAYS 0x0207
|
||||||
|
|
||||||
/* StencilOp */
|
|
||||||
/* GL_ZERO */
|
|
||||||
#define GL_KEEP 0x1E00
|
#define GL_KEEP 0x1E00
|
||||||
#define GL_REPLACE 0x1E01
|
#define GL_REPLACE 0x1E01
|
||||||
#define GL_INCR 0x1E02
|
#define GL_INCR 0x1E02
|
||||||
@@ -296,35 +232,21 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_INVERT 0x150A
|
#define GL_INVERT 0x150A
|
||||||
#define GL_INCR_WRAP 0x8507
|
#define GL_INCR_WRAP 0x8507
|
||||||
#define GL_DECR_WRAP 0x8508
|
#define GL_DECR_WRAP 0x8508
|
||||||
|
|
||||||
/* StringName */
|
|
||||||
#define GL_VENDOR 0x1F00
|
#define GL_VENDOR 0x1F00
|
||||||
#define GL_RENDERER 0x1F01
|
#define GL_RENDERER 0x1F01
|
||||||
#define GL_VERSION 0x1F02
|
#define GL_VERSION 0x1F02
|
||||||
#define GL_EXTENSIONS 0x1F03
|
#define GL_EXTENSIONS 0x1F03
|
||||||
|
|
||||||
/* TextureMagFilter */
|
|
||||||
#define GL_NEAREST 0x2600
|
#define GL_NEAREST 0x2600
|
||||||
#define GL_LINEAR 0x2601
|
#define GL_LINEAR 0x2601
|
||||||
|
|
||||||
/* TextureMinFilter */
|
|
||||||
/* GL_NEAREST */
|
|
||||||
/* GL_LINEAR */
|
|
||||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
||||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
||||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
||||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||||
|
|
||||||
/* TextureParameterName */
|
|
||||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||||
#define GL_TEXTURE_WRAP_S 0x2802
|
#define GL_TEXTURE_WRAP_S 0x2802
|
||||||
#define GL_TEXTURE_WRAP_T 0x2803
|
#define GL_TEXTURE_WRAP_T 0x2803
|
||||||
|
|
||||||
/* TextureTarget */
|
|
||||||
/* GL_TEXTURE_2D */
|
|
||||||
#define GL_TEXTURE 0x1702
|
#define GL_TEXTURE 0x1702
|
||||||
|
|
||||||
#define GL_TEXTURE_CUBE_MAP 0x8513
|
#define GL_TEXTURE_CUBE_MAP 0x8513
|
||||||
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
|
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
|
||||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
||||||
@@ -334,8 +256,6 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
|
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
|
||||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
||||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
||||||
|
|
||||||
/* TextureUnit */
|
|
||||||
#define GL_TEXTURE0 0x84C0
|
#define GL_TEXTURE0 0x84C0
|
||||||
#define GL_TEXTURE1 0x84C1
|
#define GL_TEXTURE1 0x84C1
|
||||||
#define GL_TEXTURE2 0x84C2
|
#define GL_TEXTURE2 0x84C2
|
||||||
@@ -369,13 +289,9 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_TEXTURE30 0x84DE
|
#define GL_TEXTURE30 0x84DE
|
||||||
#define GL_TEXTURE31 0x84DF
|
#define GL_TEXTURE31 0x84DF
|
||||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||||
|
|
||||||
/* TextureWrapMode */
|
|
||||||
#define GL_REPEAT 0x2901
|
#define GL_REPEAT 0x2901
|
||||||
#define GL_CLAMP_TO_EDGE 0x812F
|
#define GL_CLAMP_TO_EDGE 0x812F
|
||||||
#define GL_MIRRORED_REPEAT 0x8370
|
#define GL_MIRRORED_REPEAT 0x8370
|
||||||
|
|
||||||
/* Uniform Types */
|
|
||||||
#define GL_FLOAT_VEC2 0x8B50
|
#define GL_FLOAT_VEC2 0x8B50
|
||||||
#define GL_FLOAT_VEC3 0x8B51
|
#define GL_FLOAT_VEC3 0x8B51
|
||||||
#define GL_FLOAT_VEC4 0x8B52
|
#define GL_FLOAT_VEC4 0x8B52
|
||||||
@@ -391,48 +307,34 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_FLOAT_MAT4 0x8B5C
|
#define GL_FLOAT_MAT4 0x8B5C
|
||||||
#define GL_SAMPLER_2D 0x8B5E
|
#define GL_SAMPLER_2D 0x8B5E
|
||||||
#define GL_SAMPLER_CUBE 0x8B60
|
#define GL_SAMPLER_CUBE 0x8B60
|
||||||
|
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
||||||
/* Vertex Arrays */
|
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
|
||||||
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
|
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
|
||||||
|
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
|
||||||
/* Read Format */
|
|
||||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
|
|
||||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
|
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
|
||||||
|
|
||||||
/* Shader Source */
|
|
||||||
#define GL_COMPILE_STATUS 0x8B81
|
#define GL_COMPILE_STATUS 0x8B81
|
||||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
#define GL_INFO_LOG_LENGTH 0x8B84
|
||||||
#define GL_SHADER_SOURCE_LENGTH 0x8B88
|
#define GL_SHADER_SOURCE_LENGTH 0x8B88
|
||||||
#define GL_SHADER_COMPILER 0x8DFA
|
#define GL_SHADER_COMPILER 0x8DFA
|
||||||
|
|
||||||
/* Shader Binary */
|
|
||||||
#define GL_SHADER_BINARY_FORMATS 0x8DF8
|
#define GL_SHADER_BINARY_FORMATS 0x8DF8
|
||||||
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
|
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
|
||||||
|
|
||||||
/* Shader Precision-Specified Types */
|
|
||||||
#define GL_LOW_FLOAT 0x8DF0
|
#define GL_LOW_FLOAT 0x8DF0
|
||||||
#define GL_MEDIUM_FLOAT 0x8DF1
|
#define GL_MEDIUM_FLOAT 0x8DF1
|
||||||
#define GL_HIGH_FLOAT 0x8DF2
|
#define GL_HIGH_FLOAT 0x8DF2
|
||||||
#define GL_LOW_INT 0x8DF3
|
#define GL_LOW_INT 0x8DF3
|
||||||
#define GL_MEDIUM_INT 0x8DF4
|
#define GL_MEDIUM_INT 0x8DF4
|
||||||
#define GL_HIGH_INT 0x8DF5
|
#define GL_HIGH_INT 0x8DF5
|
||||||
|
|
||||||
/* Framebuffer Object. */
|
|
||||||
#define GL_FRAMEBUFFER 0x8D40
|
#define GL_FRAMEBUFFER 0x8D40
|
||||||
#define GL_RENDERBUFFER 0x8D41
|
#define GL_RENDERBUFFER 0x8D41
|
||||||
|
|
||||||
#define GL_RGBA4 0x8056
|
#define GL_RGBA4 0x8056
|
||||||
#define GL_RGB5_A1 0x8057
|
#define GL_RGB5_A1 0x8057
|
||||||
#define GL_RGB565 0x8D62
|
#define GL_RGB565 0x8D62
|
||||||
#define GL_DEPTH_COMPONENT16 0x81A5
|
#define GL_DEPTH_COMPONENT16 0x81A5
|
||||||
#define GL_STENCIL_INDEX8 0x8D48
|
#define GL_STENCIL_INDEX8 0x8D48
|
||||||
|
|
||||||
#define GL_RENDERBUFFER_WIDTH 0x8D42
|
#define GL_RENDERBUFFER_WIDTH 0x8D42
|
||||||
#define GL_RENDERBUFFER_HEIGHT 0x8D43
|
#define GL_RENDERBUFFER_HEIGHT 0x8D43
|
||||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
|
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
|
||||||
@@ -442,180 +344,313 @@ typedef khronos_ssize_t GLsizeiptr;
|
|||||||
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
|
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
|
||||||
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
|
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
|
||||||
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
|
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
|
||||||
|
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
|
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
|
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
|
|
||||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
|
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
|
||||||
|
|
||||||
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
||||||
#define GL_DEPTH_ATTACHMENT 0x8D00
|
#define GL_DEPTH_ATTACHMENT 0x8D00
|
||||||
#define GL_STENCIL_ATTACHMENT 0x8D20
|
#define GL_STENCIL_ATTACHMENT 0x8D20
|
||||||
|
|
||||||
#define GL_NONE 0
|
#define GL_NONE 0
|
||||||
|
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
||||||
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
||||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
|
||||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
||||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
||||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
||||||
|
|
||||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
||||||
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
||||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
||||||
|
|
||||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
||||||
|
typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||||
/*-------------------------------------------------------------------------
|
typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
|
||||||
* GL core functions.
|
typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
|
||||||
*-----------------------------------------------------------------------*/
|
typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
|
||||||
|
typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
|
||||||
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
|
typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
|
||||||
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
|
typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
|
||||||
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
|
typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||||
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
||||||
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
|
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
|
||||||
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
|
typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
|
||||||
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||||
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||||
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
|
typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
|
||||||
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
|
typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
|
||||||
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
|
||||||
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||||
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
|
typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
|
||||||
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
|
typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
|
||||||
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
|
typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||||
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
|
typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
|
||||||
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
|
||||||
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
|
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
|
||||||
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
|
typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||||
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
|
typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
|
||||||
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
|
typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
|
||||||
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
|
typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
|
||||||
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
|
||||||
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
|
||||||
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
|
typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
|
||||||
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
|
typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||||
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
|
typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
|
||||||
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
|
typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
|
||||||
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
|
typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
|
||||||
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
|
typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
|
||||||
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
|
typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
|
||||||
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
|
typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
|
||||||
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
|
typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
|
||||||
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
|
typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
|
||||||
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
|
typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
|
||||||
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
|
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||||
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
|
typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
|
||||||
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
|
typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
|
||||||
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
|
typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
|
||||||
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
|
||||||
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
|
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||||
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
|
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||||
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
|
typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
|
||||||
GL_APICALL void GL_APIENTRY glFinish (void);
|
typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
|
||||||
GL_APICALL void GL_APIENTRY glFlush (void);
|
typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
|
||||||
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
|
||||||
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
|
||||||
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
|
typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
|
||||||
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
|
typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||||
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
|
typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||||
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
|
typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
|
||||||
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
|
typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||||
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
|
typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
|
||||||
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
|
||||||
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
|
typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
|
||||||
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
|
typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
|
typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
|
||||||
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
|
||||||
GL_APICALL GLenum GL_APIENTRY glGetError (void);
|
typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||||
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
|
typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
|
typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
|
typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||||
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
|
typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
|
||||||
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
|
||||||
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
|
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
|
typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
|
typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
|
||||||
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
|
typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||||
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
|
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
|
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
|
||||||
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
|
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
|
||||||
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
|
typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
|
||||||
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
|
typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
|
||||||
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
|
typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
|
||||||
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
|
typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
|
||||||
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
|
typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
|
||||||
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
|
typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
|
typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
|
typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
|
typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
|
||||||
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||||
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
|
typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
|
||||||
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
|
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||||
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
|
||||||
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||||
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||||
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
|
||||||
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
|
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||||
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
|
||||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
|
typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
|
||||||
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
|
typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
|
||||||
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
|
||||||
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||||
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
|
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
|
||||||
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
|
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
|
||||||
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
|
||||||
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
|
||||||
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
|
||||||
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
|
||||||
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||||
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
|
||||||
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||||
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
|
||||||
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
|
||||||
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
|
||||||
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
|
||||||
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
||||||
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
|
||||||
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
|
typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
|
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
|
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||||
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
|
typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
|
||||||
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
|
typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
|
||||||
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
|
||||||
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
|
||||||
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
|
||||||
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
|
||||||
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
|
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
|
typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
|
#if GL_GLES_PROTOTYPES
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
|
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
|
||||||
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
|
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
|
||||||
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
||||||
|
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
|
||||||
|
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
|
||||||
|
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||||
|
GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||||
|
GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
|
||||||
|
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
|
||||||
|
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
||||||
|
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||||
|
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||||
|
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
|
||||||
|
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
|
||||||
|
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
|
||||||
|
GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||||
|
GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
|
||||||
|
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
|
||||||
|
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||||
|
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
|
||||||
|
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
|
||||||
|
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
|
||||||
|
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||||
|
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
|
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
|
||||||
|
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
|
||||||
|
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
|
||||||
|
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
|
||||||
|
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
|
||||||
|
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
|
||||||
|
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
|
||||||
|
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
|
||||||
|
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
|
||||||
|
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
|
||||||
|
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
|
||||||
|
GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
|
||||||
|
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
|
||||||
|
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
|
||||||
|
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
|
||||||
|
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
||||||
|
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||||
|
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
|
||||||
|
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
|
||||||
|
GL_APICALL void GL_APIENTRY glFinish (void);
|
||||||
|
GL_APICALL void GL_APIENTRY glFlush (void);
|
||||||
|
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||||
|
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||||
|
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
|
||||||
|
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
|
||||||
|
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
|
||||||
|
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
|
||||||
|
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
|
||||||
|
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
|
||||||
|
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||||
|
GL_APICALL GLenum GL_APIENTRY glGetError (void);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
|
||||||
|
GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
|
||||||
|
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
|
||||||
|
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
||||||
|
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
||||||
|
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
||||||
|
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
|
||||||
|
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
|
||||||
|
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
|
||||||
|
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
|
||||||
|
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
||||||
|
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
|
||||||
|
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
|
||||||
|
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||||
|
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
||||||
|
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||||
|
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
||||||
|
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||||
|
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
|
||||||
|
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
|
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||||
|
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||||
|
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||||
|
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||||
|
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
|
||||||
|
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
|
||||||
|
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
||||||
|
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
|
||||||
|
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||||
|
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
||||||
|
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
||||||
|
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
|
||||||
|
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||||
|
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
|
||||||
|
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
|
||||||
|
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
|
||||||
|
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
|
#endif
|
||||||
|
#endif /* GL_ES_VERSION_2_0 */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __gl2_h_ */
|
#endif
|
||||||
|
|
||||||
|
|||||||
+3558
-1575
File diff suppressed because it is too large
Load Diff
@@ -1,20 +1,17 @@
|
|||||||
#ifndef __gl2platform_h_
|
#ifndef __gl2platform_h_
|
||||||
#define __gl2platform_h_
|
#define __gl2platform_h_
|
||||||
|
|
||||||
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This document is licensed under the SGI Free Software B License Version
|
** Copyright 2017-2020 The Khronos Group Inc.
|
||||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
** SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
||||||
*
|
*
|
||||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||||
* You are encouraged to submit all modifications to the Khronos group so that
|
* Please contribute modifications back to Khronos as pull requests on the
|
||||||
* they can be included in future versions of this file. Please submit changes
|
* public github repository:
|
||||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
* https://github.com/KhronosGroup/OpenGL-Registry
|
||||||
* by filing a bug against product "OpenGL-ES" component "Registry".
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*#include <KHR/khrplatform.h>*/
|
/*#include <KHR/khrplatform.h>*/
|
||||||
|
|||||||
+43
-14
@@ -2,7 +2,7 @@
|
|||||||
#define __khrplatform_h_
|
#define __khrplatform_h_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Copyright (c) 2008-2009 The Khronos Group Inc.
|
** Copyright (c) 2008-2018 The Khronos Group Inc.
|
||||||
**
|
**
|
||||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
** copy of this software and/or associated documentation files (the
|
** copy of this software and/or associated documentation files (the
|
||||||
@@ -26,18 +26,16 @@
|
|||||||
|
|
||||||
/* Khronos platform-specific types and definitions.
|
/* Khronos platform-specific types and definitions.
|
||||||
*
|
*
|
||||||
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
|
* The master copy of khrplatform.h is maintained in the Khronos EGL
|
||||||
|
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||||
|
* The last semantic modification to khrplatform.h was at commit ID:
|
||||||
|
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||||
*
|
*
|
||||||
* Adopters may modify this file to suit their platform. Adopters are
|
* Adopters may modify this file to suit their platform. Adopters are
|
||||||
* encouraged to submit platform specific modifications to the Khronos
|
* encouraged to submit platform specific modifications to the Khronos
|
||||||
* group so that they can be included in future versions of this file.
|
* group so that they can be included in future versions of this file.
|
||||||
* Please submit changes by sending them to the public Khronos Bugzilla
|
* Please submit changes by filing pull requests or issues on
|
||||||
* (http://khronos.org/bugzilla) by filing a bug against product
|
* the EGL Registry repository linked above.
|
||||||
* "Khronos (general)" component "Registry".
|
|
||||||
*
|
|
||||||
* A predefined template which fills in some of the bug fields can be
|
|
||||||
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
|
|
||||||
* must create a Bugzilla login first.
|
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* See the Implementer's Guidelines for information about where this file
|
* See the Implementer's Guidelines for information about where this file
|
||||||
@@ -92,15 +90,25 @@
|
|||||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||||
|
# define KHRONOS_STATIC 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Definition of KHRONOS_APICALL
|
* Definition of KHRONOS_APICALL
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
* This precedes the return type of the function in the function prototype.
|
* This precedes the return type of the function in the function prototype.
|
||||||
*/
|
*/
|
||||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
#if defined(KHRONOS_STATIC)
|
||||||
|
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||||
|
* header compatible with static linking. */
|
||||||
|
# define KHRONOS_APICALL
|
||||||
|
#elif defined(_WIN32)
|
||||||
# define KHRONOS_APICALL __declspec(dllimport)
|
# define KHRONOS_APICALL __declspec(dllimport)
|
||||||
#elif defined (__SYMBIAN32__)
|
#elif defined (__SYMBIAN32__)
|
||||||
# define KHRONOS_APICALL IMPORT_C
|
# define KHRONOS_APICALL IMPORT_C
|
||||||
|
#elif defined(__ANDROID__)
|
||||||
|
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||||
#else
|
#else
|
||||||
# define KHRONOS_APICALL
|
# define KHRONOS_APICALL
|
||||||
#endif
|
#endif
|
||||||
@@ -145,6 +153,20 @@ typedef int64_t khronos_int64_t;
|
|||||||
typedef uint64_t khronos_uint64_t;
|
typedef uint64_t khronos_uint64_t;
|
||||||
#define KHRONOS_SUPPORT_INT64 1
|
#define KHRONOS_SUPPORT_INT64 1
|
||||||
#define KHRONOS_SUPPORT_FLOAT 1
|
#define KHRONOS_SUPPORT_FLOAT 1
|
||||||
|
/*
|
||||||
|
* To support platform where unsigned long cannot be used interchangeably with
|
||||||
|
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||||
|
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||||
|
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||||
|
* unsigned long long or similar (this results in different C++ name mangling).
|
||||||
|
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||||
|
* platforms where the size of a pointer is larger than the size of long.
|
||||||
|
*/
|
||||||
|
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||||
|
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||||
|
#define KHRONOS_USE_INTPTR_T
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif defined(__VMS ) || defined(__sgi)
|
#elif defined(__VMS ) || defined(__sgi)
|
||||||
|
|
||||||
@@ -223,18 +245,25 @@ typedef signed short int khronos_int16_t;
|
|||||||
typedef unsigned short int khronos_uint16_t;
|
typedef unsigned short int khronos_uint16_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||||
* to be the only LLP64 architecture in current use.
|
* to be the only LLP64 architecture in current use.
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN64
|
#ifdef KHRONOS_USE_INTPTR_T
|
||||||
|
typedef intptr_t khronos_intptr_t;
|
||||||
|
typedef uintptr_t khronos_uintptr_t;
|
||||||
|
#elif defined(_WIN64)
|
||||||
typedef signed long long int khronos_intptr_t;
|
typedef signed long long int khronos_intptr_t;
|
||||||
typedef unsigned long long int khronos_uintptr_t;
|
typedef unsigned long long int khronos_uintptr_t;
|
||||||
typedef signed long long int khronos_ssize_t;
|
|
||||||
typedef unsigned long long int khronos_usize_t;
|
|
||||||
#else
|
#else
|
||||||
typedef signed long int khronos_intptr_t;
|
typedef signed long int khronos_intptr_t;
|
||||||
typedef unsigned long int khronos_uintptr_t;
|
typedef unsigned long int khronos_uintptr_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_WIN64)
|
||||||
|
typedef signed long long int khronos_ssize_t;
|
||||||
|
typedef unsigned long long int khronos_usize_t;
|
||||||
|
#else
|
||||||
typedef signed long int khronos_ssize_t;
|
typedef signed long int khronos_ssize_t;
|
||||||
typedef unsigned long int khronos_usize_t;
|
typedef unsigned long int khronos_usize_t;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+33
-7
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -65,11 +65,15 @@
|
|||||||
#undef __LINUX__ /* do we need to do this? */
|
#undef __LINUX__ /* do we need to do this? */
|
||||||
#define __ANDROID__ 1
|
#define __ANDROID__ 1
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__NGAGE__)
|
||||||
|
#undef __NGAGE__
|
||||||
|
#define __NGAGE__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
/* lets us know what version of Mac OS X we're compiling on */
|
/* lets us know what version of Mac OS X we're compiling on */
|
||||||
#include "AvailabilityMacros.h"
|
#include <AvailabilityMacros.h>
|
||||||
#include "TargetConditionals.h"
|
#include <TargetConditionals.h>
|
||||||
|
|
||||||
/* Fix building with older SDKs that don't define these
|
/* Fix building with older SDKs that don't define these
|
||||||
See this for more information:
|
See this for more information:
|
||||||
@@ -104,9 +108,9 @@
|
|||||||
/* if not compiling for iOS */
|
/* if not compiling for iOS */
|
||||||
#undef __MACOSX__
|
#undef __MACOSX__
|
||||||
#define __MACOSX__ 1
|
#define __MACOSX__ 1
|
||||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||||
# error SDL for Mac OS X only supports deploying on 10.6 and above.
|
# error SDL for Mac OS X only supports deploying on 10.7 and above.
|
||||||
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1060 */
|
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1070 */
|
||||||
#endif /* TARGET_OS_IPHONE */
|
#endif /* TARGET_OS_IPHONE */
|
||||||
#endif /* defined(__APPLE__) */
|
#endif /* defined(__APPLE__) */
|
||||||
|
|
||||||
@@ -140,7 +144,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||||
/* Try to find out if we're compiling for WinRT or non-WinRT */
|
/* Try to find out if we're compiling for WinRT, GDK or non-WinRT/GDK */
|
||||||
#if defined(_MSC_VER) && defined(__has_include)
|
#if defined(_MSC_VER) && defined(__has_include)
|
||||||
#if __has_include(<winapifamily.h>)
|
#if __has_include(<winapifamily.h>)
|
||||||
#define HAVE_WINAPIFAMILY_H 1
|
#define HAVE_WINAPIFAMILY_H 1
|
||||||
@@ -165,6 +169,15 @@
|
|||||||
#if WINAPI_FAMILY_WINRT
|
#if WINAPI_FAMILY_WINRT
|
||||||
#undef __WINRT__
|
#undef __WINRT__
|
||||||
#define __WINRT__ 1
|
#define __WINRT__ 1
|
||||||
|
#elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */
|
||||||
|
#undef __WINGDK__
|
||||||
|
#define __WINGDK__ 1
|
||||||
|
#elif defined(_GAMING_XBOX_XBOXONE)
|
||||||
|
#undef __XBOXONE__
|
||||||
|
#define __XBOXONE__ 1
|
||||||
|
#elif defined(_GAMING_XBOX_SCARLETT)
|
||||||
|
#undef __XBOXSERIES__
|
||||||
|
#define __XBOXSERIES__ 1
|
||||||
#else
|
#else
|
||||||
#undef __WINDOWS__
|
#undef __WINDOWS__
|
||||||
#define __WINDOWS__ 1
|
#define __WINDOWS__ 1
|
||||||
@@ -175,10 +188,18 @@
|
|||||||
#undef __WIN32__
|
#undef __WIN32__
|
||||||
#define __WIN32__ 1
|
#define __WIN32__ 1
|
||||||
#endif
|
#endif
|
||||||
|
/* This is to support generic "any GDK" separate from a platform-specific GDK */
|
||||||
|
#if defined(__WINGDK__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||||
|
#undef __GDK__
|
||||||
|
#define __GDK__ 1
|
||||||
|
#endif
|
||||||
#if defined(__PSP__)
|
#if defined(__PSP__)
|
||||||
#undef __PSP__
|
#undef __PSP__
|
||||||
#define __PSP__ 1
|
#define __PSP__ 1
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(PS2)
|
||||||
|
#define __PS2__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The NACL compiler defines __native_client__ and __pnacl__
|
/* The NACL compiler defines __native_client__ and __pnacl__
|
||||||
* Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
|
* Ref: http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
|
||||||
@@ -200,6 +221,11 @@
|
|||||||
#define __VITA__ 1
|
#define __VITA__ 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__3DS__)
|
||||||
|
#undef __3DS__
|
||||||
|
#define __3DS__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
/* Set up for C function definitions, even when using C++ */
|
/* Set up for C function definitions, even when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
+8
-9
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -48,7 +48,6 @@ typedef enum
|
|||||||
SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
|
SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */
|
||||||
} SDL_PowerState;
|
} SDL_PowerState;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current power supply details.
|
* Get the current power supply details.
|
||||||
*
|
*
|
||||||
@@ -65,17 +64,17 @@ typedef enum
|
|||||||
* It's possible a platform can only report battery percentage or time left
|
* It's possible a platform can only report battery percentage or time left
|
||||||
* but not both.
|
* but not both.
|
||||||
*
|
*
|
||||||
* \param secs seconds of battery life left, you can pass a NULL here if you
|
* \param seconds seconds of battery life left, you can pass a NULL here if
|
||||||
* don't care, will return -1 if we can't determine a value, or
|
* you don't care, will return -1 if we can't determine a
|
||||||
* we're not running on a battery
|
* value, or we're not running on a battery
|
||||||
* \param pct percentage of battery life left, between 0 and 100, you can pass
|
* \param percent percentage of battery life left, between 0 and 100, you can
|
||||||
* a NULL here if you don't care, will return -1 if we can't
|
* pass a NULL here if you don't care, will return -1 if we
|
||||||
* determine a value, or we're not running on a battery
|
* can't determine a value, or we're not running on a battery
|
||||||
* \returns an SDL_PowerState enum representing the current battery state.
|
* \returns an SDL_PowerState enum representing the current battery state.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct);
|
extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *seconds, int *percent);
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
/* Ends C function definitions when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+155
-3
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -54,8 +54,8 @@ typedef struct SDL_Point
|
|||||||
/**
|
/**
|
||||||
* The structure that defines a point (floating point)
|
* The structure that defines a point (floating point)
|
||||||
*
|
*
|
||||||
* \sa SDL_EnclosePoints
|
* \sa SDL_EncloseFPoints
|
||||||
* \sa SDL_PointInRect
|
* \sa SDL_PointInFRect
|
||||||
*/
|
*/
|
||||||
typedef struct SDL_FPoint
|
typedef struct SDL_FPoint
|
||||||
{
|
{
|
||||||
@@ -71,6 +71,7 @@ typedef struct SDL_FPoint
|
|||||||
* \sa SDL_RectEquals
|
* \sa SDL_RectEquals
|
||||||
* \sa SDL_HasIntersection
|
* \sa SDL_HasIntersection
|
||||||
* \sa SDL_IntersectRect
|
* \sa SDL_IntersectRect
|
||||||
|
* \sa SDL_IntersectRectAndLine
|
||||||
* \sa SDL_UnionRect
|
* \sa SDL_UnionRect
|
||||||
* \sa SDL_EnclosePoints
|
* \sa SDL_EnclosePoints
|
||||||
*/
|
*/
|
||||||
@@ -83,6 +84,16 @@ typedef struct SDL_Rect
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A rectangle, with the origin at the upper left (floating point).
|
* A rectangle, with the origin at the upper left (floating point).
|
||||||
|
*
|
||||||
|
* \sa SDL_FRectEmpty
|
||||||
|
* \sa SDL_FRectEquals
|
||||||
|
* \sa SDL_FRectEqualsEpsilon
|
||||||
|
* \sa SDL_HasIntersectionF
|
||||||
|
* \sa SDL_IntersectFRect
|
||||||
|
* \sa SDL_IntersectFRectAndLine
|
||||||
|
* \sa SDL_UnionFRect
|
||||||
|
* \sa SDL_EncloseFPoints
|
||||||
|
* \sa SDL_PointInFRect
|
||||||
*/
|
*/
|
||||||
typedef struct SDL_FRect
|
typedef struct SDL_FRect
|
||||||
{
|
{
|
||||||
@@ -213,6 +224,147 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect *
|
|||||||
int *Y1, int *X2,
|
int *Y1, int *X2,
|
||||||
int *Y2);
|
int *Y2);
|
||||||
|
|
||||||
|
|
||||||
|
/* SDL_FRect versions... */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if point resides inside a rectangle.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE SDL_bool SDL_PointInFRect(const SDL_FPoint *p, const SDL_FRect *r)
|
||||||
|
{
|
||||||
|
return ( (p->x >= r->x) && (p->x < (r->x + r->w)) &&
|
||||||
|
(p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the rectangle has no area.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE SDL_bool SDL_FRectEmpty(const SDL_FRect *r)
|
||||||
|
{
|
||||||
|
return ((!r) || (r->w <= 0.0f) || (r->h <= 0.0f)) ? SDL_TRUE : SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the two rectangles are equal, within some given epsilon.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE SDL_bool SDL_FRectEqualsEpsilon(const SDL_FRect *a, const SDL_FRect *b, const float epsilon)
|
||||||
|
{
|
||||||
|
return (a && b && ((a == b) ||
|
||||||
|
((SDL_fabsf(a->x - b->x) <= epsilon) &&
|
||||||
|
(SDL_fabsf(a->y - b->y) <= epsilon) &&
|
||||||
|
(SDL_fabsf(a->w - b->w) <= epsilon) &&
|
||||||
|
(SDL_fabsf(a->h - b->h) <= epsilon))))
|
||||||
|
? SDL_TRUE : SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if the two rectangles are equal, using a default epsilon.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE SDL_bool SDL_FRectEquals(const SDL_FRect *a, const SDL_FRect *b)
|
||||||
|
{
|
||||||
|
return SDL_FRectEqualsEpsilon(a, b, SDL_FLT_EPSILON);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether two rectangles intersect with float precision.
|
||||||
|
*
|
||||||
|
* If either pointer is NULL the function will return SDL_FALSE.
|
||||||
|
*
|
||||||
|
* \param A an SDL_FRect structure representing the first rectangle
|
||||||
|
* \param B an SDL_FRect structure representing the second rectangle
|
||||||
|
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*
|
||||||
|
* \sa SDL_IntersectRect
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersectionF(const SDL_FRect * A,
|
||||||
|
const SDL_FRect * B);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the intersection of two rectangles with float precision.
|
||||||
|
*
|
||||||
|
* If `result` is NULL then this function will return SDL_FALSE.
|
||||||
|
*
|
||||||
|
* \param A an SDL_FRect structure representing the first rectangle
|
||||||
|
* \param B an SDL_FRect structure representing the second rectangle
|
||||||
|
* \param result an SDL_FRect structure filled in with the intersection of
|
||||||
|
* rectangles `A` and `B`
|
||||||
|
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*
|
||||||
|
* \sa SDL_HasIntersectionF
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRect(const SDL_FRect * A,
|
||||||
|
const SDL_FRect * B,
|
||||||
|
SDL_FRect * result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the union of two rectangles with float precision.
|
||||||
|
*
|
||||||
|
* \param A an SDL_FRect structure representing the first rectangle
|
||||||
|
* \param B an SDL_FRect structure representing the second rectangle
|
||||||
|
* \param result an SDL_FRect structure filled in with the union of rectangles
|
||||||
|
* `A` and `B`
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_UnionFRect(const SDL_FRect * A,
|
||||||
|
const SDL_FRect * B,
|
||||||
|
SDL_FRect * result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate a minimal rectangle enclosing a set of points with float
|
||||||
|
* precision.
|
||||||
|
*
|
||||||
|
* If `clip` is not NULL then only points inside of the clipping rectangle are
|
||||||
|
* considered.
|
||||||
|
*
|
||||||
|
* \param points an array of SDL_FPoint structures representing points to be
|
||||||
|
* enclosed
|
||||||
|
* \param count the number of structures in the `points` array
|
||||||
|
* \param clip an SDL_FRect used for clipping or NULL to enclose all points
|
||||||
|
* \param result an SDL_FRect structure filled in with the minimal enclosing
|
||||||
|
* rectangle
|
||||||
|
* \returns SDL_TRUE if any points were enclosed or SDL_FALSE if all the
|
||||||
|
* points were outside of the clipping rectangle.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_EncloseFPoints(const SDL_FPoint * points,
|
||||||
|
int count,
|
||||||
|
const SDL_FRect * clip,
|
||||||
|
SDL_FRect * result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the intersection of a rectangle and line segment with float
|
||||||
|
* precision.
|
||||||
|
*
|
||||||
|
* This function is used to clip a line segment to a rectangle. A line segment
|
||||||
|
* contained entirely within the rectangle or that does not intersect will
|
||||||
|
* remain unchanged. A line segment that crosses the rectangle at either or
|
||||||
|
* both ends will be clipped to the boundary of the rectangle and the new
|
||||||
|
* coordinates saved in `X1`, `Y1`, `X2`, and/or `Y2` as necessary.
|
||||||
|
*
|
||||||
|
* \param rect an SDL_FRect structure representing the rectangle to intersect
|
||||||
|
* \param X1 a pointer to the starting X-coordinate of the line
|
||||||
|
* \param Y1 a pointer to the starting Y-coordinate of the line
|
||||||
|
* \param X2 a pointer to the ending X-coordinate of the line
|
||||||
|
* \param Y2 a pointer to the ending Y-coordinate of the line
|
||||||
|
* \returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_bool SDLCALL SDL_IntersectFRectAndLine(const SDL_FRect *
|
||||||
|
rect, float *X1,
|
||||||
|
float *Y1, float *X2,
|
||||||
|
float *Y2);
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
/* Ends C function definitions when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
+52
-18
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -261,6 +261,17 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface *
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
|
extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the window associated with a renderer.
|
||||||
|
*
|
||||||
|
* \param renderer the renderer to query
|
||||||
|
* \returns the window on success or NULL on failure; call SDL_GetError() for
|
||||||
|
* more information.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC SDL_Window * SDLCALL SDL_RenderGetWindow(SDL_Renderer *renderer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get information about a rendering context.
|
* Get information about a rendering context.
|
||||||
*
|
*
|
||||||
@@ -356,11 +367,15 @@ extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer
|
|||||||
* \param texture the texture to query
|
* \param texture the texture to query
|
||||||
* \param format a pointer filled in with the raw format of the texture; the
|
* \param format a pointer filled in with the raw format of the texture; the
|
||||||
* actual format may differ, but pixel transfers will use this
|
* actual format may differ, but pixel transfers will use this
|
||||||
* format (one of the SDL_PixelFormatEnum values)
|
* format (one of the SDL_PixelFormatEnum values). This argument
|
||||||
|
* can be NULL if you don't need this information.
|
||||||
* \param access a pointer filled in with the actual access to the texture
|
* \param access a pointer filled in with the actual access to the texture
|
||||||
* (one of the SDL_TextureAccess values)
|
* (one of the SDL_TextureAccess values). This argument can be
|
||||||
* \param w a pointer filled in with the width of the texture in pixels
|
* NULL if you don't need this information.
|
||||||
* \param h a pointer filled in with the height of the texture in pixels
|
* \param w a pointer filled in with the width of the texture in pixels. This
|
||||||
|
* argument can be NULL if you don't need this information.
|
||||||
|
* \param h a pointer filled in with the height of the texture in pixels. This
|
||||||
|
* argument can be NULL if you don't need this information.
|
||||||
* \returns 0 on success or a negative error code on failure; call
|
* \returns 0 on success or a negative error code on failure; call
|
||||||
* SDL_GetError() for more information.
|
* SDL_GetError() for more information.
|
||||||
*
|
*
|
||||||
@@ -810,9 +825,13 @@ extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, in
|
|||||||
/**
|
/**
|
||||||
* Get device independent resolution for rendering.
|
* Get device independent resolution for rendering.
|
||||||
*
|
*
|
||||||
* This may return 0 for `w` and `h` if the SDL_Renderer has never had its
|
* When using the main rendering target (eg no target texture is set): this
|
||||||
* logical size set by SDL_RenderSetLogicalSize() and never had a render
|
* may return 0 for `w` and `h` if the SDL_Renderer has never had its logical
|
||||||
* target set.
|
* size set by SDL_RenderSetLogicalSize(). Otherwise it returns the logical
|
||||||
|
* width and height.
|
||||||
|
*
|
||||||
|
* When using a target texture: Never return 0 for `w` and `h` at first. Then
|
||||||
|
* it returns the logical width and height that are set.
|
||||||
*
|
*
|
||||||
* \param renderer a rendering context
|
* \param renderer a rendering context
|
||||||
* \param w an int to be filled with the width
|
* \param w an int to be filled with the width
|
||||||
@@ -985,7 +1004,7 @@ extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer,
|
|||||||
* and logical renderer size set
|
* and logical renderer size set
|
||||||
*
|
*
|
||||||
* \param renderer the renderer from which the logical coordinates should be
|
* \param renderer the renderer from which the logical coordinates should be
|
||||||
* calcualted
|
* calculated
|
||||||
* \param windowX the real X coordinate in the window
|
* \param windowX the real X coordinate in the window
|
||||||
* \param windowY the real Y coordinate in the window
|
* \param windowY the real Y coordinate in the window
|
||||||
* \param logicalX the pointer filled with the logical x coordinate
|
* \param logicalX the pointer filled with the logical x coordinate
|
||||||
@@ -1002,19 +1021,23 @@ extern DECLSPEC void SDLCALL SDL_RenderWindowToLogical(SDL_Renderer * renderer,
|
|||||||
int windowX, int windowY,
|
int windowX, int windowY,
|
||||||
float *logicalX, float *logicalY);
|
float *logicalX, float *logicalY);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get real coordinates of point in window when given logical coordinates of point in renderer.
|
/**
|
||||||
* Logical coordinates will differ from real coordinates when render is scaled and logical renderer size set
|
* Get real coordinates of point in window when given logical coordinates of
|
||||||
*
|
* point in renderer.
|
||||||
* \param renderer the renderer from which the window coordinates should be calculated
|
*
|
||||||
|
* Logical coordinates will differ from real coordinates when render is scaled
|
||||||
|
* and logical renderer size set
|
||||||
|
*
|
||||||
|
* \param renderer the renderer from which the window coordinates should be
|
||||||
|
* calculated
|
||||||
* \param logicalX the logical x coordinate
|
* \param logicalX the logical x coordinate
|
||||||
* \param logicalY the logical y coordinate
|
* \param logicalY the logical y coordinate
|
||||||
* \param windowX the pointer filled with the real X coordinate in the window
|
* \param windowX the pointer filled with the real X coordinate in the window
|
||||||
* \param windowY the pointer filled with the real Y coordinate in the window
|
* \param windowY the pointer filled with the real Y coordinate in the window
|
||||||
|
*
|
||||||
*
|
|
||||||
* \since This function is available since SDL 2.0.18.
|
* \since This function is available since SDL 2.0.18.
|
||||||
*
|
*
|
||||||
* \sa SDL_RenderGetScale
|
* \sa SDL_RenderGetScale
|
||||||
* \sa SDL_RenderSetScale
|
* \sa SDL_RenderSetScale
|
||||||
* \sa SDL_RenderGetLogicalSize
|
* \sa SDL_RenderGetLogicalSize
|
||||||
@@ -1603,6 +1626,7 @@ extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer,
|
|||||||
* vertex array Color and alpha modulation is done per vertex
|
* vertex array Color and alpha modulation is done per vertex
|
||||||
* (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
|
* (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
|
||||||
*
|
*
|
||||||
|
* \param renderer The rendering context.
|
||||||
* \param texture (optional) The SDL texture to use.
|
* \param texture (optional) The SDL texture to use.
|
||||||
* \param vertices Vertices.
|
* \param vertices Vertices.
|
||||||
* \param num_vertices Number of vertices.
|
* \param num_vertices Number of vertices.
|
||||||
@@ -1627,6 +1651,7 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer,
|
|||||||
* vertex arrays Color and alpha modulation is done per vertex
|
* vertex arrays Color and alpha modulation is done per vertex
|
||||||
* (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
|
* (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored).
|
||||||
*
|
*
|
||||||
|
* \param renderer The rendering context.
|
||||||
* \param texture (optional) The SDL texture to use.
|
* \param texture (optional) The SDL texture to use.
|
||||||
* \param xy Vertex positions
|
* \param xy Vertex positions
|
||||||
* \param xy_stride Byte size to move from one element to the next element
|
* \param xy_stride Byte size to move from one element to the next element
|
||||||
@@ -1658,7 +1683,8 @@ extern DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
|||||||
* Read pixels from the current rendering target to an array of pixels.
|
* Read pixels from the current rendering target to an array of pixels.
|
||||||
*
|
*
|
||||||
* **WARNING**: This is a very slow operation, and should not be used
|
* **WARNING**: This is a very slow operation, and should not be used
|
||||||
* frequently.
|
* frequently. If you're using this on the main rendering target, it should be
|
||||||
|
* called after rendering and before SDL_RenderPresent().
|
||||||
*
|
*
|
||||||
* `pitch` specifies the number of bytes between rows in the destination
|
* `pitch` specifies the number of bytes between rows in the destination
|
||||||
* `pixels` data. This allows you to write to a subrectangle or have padded
|
* `pixels` data. This allows you to write to a subrectangle or have padded
|
||||||
@@ -1705,6 +1731,11 @@ extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
|
|||||||
*
|
*
|
||||||
* \param renderer the rendering context
|
* \param renderer the rendering context
|
||||||
*
|
*
|
||||||
|
* \threadsafety You may only call this function on the main thread. If this
|
||||||
|
* happens to work on a background thread on any given platform
|
||||||
|
* or backend, it's purely by luck and you should not rely on it
|
||||||
|
* to work next time.
|
||||||
|
*
|
||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
*
|
*
|
||||||
* \sa SDL_RenderClear
|
* \sa SDL_RenderClear
|
||||||
@@ -1739,6 +1770,9 @@ extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
|
|||||||
/**
|
/**
|
||||||
* Destroy the rendering context for a window and free associated textures.
|
* Destroy the rendering context for a window and free associated textures.
|
||||||
*
|
*
|
||||||
|
* If `renderer` is NULL, this function will return immediately after setting
|
||||||
|
* the SDL error message to "Invalid renderer". See SDL_GetError().
|
||||||
|
*
|
||||||
* \param renderer the rendering context
|
* \param renderer the rendering context
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
|
|||||||
+6
-1
@@ -1,2 +1,7 @@
|
|||||||
#define SDL_REVISION "https://github.com/libsdl-org/SDL.git@b424665e0899769b200231ba943353a5fee1b6b6"
|
/* Generated by updaterev.sh, do not edit */
|
||||||
|
#ifdef SDL_VENDOR_INFO
|
||||||
|
#define SDL_REVISION "SDL-release-2.28.2-0-g031912c4b (" SDL_VENDOR_INFO ")"
|
||||||
|
#else
|
||||||
|
#define SDL_REVISION "SDL-release-2.28.2-0-g031912c4b"
|
||||||
|
#endif
|
||||||
#define SDL_REVISION_NUMBER 0
|
#define SDL_REVISION_NUMBER 0
|
||||||
|
|||||||
+2
-16
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -45,9 +45,6 @@ extern "C" {
|
|||||||
#define SDL_RWOPS_JNIFILE 3U /**< Android asset */
|
#define SDL_RWOPS_JNIFILE 3U /**< Android asset */
|
||||||
#define SDL_RWOPS_MEMORY 4U /**< Memory stream */
|
#define SDL_RWOPS_MEMORY 4U /**< Memory stream */
|
||||||
#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
|
#define SDL_RWOPS_MEMORY_RO 5U /**< Read-Only memory stream */
|
||||||
#if defined(__VITA__)
|
|
||||||
#define SDL_RWOPS_VITAFILE 6U /**< Vita file */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the read/write operation structure -- very basic.
|
* This is the read/write operation structure -- very basic.
|
||||||
@@ -101,7 +98,7 @@ typedef struct SDL_RWops
|
|||||||
{
|
{
|
||||||
void *asset;
|
void *asset;
|
||||||
} androidio;
|
} androidio;
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__) || defined(__GDK__)
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
SDL_bool append;
|
SDL_bool append;
|
||||||
@@ -113,17 +110,6 @@ typedef struct SDL_RWops
|
|||||||
size_t left;
|
size_t left;
|
||||||
} buffer;
|
} buffer;
|
||||||
} windowsio;
|
} windowsio;
|
||||||
#elif defined(__VITA__)
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
int h;
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
void *data;
|
|
||||||
size_t size;
|
|
||||||
size_t left;
|
|
||||||
} buffer;
|
|
||||||
} vitaio;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_STDIO_H
|
#ifdef HAVE_STDIO_H
|
||||||
|
|||||||
+47
-22
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -225,16 +225,16 @@ typedef enum
|
|||||||
SDL_SCANCODE_F23 = 114,
|
SDL_SCANCODE_F23 = 114,
|
||||||
SDL_SCANCODE_F24 = 115,
|
SDL_SCANCODE_F24 = 115,
|
||||||
SDL_SCANCODE_EXECUTE = 116,
|
SDL_SCANCODE_EXECUTE = 116,
|
||||||
SDL_SCANCODE_HELP = 117,
|
SDL_SCANCODE_HELP = 117, /**< AL Integrated Help Center */
|
||||||
SDL_SCANCODE_MENU = 118,
|
SDL_SCANCODE_MENU = 118, /**< Menu (show menu) */
|
||||||
SDL_SCANCODE_SELECT = 119,
|
SDL_SCANCODE_SELECT = 119,
|
||||||
SDL_SCANCODE_STOP = 120,
|
SDL_SCANCODE_STOP = 120, /**< AC Stop */
|
||||||
SDL_SCANCODE_AGAIN = 121, /**< redo */
|
SDL_SCANCODE_AGAIN = 121, /**< AC Redo/Repeat */
|
||||||
SDL_SCANCODE_UNDO = 122,
|
SDL_SCANCODE_UNDO = 122, /**< AC Undo */
|
||||||
SDL_SCANCODE_CUT = 123,
|
SDL_SCANCODE_CUT = 123, /**< AC Cut */
|
||||||
SDL_SCANCODE_COPY = 124,
|
SDL_SCANCODE_COPY = 124, /**< AC Copy */
|
||||||
SDL_SCANCODE_PASTE = 125,
|
SDL_SCANCODE_PASTE = 125, /**< AC Paste */
|
||||||
SDL_SCANCODE_FIND = 126,
|
SDL_SCANCODE_FIND = 126, /**< AC Find */
|
||||||
SDL_SCANCODE_MUTE = 127,
|
SDL_SCANCODE_MUTE = 127,
|
||||||
SDL_SCANCODE_VOLUMEUP = 128,
|
SDL_SCANCODE_VOLUMEUP = 128,
|
||||||
SDL_SCANCODE_VOLUMEDOWN = 129,
|
SDL_SCANCODE_VOLUMEDOWN = 129,
|
||||||
@@ -265,9 +265,9 @@ typedef enum
|
|||||||
SDL_SCANCODE_LANG8 = 151, /**< reserved */
|
SDL_SCANCODE_LANG8 = 151, /**< reserved */
|
||||||
SDL_SCANCODE_LANG9 = 152, /**< reserved */
|
SDL_SCANCODE_LANG9 = 152, /**< reserved */
|
||||||
|
|
||||||
SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
|
SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */
|
||||||
SDL_SCANCODE_SYSREQ = 154,
|
SDL_SCANCODE_SYSREQ = 154,
|
||||||
SDL_SCANCODE_CANCEL = 155,
|
SDL_SCANCODE_CANCEL = 155, /**< AC Cancel */
|
||||||
SDL_SCANCODE_CLEAR = 156,
|
SDL_SCANCODE_CLEAR = 156,
|
||||||
SDL_SCANCODE_PRIOR = 157,
|
SDL_SCANCODE_PRIOR = 157,
|
||||||
SDL_SCANCODE_RETURN2 = 158,
|
SDL_SCANCODE_RETURN2 = 158,
|
||||||
@@ -345,6 +345,11 @@ typedef enum
|
|||||||
* \name Usage page 0x0C
|
* \name Usage page 0x0C
|
||||||
*
|
*
|
||||||
* These values are mapped from usage page 0x0C (USB consumer page).
|
* These values are mapped from usage page 0x0C (USB consumer page).
|
||||||
|
* See https://usb.org/sites/default/files/hut1_2.pdf
|
||||||
|
*
|
||||||
|
* There are way more keys in the spec than we can represent in the
|
||||||
|
* current scancode range, so pick the ones that commonly come up in
|
||||||
|
* real world usage.
|
||||||
*/
|
*/
|
||||||
/* @{ */
|
/* @{ */
|
||||||
|
|
||||||
@@ -354,17 +359,17 @@ typedef enum
|
|||||||
SDL_SCANCODE_AUDIOPLAY = 261,
|
SDL_SCANCODE_AUDIOPLAY = 261,
|
||||||
SDL_SCANCODE_AUDIOMUTE = 262,
|
SDL_SCANCODE_AUDIOMUTE = 262,
|
||||||
SDL_SCANCODE_MEDIASELECT = 263,
|
SDL_SCANCODE_MEDIASELECT = 263,
|
||||||
SDL_SCANCODE_WWW = 264,
|
SDL_SCANCODE_WWW = 264, /**< AL Internet Browser */
|
||||||
SDL_SCANCODE_MAIL = 265,
|
SDL_SCANCODE_MAIL = 265,
|
||||||
SDL_SCANCODE_CALCULATOR = 266,
|
SDL_SCANCODE_CALCULATOR = 266, /**< AL Calculator */
|
||||||
SDL_SCANCODE_COMPUTER = 267,
|
SDL_SCANCODE_COMPUTER = 267,
|
||||||
SDL_SCANCODE_AC_SEARCH = 268,
|
SDL_SCANCODE_AC_SEARCH = 268, /**< AC Search */
|
||||||
SDL_SCANCODE_AC_HOME = 269,
|
SDL_SCANCODE_AC_HOME = 269, /**< AC Home */
|
||||||
SDL_SCANCODE_AC_BACK = 270,
|
SDL_SCANCODE_AC_BACK = 270, /**< AC Back */
|
||||||
SDL_SCANCODE_AC_FORWARD = 271,
|
SDL_SCANCODE_AC_FORWARD = 271, /**< AC Forward */
|
||||||
SDL_SCANCODE_AC_STOP = 272,
|
SDL_SCANCODE_AC_STOP = 272, /**< AC Stop */
|
||||||
SDL_SCANCODE_AC_REFRESH = 273,
|
SDL_SCANCODE_AC_REFRESH = 273, /**< AC Refresh */
|
||||||
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
SDL_SCANCODE_AC_BOOKMARKS = 274, /**< AC Bookmarks */
|
||||||
|
|
||||||
/* @} *//* Usage page 0x0C */
|
/* @} *//* Usage page 0x0C */
|
||||||
|
|
||||||
@@ -383,7 +388,7 @@ typedef enum
|
|||||||
SDL_SCANCODE_KBDILLUMDOWN = 279,
|
SDL_SCANCODE_KBDILLUMDOWN = 279,
|
||||||
SDL_SCANCODE_KBDILLUMUP = 280,
|
SDL_SCANCODE_KBDILLUMUP = 280,
|
||||||
SDL_SCANCODE_EJECT = 281,
|
SDL_SCANCODE_EJECT = 281,
|
||||||
SDL_SCANCODE_SLEEP = 282,
|
SDL_SCANCODE_SLEEP = 282, /**< SC System Sleep */
|
||||||
|
|
||||||
SDL_SCANCODE_APP1 = 283,
|
SDL_SCANCODE_APP1 = 283,
|
||||||
SDL_SCANCODE_APP2 = 284,
|
SDL_SCANCODE_APP2 = 284,
|
||||||
@@ -402,6 +407,26 @@ typedef enum
|
|||||||
|
|
||||||
/* @} *//* Usage page 0x0C (additional media keys) */
|
/* @} *//* Usage page 0x0C (additional media keys) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name Mobile keys
|
||||||
|
*
|
||||||
|
* These are values that are often used on mobile phones.
|
||||||
|
*/
|
||||||
|
/* @{ */
|
||||||
|
|
||||||
|
SDL_SCANCODE_SOFTLEFT = 287, /**< Usually situated below the display on phones and
|
||||||
|
used as a multi-function feature key for selecting
|
||||||
|
a software defined function shown on the bottom left
|
||||||
|
of the display. */
|
||||||
|
SDL_SCANCODE_SOFTRIGHT = 288, /**< Usually situated below the display on phones and
|
||||||
|
used as a multi-function feature key for selecting
|
||||||
|
a software defined function shown on the bottom right
|
||||||
|
of the display. */
|
||||||
|
SDL_SCANCODE_CALL = 289, /**< Used for accepting phone calls. */
|
||||||
|
SDL_SCANCODE_ENDCALL = 290, /**< Used for rejecting phone calls. */
|
||||||
|
|
||||||
|
/* @} *//* Mobile keys */
|
||||||
|
|
||||||
/* Add any other keys here. */
|
/* Add any other keys here. */
|
||||||
|
|
||||||
SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
|
SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
|
||||||
|
|||||||
+26
-5
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -71,7 +71,11 @@ typedef enum
|
|||||||
SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */
|
SDL_SENSOR_INVALID = -1, /**< Returned for an invalid sensor */
|
||||||
SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */
|
SDL_SENSOR_UNKNOWN, /**< Unknown sensor type */
|
||||||
SDL_SENSOR_ACCEL, /**< Accelerometer */
|
SDL_SENSOR_ACCEL, /**< Accelerometer */
|
||||||
SDL_SENSOR_GYRO /**< Gyroscope */
|
SDL_SENSOR_GYRO, /**< Gyroscope */
|
||||||
|
SDL_SENSOR_ACCEL_L, /**< Accelerometer for left Joy-Con controller and Wii nunchuk */
|
||||||
|
SDL_SENSOR_GYRO_L, /**< Gyroscope for left Joy-Con controller */
|
||||||
|
SDL_SENSOR_ACCEL_R, /**< Accelerometer for right Joy-Con controller */
|
||||||
|
SDL_SENSOR_GYRO_R /**< Gyroscope for right Joy-Con controller */
|
||||||
} SDL_SensorType;
|
} SDL_SensorType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,7 +84,7 @@ typedef enum
|
|||||||
* The accelerometer returns the current acceleration in SI meters per
|
* The accelerometer returns the current acceleration in SI meters per
|
||||||
* second squared. This measurement includes the force of gravity, so
|
* second squared. This measurement includes the force of gravity, so
|
||||||
* a device at rest will have an value of SDL_STANDARD_GRAVITY away
|
* a device at rest will have an value of SDL_STANDARD_GRAVITY away
|
||||||
* from the center of the earth.
|
* from the center of the earth, which is a positive Y value.
|
||||||
*
|
*
|
||||||
* values[0]: Acceleration on the x axis
|
* values[0]: Acceleration on the x axis
|
||||||
* values[1]: Acceleration on the y axis
|
* values[1]: Acceleration on the y axis
|
||||||
@@ -263,7 +267,24 @@ extern DECLSPEC SDL_SensorID SDLCALL SDL_SensorGetInstanceID(SDL_Sensor *sensor)
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.9.
|
* \since This function is available since SDL 2.0.9.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data, int num_values);
|
extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor *sensor, float *data, int num_values);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current state of an opened sensor with the timestamp of the last
|
||||||
|
* update.
|
||||||
|
*
|
||||||
|
* The number of values and interpretation of the data is sensor dependent.
|
||||||
|
*
|
||||||
|
* \param sensor The SDL_Sensor object to query
|
||||||
|
* \param timestamp A pointer filled with the timestamp in microseconds of the
|
||||||
|
* current sensor reading if available, or 0 if not
|
||||||
|
* \param data A pointer filled with the current sensor state
|
||||||
|
* \param num_values The number of values to write to data
|
||||||
|
* \returns 0 or -1 if an error occurred.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.26.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_SensorGetDataWithTimestamp(SDL_Sensor *sensor, Uint64 *timestamp, float *data, int num_values);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close a sensor previously opened with SDL_SensorOpen().
|
* Close a sensor previously opened with SDL_SensorOpen().
|
||||||
@@ -272,7 +293,7 @@ extern DECLSPEC int SDLCALL SDL_SensorGetData(SDL_Sensor * sensor, float *data,
|
|||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.9.
|
* \since This function is available since SDL 2.0.9.
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor * sensor);
|
extern DECLSPEC void SDLCALL SDL_SensorClose(SDL_Sensor *sensor);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the current state of the open sensors.
|
* Update the current state of the open sensors.
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+139
-20
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -30,12 +30,6 @@
|
|||||||
|
|
||||||
#include "SDL_config.h"
|
#include "SDL_config.h"
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#ifndef _DARWIN_C_SOURCE
|
|
||||||
#define _DARWIN_C_SOURCE 1 /* for memset_pattern4() */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -80,12 +74,14 @@
|
|||||||
# include <ctype.h>
|
# include <ctype.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MATH_H
|
#ifdef HAVE_MATH_H
|
||||||
# if defined(__WINRT__)
|
# if defined(_MSC_VER)
|
||||||
/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
|
/* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
|
||||||
WinRT. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
|
Visual Studio. See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
|
||||||
for more information.
|
for more information.
|
||||||
*/
|
*/
|
||||||
# define _USE_MATH_DEFINES
|
# ifndef _USE_MATH_DEFINES
|
||||||
|
# define _USE_MATH_DEFINES
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -115,6 +111,12 @@ char *alloca();
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SIZE_MAX
|
||||||
|
# define SDL_SIZE_MAX SIZE_MAX
|
||||||
|
#else
|
||||||
|
# define SDL_SIZE_MAX ((size_t) -1)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the compiler supports a given builtin.
|
* Check if the compiler supports a given builtin.
|
||||||
* Supported by virtually all clang versions and recent gcc. Use this
|
* Supported by virtually all clang versions and recent gcc. Use this
|
||||||
@@ -234,13 +236,26 @@ typedef uint64_t Uint64;
|
|||||||
|
|
||||||
/* @} *//* Basic data types */
|
/* @} *//* Basic data types */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \name Floating-point constants
|
||||||
|
*/
|
||||||
|
/* @{ */
|
||||||
|
|
||||||
|
#ifdef FLT_EPSILON
|
||||||
|
#define SDL_FLT_EPSILON FLT_EPSILON
|
||||||
|
#else
|
||||||
|
#define SDL_FLT_EPSILON 1.1920928955078125e-07F /* 0x0.000002p0 */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* @} *//* Floating-point constants */
|
||||||
|
|
||||||
/* Make sure we have macros for printing width-based integers.
|
/* Make sure we have macros for printing width-based integers.
|
||||||
* <stdint.h> should define these but this is not true all platforms.
|
* <stdint.h> should define these but this is not true all platforms.
|
||||||
* (for example win32) */
|
* (for example win32) */
|
||||||
#ifndef SDL_PRIs64
|
#ifndef SDL_PRIs64
|
||||||
#ifdef PRIs64
|
#ifdef PRIs64
|
||||||
#define SDL_PRIs64 PRIs64
|
#define SDL_PRIs64 PRIs64
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__) || defined(__GDK__)
|
||||||
#define SDL_PRIs64 "I64d"
|
#define SDL_PRIs64 "I64d"
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
#elif defined(__LINUX__) && defined(__LP64__)
|
||||||
#define SDL_PRIs64 "ld"
|
#define SDL_PRIs64 "ld"
|
||||||
@@ -251,7 +266,7 @@ typedef uint64_t Uint64;
|
|||||||
#ifndef SDL_PRIu64
|
#ifndef SDL_PRIu64
|
||||||
#ifdef PRIu64
|
#ifdef PRIu64
|
||||||
#define SDL_PRIu64 PRIu64
|
#define SDL_PRIu64 PRIu64
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__) || defined(__GDK__)
|
||||||
#define SDL_PRIu64 "I64u"
|
#define SDL_PRIu64 "I64u"
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
#elif defined(__LINUX__) && defined(__LP64__)
|
||||||
#define SDL_PRIu64 "lu"
|
#define SDL_PRIu64 "lu"
|
||||||
@@ -262,7 +277,7 @@ typedef uint64_t Uint64;
|
|||||||
#ifndef SDL_PRIx64
|
#ifndef SDL_PRIx64
|
||||||
#ifdef PRIx64
|
#ifdef PRIx64
|
||||||
#define SDL_PRIx64 PRIx64
|
#define SDL_PRIx64 PRIx64
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__) || defined(__GDK__)
|
||||||
#define SDL_PRIx64 "I64x"
|
#define SDL_PRIx64 "I64x"
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
#elif defined(__LINUX__) && defined(__LP64__)
|
||||||
#define SDL_PRIx64 "lx"
|
#define SDL_PRIx64 "lx"
|
||||||
@@ -273,7 +288,7 @@ typedef uint64_t Uint64;
|
|||||||
#ifndef SDL_PRIX64
|
#ifndef SDL_PRIX64
|
||||||
#ifdef PRIX64
|
#ifdef PRIX64
|
||||||
#define SDL_PRIX64 PRIX64
|
#define SDL_PRIX64 PRIX64
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__) || defined(__GDK__)
|
||||||
#define SDL_PRIX64 "I64X"
|
#define SDL_PRIX64 "I64X"
|
||||||
#elif defined(__LINUX__) && defined(__LP64__)
|
#elif defined(__LINUX__) && defined(__LP64__)
|
||||||
#define SDL_PRIX64 "lX"
|
#define SDL_PRIX64 "lX"
|
||||||
@@ -354,8 +369,22 @@ typedef uint64_t Uint64;
|
|||||||
#endif
|
#endif
|
||||||
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
||||||
|
|
||||||
|
#ifndef SDL_COMPILE_TIME_ASSERT
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
#if (__cplusplus >= 201103L)
|
||||||
|
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
|
||||||
|
#endif
|
||||||
|
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
||||||
|
#define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x)
|
||||||
|
#endif
|
||||||
|
#endif /* !SDL_COMPILE_TIME_ASSERT */
|
||||||
|
|
||||||
|
#ifndef SDL_COMPILE_TIME_ASSERT
|
||||||
|
/* universal, but may trigger -Wunused-local-typedefs */
|
||||||
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
||||||
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
|
typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
|
||||||
|
#endif
|
||||||
|
|
||||||
/** \cond */
|
/** \cond */
|
||||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
||||||
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
|
SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1);
|
||||||
@@ -377,7 +406,7 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
|
|||||||
|
|
||||||
/** \cond */
|
/** \cond */
|
||||||
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
#ifndef DOXYGEN_SHOULD_IGNORE_THIS
|
||||||
#if !defined(__ANDROID__) && !defined(__VITA__)
|
#if !defined(__ANDROID__) && !defined(__VITA__) && !defined(__3DS__)
|
||||||
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
|
/* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
@@ -413,6 +442,16 @@ typedef void *(SDLCALL *SDL_calloc_func)(size_t nmemb, size_t size);
|
|||||||
typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
|
typedef void *(SDLCALL *SDL_realloc_func)(void *mem, size_t size);
|
||||||
typedef void (SDLCALL *SDL_free_func)(void *mem);
|
typedef void (SDLCALL *SDL_free_func)(void *mem);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the original set of SDL memory functions
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC void SDLCALL SDL_GetOriginalMemoryFunctions(SDL_malloc_func *malloc_func,
|
||||||
|
SDL_calloc_func *calloc_func,
|
||||||
|
SDL_realloc_func *realloc_func,
|
||||||
|
SDL_free_func *free_func);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current set of SDL memory functions
|
* Get the current set of SDL memory functions
|
||||||
*
|
*
|
||||||
@@ -443,7 +482,8 @@ extern DECLSPEC int SDLCALL SDL_GetNumAllocations(void);
|
|||||||
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
extern DECLSPEC char *SDLCALL SDL_getenv(const char *name);
|
||||||
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite);
|
||||||
|
|
||||||
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *));
|
extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||||
|
extern DECLSPEC void * SDLCALL SDL_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (SDLCALL *compare) (const void *, const void *));
|
||||||
|
|
||||||
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
extern DECLSPEC int SDLCALL SDL_abs(int x);
|
||||||
|
|
||||||
@@ -467,6 +507,7 @@ extern DECLSPEC int SDLCALL SDL_isgraph(int x);
|
|||||||
extern DECLSPEC int SDLCALL SDL_toupper(int x);
|
extern DECLSPEC int SDLCALL SDL_toupper(int x);
|
||||||
extern DECLSPEC int SDLCALL SDL_tolower(int x);
|
extern DECLSPEC int SDLCALL SDL_tolower(int x);
|
||||||
|
|
||||||
|
extern DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len);
|
||||||
extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
|
extern DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len);
|
||||||
|
|
||||||
extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len);
|
||||||
@@ -475,12 +516,15 @@ extern DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c,
|
|||||||
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x)))
|
||||||
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
#define SDL_zeroa(x) SDL_memset((x), 0, sizeof((x)))
|
||||||
|
|
||||||
|
#define SDL_copyp(dst, src) \
|
||||||
|
{ SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); } \
|
||||||
|
SDL_memcpy((dst), (src), sizeof (*(src)))
|
||||||
|
|
||||||
|
|
||||||
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
|
/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */
|
||||||
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
SDL_FORCE_INLINE void SDL_memset4(void *dst, Uint32 val, size_t dwords)
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#if defined(__GNUC__) && defined(__i386__)
|
||||||
memset_pattern4(dst, &val, dwords * 4);
|
|
||||||
#elif defined(__GNUC__) && defined(__i386__)
|
|
||||||
int u0, u1, u2;
|
int u0, u1, u2;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"cld \n\t"
|
"cld \n\t"
|
||||||
@@ -533,8 +577,10 @@ extern DECLSPEC char *SDLCALL SDL_strlwr(char *str);
|
|||||||
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
|
extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c);
|
||||||
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
|
extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c);
|
||||||
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle);
|
||||||
|
extern DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle);
|
||||||
extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
|
extern DECLSPEC char *SDLCALL SDL_strtokr(char *s1, const char *s2, char **saveptr);
|
||||||
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
|
extern DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str);
|
||||||
|
extern DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes);
|
||||||
|
|
||||||
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
|
extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix);
|
||||||
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
|
extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix);
|
||||||
@@ -642,7 +688,7 @@ extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf,
|
|||||||
size_t * outbytesleft);
|
size_t * outbytesleft);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function converts a string between encodings in one pass, returning a
|
* This function converts a buffer or string between encodings in one pass, returning a
|
||||||
* string that must be freed with SDL_free() or NULL on error.
|
* string that must be freed with SDL_free() or NULL on error.
|
||||||
*
|
*
|
||||||
* \since This function is available since SDL 2.0.0.
|
* \since This function is available since SDL 2.0.0.
|
||||||
@@ -670,6 +716,20 @@ size_t strlcpy(char* dst, const char* src, size_t size);
|
|||||||
size_t strlcat(char* dst, const char* src, size_t size);
|
size_t strlcat(char* dst, const char* src, size_t size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_WCSLCPY
|
||||||
|
size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_WCSLCAT
|
||||||
|
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Starting LLVM 16, the analyser errors out if these functions do not have
|
||||||
|
their prototype defined (clang-diagnostic-implicit-function-declaration) */
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#define SDL_malloc malloc
|
#define SDL_malloc malloc
|
||||||
#define SDL_calloc calloc
|
#define SDL_calloc calloc
|
||||||
#define SDL_realloc realloc
|
#define SDL_realloc realloc
|
||||||
@@ -708,6 +768,65 @@ SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_B
|
|||||||
return SDL_memcpy(dst, src, dwords * 4);
|
return SDL_memcpy(dst, src, dwords * 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a * b would overflow, return -1. Otherwise store a * b via ret
|
||||||
|
* and return 0.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE int SDL_size_mul_overflow (size_t a,
|
||||||
|
size_t b,
|
||||||
|
size_t *ret)
|
||||||
|
{
|
||||||
|
if (a != 0 && b > SDL_SIZE_MAX / a) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
*ret = a * b;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if _SDL_HAS_BUILTIN(__builtin_mul_overflow)
|
||||||
|
/* This needs to be wrapped in an inline rather than being a direct #define,
|
||||||
|
* because __builtin_mul_overflow() is type-generic, but we want to be
|
||||||
|
* consistent about interpreting a and b as size_t. */
|
||||||
|
SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a,
|
||||||
|
size_t b,
|
||||||
|
size_t *ret)
|
||||||
|
{
|
||||||
|
return __builtin_mul_overflow(a, b, ret) == 0 ? 0 : -1;
|
||||||
|
}
|
||||||
|
#define SDL_size_mul_overflow(a, b, ret) (_SDL_size_mul_overflow_builtin(a, b, ret))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If a + b would overflow, return -1. Otherwise store a + b via ret
|
||||||
|
* and return 0.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
SDL_FORCE_INLINE int SDL_size_add_overflow (size_t a,
|
||||||
|
size_t b,
|
||||||
|
size_t *ret)
|
||||||
|
{
|
||||||
|
if (b > SDL_SIZE_MAX - a) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
*ret = a + b;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if _SDL_HAS_BUILTIN(__builtin_add_overflow)
|
||||||
|
/* This needs to be wrapped in an inline rather than being a direct #define,
|
||||||
|
* the same as the call to __builtin_mul_overflow() above. */
|
||||||
|
SDL_FORCE_INLINE int _SDL_size_add_overflow_builtin (size_t a,
|
||||||
|
size_t b,
|
||||||
|
size_t *ret)
|
||||||
|
{
|
||||||
|
return __builtin_add_overflow(a, b, ret) == 0 ? 0 : -1;
|
||||||
|
}
|
||||||
|
#define SDL_size_add_overflow(a, b, ret) (_SDL_size_add_overflow_builtin(a, b, ret))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
/* Ends C function definitions when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -61,6 +61,8 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
|
#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
|
||||||
|
|
||||||
|
typedef struct SDL_BlitMap SDL_BlitMap; /* this is an opaque type. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A collection of pixels used in software blitting.
|
* \brief A collection of pixels used in software blitting.
|
||||||
*
|
*
|
||||||
@@ -88,7 +90,7 @@ typedef struct SDL_Surface
|
|||||||
SDL_Rect clip_rect; /**< Read-only */
|
SDL_Rect clip_rect; /**< Read-only */
|
||||||
|
|
||||||
/** info for fast blit mapping to other surfaces */
|
/** info for fast blit mapping to other surfaces */
|
||||||
struct SDL_BlitMap *map; /**< Private */
|
SDL_BlitMap *map; /**< Private */
|
||||||
|
|
||||||
/** Reference count -- used when freeing surface */
|
/** Reference count -- used when freeing surface */
|
||||||
int refcount; /**< Read-mostly */
|
int refcount; /**< Read-mostly */
|
||||||
|
|||||||
+67
-7
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -41,7 +41,7 @@ extern "C" {
|
|||||||
|
|
||||||
|
|
||||||
/* Platform specific functions for Windows */
|
/* Platform specific functions for Windows */
|
||||||
#ifdef __WIN32__
|
#if defined(__WIN32__) || defined(__GDK__)
|
||||||
|
|
||||||
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
|
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
|
||||||
|
|
||||||
@@ -55,6 +55,10 @@ typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsi
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
|
||||||
|
|
||||||
|
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
||||||
|
|
||||||
|
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the D3D9 adapter index that matches the specified display index.
|
* Get the D3D9 adapter index that matches the specified display index.
|
||||||
*
|
*
|
||||||
@@ -102,6 +106,30 @@ typedef struct ID3D11Device ID3D11Device;
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
|
extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
|
||||||
|
|
||||||
|
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
|
||||||
|
|
||||||
|
#if defined(__WIN32__) || defined(__GDK__)
|
||||||
|
|
||||||
|
typedef struct ID3D12Device ID3D12Device;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the D3D12 device associated with a renderer.
|
||||||
|
*
|
||||||
|
* Once you are done using the device, you should release it to avoid a
|
||||||
|
* resource leak.
|
||||||
|
*
|
||||||
|
* \param renderer the renderer from which to get the associated D3D12 device
|
||||||
|
* \returns the D3D12 device associated with given renderer or NULL if it is
|
||||||
|
* not a D3D12 renderer; call SDL_GetError() for more information.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer);
|
||||||
|
|
||||||
|
#endif /* defined(__WIN32__) || defined(__GDK__) */
|
||||||
|
|
||||||
|
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the DXGI Adapter and Output indices for the specified display index.
|
* Get the DXGI Adapter and Output indices for the specified display index.
|
||||||
*
|
*
|
||||||
@@ -122,8 +150,7 @@ extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * re
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
|
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
|
||||||
|
|
||||||
#endif /* __WIN32__ */
|
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
|
||||||
|
|
||||||
|
|
||||||
/* Platform specific functions for Linux */
|
/* Platform specific functions for Linux */
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
@@ -178,7 +205,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
|
|||||||
* This function is only available on Apple iOS.
|
* This function is only available on Apple iOS.
|
||||||
*
|
*
|
||||||
* For more information see:
|
* For more information see:
|
||||||
* [README-ios.md](https://hg.libsdl.org/SDL/file/default/docs/README-ios.md)
|
* https://github.com/libsdl-org/SDL/blob/main/docs/README-ios.md
|
||||||
*
|
*
|
||||||
* This functions is also accessible using the macro
|
* This functions is also accessible using the macro
|
||||||
* SDL_iOSSetAnimationCallback() since SDL 2.0.4.
|
* SDL_iOSSetAnimationCallback() since SDL 2.0.4.
|
||||||
@@ -195,7 +222,7 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
|
|||||||
*
|
*
|
||||||
* \sa SDL_iPhoneSetEventPump
|
* \sa SDL_iPhoneSetEventPump
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
|
extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
|
||||||
|
|
||||||
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
#define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
|
||||||
|
|
||||||
@@ -425,6 +452,18 @@ extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permis
|
|||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a user command to SDLActivity.
|
||||||
|
*
|
||||||
|
* Override "boolean onUnhandledMessage(Message msg)" to handle the message.
|
||||||
|
*
|
||||||
|
* \param command user command that must be greater or equal to 0x8000
|
||||||
|
* \param param user parameter
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.0.22.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||||
|
|
||||||
#endif /* __ANDROID__ */
|
#endif /* __ANDROID__ */
|
||||||
|
|
||||||
/* Platform specific functions for WinRT */
|
/* Platform specific functions for WinRT */
|
||||||
@@ -520,7 +559,7 @@ extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path
|
|||||||
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
|
extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detects the device family of WinRT plattform at runtime.
|
* Detects the device family of WinRT platform at runtime.
|
||||||
*
|
*
|
||||||
* \returns a value from the SDL_WinRT_DeviceFamily enum.
|
* \returns a value from the SDL_WinRT_DeviceFamily enum.
|
||||||
*
|
*
|
||||||
@@ -552,6 +591,27 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
|||||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Functions used only by GDK */
|
||||||
|
#if defined(__GDK__)
|
||||||
|
typedef struct XTaskQueueObject * XTaskQueueHandle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a reference to the global async task queue handle for GDK,
|
||||||
|
* initializing if needed.
|
||||||
|
*
|
||||||
|
* Once you are done with the task queue, you should call
|
||||||
|
* XTaskQueueCloseHandle to reduce the reference count to avoid a resource
|
||||||
|
* leak.
|
||||||
|
*
|
||||||
|
* \param outTaskQueue a pointer to be filled in with task queue handle.
|
||||||
|
* \returns 0 if success, -1 if any error occurs.
|
||||||
|
*
|
||||||
|
* \since This function is available since SDL 2.24.0.
|
||||||
|
*/
|
||||||
|
extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Ends C function definitions when using C++ */
|
/* Ends C function definitions when using C++ */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -298,6 +298,8 @@ struct SDL_SysWMinfo
|
|||||||
struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */
|
struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */
|
||||||
struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */
|
struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */
|
||||||
struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */
|
struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */
|
||||||
|
struct xdg_popup *xdg_popup; /**< Wayland xdg popup role */
|
||||||
|
struct xdg_positioner *xdg_positioner; /**< Wayland xdg positioner, for popup */
|
||||||
} wl;
|
} wl;
|
||||||
#endif
|
#endif
|
||||||
#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Simple DirectMedia Layer
|
Simple DirectMedia Layer
|
||||||
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
This software is provided 'as-is', without any express or implied
|
This software is provided 'as-is', without any express or implied
|
||||||
warranty. In no event will the authors be held liable for any damages
|
warranty. In no event will the authors be held liable for any damages
|
||||||
@@ -50,6 +50,7 @@
|
|||||||
#define VERBOSE_RENDER 0x00000004
|
#define VERBOSE_RENDER 0x00000004
|
||||||
#define VERBOSE_EVENT 0x00000008
|
#define VERBOSE_EVENT 0x00000008
|
||||||
#define VERBOSE_AUDIO 0x00000010
|
#define VERBOSE_AUDIO 0x00000010
|
||||||
|
#define VERBOSE_MOTION 0x00000020
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user