Merge branch 'develop'
This commit is contained in:
commit
ef54ee37c3
|
@ -4,8 +4,10 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|||
# Project configuration
|
||||
PROJECT(REACTPHYSICS3D)
|
||||
|
||||
# Default build type
|
||||
SET(CMAKE_BUILD_TYPE "Debug")
|
||||
# Build type
|
||||
IF (NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE "Release")
|
||||
ENDIF (NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
# Where to build the library
|
||||
SET(LIBRARY_OUTPUT_PATH "lib")
|
||||
|
@ -43,12 +45,8 @@ SET (REACTPHYSICS3D_SOURCES
|
|||
"src/body/RigidBody.cpp"
|
||||
"src/collision/broadphase/BroadPhaseAlgorithm.h"
|
||||
"src/collision/broadphase/BroadPhaseAlgorithm.cpp"
|
||||
"src/collision/broadphase/NoBroadPhaseAlgorithm.h"
|
||||
"src/collision/broadphase/NoBroadPhaseAlgorithm.cpp"
|
||||
"src/collision/broadphase/PairManager.h"
|
||||
"src/collision/broadphase/PairManager.cpp"
|
||||
"src/collision/broadphase/SweepAndPruneAlgorithm.h"
|
||||
"src/collision/broadphase/SweepAndPruneAlgorithm.cpp"
|
||||
"src/collision/broadphase/DynamicAABBTree.h"
|
||||
"src/collision/broadphase/DynamicAABBTree.cpp"
|
||||
"src/collision/narrowphase/EPA/EdgeEPA.h"
|
||||
"src/collision/narrowphase/EPA/EdgeEPA.cpp"
|
||||
"src/collision/narrowphase/EPA/EPAAlgorithm.h"
|
||||
|
@ -81,8 +79,10 @@ SET (REACTPHYSICS3D_SOURCES
|
|||
"src/collision/shapes/CylinderShape.cpp"
|
||||
"src/collision/shapes/SphereShape.h"
|
||||
"src/collision/shapes/SphereShape.cpp"
|
||||
"src/collision/BroadPhasePair.h"
|
||||
"src/collision/BroadPhasePair.cpp"
|
||||
"src/collision/RaycastInfo.h"
|
||||
"src/collision/RaycastInfo.cpp"
|
||||
"src/collision/ProxyShape.h"
|
||||
"src/collision/ProxyShape.cpp"
|
||||
"src/collision/CollisionDetection.h"
|
||||
"src/collision/CollisionDetection.cpp"
|
||||
"src/constraint/BallAndSocketJoint.h"
|
||||
|
@ -132,9 +132,11 @@ SET (REACTPHYSICS3D_SOURCES
|
|||
"src/mathematics/Vector2.h"
|
||||
"src/mathematics/Vector2.cpp"
|
||||
"src/mathematics/Vector3.h"
|
||||
"src/mathematics/Ray.h"
|
||||
"src/mathematics/Vector3.cpp"
|
||||
"src/memory/MemoryAllocator.h"
|
||||
"src/memory/MemoryAllocator.cpp"
|
||||
"src/memory/Stack.h"
|
||||
)
|
||||
|
||||
# Create the library
|
||||
|
|
46
README.md
Normal file
46
README.md
Normal file
|
@ -0,0 +1,46 @@
|
|||
## ReactPhysics3D
|
||||
|
||||
ReactPhysics3D is an open source C++ physics engine library that can be used in 3D simulations and games.
|
||||
|
||||
Website : [http://www.reactphysics3d.com](http://www.reactphysics3d.com)
|
||||
|
||||
Author : Daniel Chappuis
|
||||
|
||||
## Features
|
||||
|
||||
ReactPhysics3D has the following features :
|
||||
|
||||
- Rigid body dynamics
|
||||
- Discrete collision detection
|
||||
- Collision shapes (Sphere, Box, Cone, Cylinder, Capsule, Convex Mesh)
|
||||
- Multiple collision shapes per body
|
||||
- Broadphase collision detection (Dynamic AABB tree)
|
||||
- Narrowphase collision detection (GJK/EPA)
|
||||
- Collision response and friction (Sequential Impulses Solver)
|
||||
- Joints (Ball and Socket, Hinge, Slider, Fixed)
|
||||
- Collision filtering with categories
|
||||
- Ray casting
|
||||
- Sleeping technique for inactive bodies
|
||||
- Integrated Profiler
|
||||
- Multi-platform (Windows, Linux, Mac OS X)
|
||||
- Documentation (User manual and Doxygen API)
|
||||
- Examples
|
||||
- Unit tests
|
||||
|
||||
## License
|
||||
|
||||
The ReactPhysics3D library is released under the open-source [ZLib license](http://opensource.org/licenses/zlib).
|
||||
|
||||
## Documentation
|
||||
|
||||
You can find the User Manual and the Doxygen API Documentation [here](http://www.reactphysics3d.com/documentation.html)
|
||||
|
||||
## Branches
|
||||
|
||||
The "master" branch always contains the last released version of the library. This is the most stable version. On the other side,
|
||||
the "develop" branch is used for development. This branch is frequently updated and can be quite unstable. Therefore, if you want to use the library in
|
||||
your application, it is recommended to checkout the "master" branch.
|
||||
|
||||
## Issues
|
||||
|
||||
If you find any issue with the library, you can report it on the issue tracker [here](https://github.com/DanielChappuis/reactphysics3d/issues).
|
20
README.txt
20
README.txt
|
@ -1,20 +0,0 @@
|
|||
ReactPhysics3D is an open source C++ physics engine library that can be used in 3D simulations and games. The library is released under the ZLib license.
|
||||
|
||||
ReactPhysics3D has the following features :
|
||||
|
||||
- Rigid body dynamics
|
||||
- Discrete collision detection
|
||||
- Collision shapes (Sphere, Box, Cone, Cylinder, Capsule, Convex Mesh)
|
||||
- Broadphase collision detection (Sweep and Prune using AABBs)
|
||||
- Narrowphase collision detection (GJK/EPA)
|
||||
- Collision response and friction (Sequential Impulses Solver)
|
||||
- Joints (Ball and Socket, Hinge, Slider, Fixed)
|
||||
- Sleeping technique for inactive bodies
|
||||
- Integrated Profiler
|
||||
- Multi-platform (Windows, Linux, Mac OS X)
|
||||
- Documentation (User manual and Doxygen API)
|
||||
- Examples
|
||||
- Unit tests
|
||||
|
||||
Website : https://code.google.com/p/reactphysics3d/
|
||||
Author : Daniel Chappuis
|
|
@ -1,32 +0,0 @@
|
|||
# This module is used to try to find the Freeglut library and include files
|
||||
|
||||
IF(WIN32)
|
||||
FIND_PATH(FREEGLUT_INCLUDE_DIR NAMES GL/freeglut.h)
|
||||
FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut freeglut_static)
|
||||
PATHS ${OPENGL_LIBRARY_DIR})
|
||||
ELSE(WIN32)
|
||||
|
||||
IF(APPLE)
|
||||
# Do nothing, we do not want to use freeglut on Mac OS X
|
||||
ELSE(APPLE)
|
||||
FIND_PATH(FREEGLUT_INCLUDE_DIR GL/freeglut.h /usr/include/GL
|
||||
/usr/openwin/share/include
|
||||
/usr/openwin/include
|
||||
/opt/graphics/OpenGL/include
|
||||
/opt/graphics/OpenGL/contrib/libglut)
|
||||
|
||||
FIND_LIBRARY(FREEGLUT_LIBRARY NAMES freeglut freeglut_static PATHS /usr/openwin/lib)
|
||||
FIND_LIBRARY(Xi_LIBRARY Xi /usr/openwin/lib)
|
||||
FIND_LIBRARY(Xmu_LIBRARY Xmu /usr/openwin/lib)
|
||||
ENDIF(APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FREEGLUT REQUIRED_VARS FREEGLUT_LIBRARY FREEGLUT_INCLUDE_DIR)
|
||||
|
||||
IF(FREEGLUT_FOUND)
|
||||
SET(FREEGLUT_LIBRARIES ${FREEGLUT_LIBRARY} ${Xi_LIBRARY} ${Xmu_LIBRARY})
|
||||
SET(FREEGLUT_LIBRARY ${FREEGLUT_LIBRARIES})
|
||||
ENDIF(FREEGLUT_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(FREEGLUT_INCLUDE_DIR FREEGLUT_LIBRARY Xi_LIBRARY Xmu_LIBRARY)
|
|
@ -32,7 +32,7 @@ PROJECT_NAME = "ReactPhysics3D"
|
|||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = "0.4.0"
|
||||
PROJECT_NUMBER = "0.5.0"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
15
documentation/UserManual/configHTLatex.cfg
Normal file
15
documentation/UserManual/configHTLatex.cfg
Normal file
|
@ -0,0 +1,15 @@
|
|||
\Preamble{html}
|
||||
\begin{document}
|
||||
% Upper case PNG file extensions
|
||||
\Configure{graphics*}
|
||||
{PNG}
|
||||
{\Picture[pict]{\csname Gin@base\endcsname.PNG align=center border=0}}
|
||||
% Lower case png extensions
|
||||
\Configure{graphics*}
|
||||
{png}
|
||||
{\Picture[pict]{\csname Gin@base\endcsname.png align=center border=0}}
|
||||
% Problems with spanish babel
|
||||
\makeatletter
|
||||
\let\ifes@LaTeXe\iftrue
|
||||
\makeatother
|
||||
\EndPreamble
|
13
documentation/UserManual/generateHTMLManual.sh
Executable file
13
documentation/UserManual/generateHTMLManual.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Delete the /html folder
|
||||
rm -R html/
|
||||
|
||||
# Create the /html folder
|
||||
mkdir html
|
||||
|
||||
# Use the htlatex command to generate the HTML user manual from the .tex file
|
||||
htlatex ReactPhysics3D-UserManual.tex "configHTLatex.cfg,html" "" -dhtml/
|
||||
|
||||
# Copy the images/ folder into the html/ folder
|
||||
cp -R images/ html/images/
|
|
@ -10,13 +10,13 @@
|
|||
\vskip 1.3cm
|
||||
{\Huge \@title\par}%
|
||||
\vskip 0.3cm
|
||||
{\Large Version: 0.4.0\par}%
|
||||
{\Large Version: 0.5.0\par}%
|
||||
\vskip 0.3cm
|
||||
{\Large \@author\par}%
|
||||
\vskip 2cm
|
||||
{\includegraphics[height=5cm]{images/ReactPhysics3DLogo.png}}
|
||||
\vskip 2cm
|
||||
{\large{\url{http://code.google.com/p/reactphysics3d/}}}
|
||||
{\large{\url{http://www.reactphysics3d.com}}}
|
||||
\vskip 0.2cm
|
||||
{\large \@date}%
|
||||
\end{center}%
|
||||
|
|
|
@ -4,12 +4,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|||
# Set a variable for the directory of the opengl-framework
|
||||
SET(OPENGLFRAMEWORK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common/opengl-framework")
|
||||
|
||||
# If we will use FREEGLUT
|
||||
IF(NOT APPLE)
|
||||
ADD_DEFINITIONS(-DUSE_FREEGLUT)
|
||||
ENDIF()
|
||||
|
||||
ADD_SUBDIRECTORY(common/)
|
||||
ADD_SUBDIRECTORY(cubes/)
|
||||
ADD_SUBDIRECTORY(joints/)
|
||||
ADD_SUBDIRECTORY(collisionshapes/)
|
||||
ADD_SUBDIRECTORY(raycast/)
|
||||
|
|
|
@ -17,7 +17,7 @@ FILE(COPY "${OPENGLFRAMEWORK_DIR}/src/shaders/" DESTINATION "${EXECUTABLE_OUTPUT
|
|||
FILE(COPY "../common/meshes/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/meshes/")
|
||||
|
||||
# Headers
|
||||
INCLUDE_DIRECTORIES("${OPENGLFRAMEWORK_DIR}/src/" "../common/")
|
||||
INCLUDE_DIRECTORIES("${OPENGLFRAMEWORK_DIR}/src/" "../common/glfw/include/" "../common/")
|
||||
|
||||
# Source files
|
||||
SET(COLLISION_SHAPES_SOURCES
|
||||
|
@ -30,6 +30,7 @@ SET(COLLISION_SHAPES_SOURCES
|
|||
"../common/Sphere.cpp"
|
||||
"../common/Cylinder.cpp"
|
||||
"../common/Cone.cpp"
|
||||
"../common/Dumbbell.cpp"
|
||||
"../common/Box.cpp"
|
||||
"../common/Viewer.cpp"
|
||||
)
|
||||
|
@ -38,4 +39,4 @@ SET(COLLISION_SHAPES_SOURCES
|
|||
ADD_EXECUTABLE(collisionshapes ${COLLISION_SHAPES_SOURCES})
|
||||
|
||||
# Link with libraries
|
||||
TARGET_LINK_LIBRARIES(collisionshapes reactphysics3d openglframework)
|
||||
TARGET_LINK_LIBRARIES(collisionshapes reactphysics3d openglframework glfw ${GLFW_LIBRARIES})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -25,16 +25,16 @@
|
|||
|
||||
// Libraries
|
||||
#include "Scene.h"
|
||||
#include "Viewer.h"
|
||||
#include "../common/Viewer.h"
|
||||
|
||||
// Declarations
|
||||
void simulate();
|
||||
void display();
|
||||
void finish();
|
||||
void reshape(int width, int height);
|
||||
void mouseButton(int button, int state, int x, int y);
|
||||
void mouseMotion(int x, int y);
|
||||
void keyboard(unsigned char key, int x, int y);
|
||||
void render();
|
||||
void update();
|
||||
void mouseButton(GLFWwindow* window, int button, int action, int mods);
|
||||
void mouseMotion(GLFWwindow* window, double x, double y);
|
||||
void keyboard(GLFWwindow* window, int key, int scancode, int action, int mods);
|
||||
void scroll(GLFWwindow* window, double xAxis, double yAxis);
|
||||
void init();
|
||||
|
||||
// Namespaces
|
||||
|
@ -51,34 +51,50 @@ int main(int argc, char** argv) {
|
|||
viewer = new Viewer();
|
||||
Vector2 windowsSize = Vector2(800, 600);
|
||||
Vector2 windowsPosition = Vector2(100, 100);
|
||||
bool initOK = viewer->init(argc, argv, "ReactPhysics3D Examples - Collision Shapes",
|
||||
windowsSize, windowsPosition);
|
||||
if (!initOK) return 1;
|
||||
viewer->init(argc, argv, "ReactPhysics3D Examples - Collision Shapes",
|
||||
windowsSize, windowsPosition, true);
|
||||
|
||||
// If the shaders and meshes folders are not specified as an argument
|
||||
if (argc < 3) {
|
||||
std::cerr << "Error : You need to specify the shaders folder as the first argument"
|
||||
<< " and the meshes folder as the second argument" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Get the path of the shaders folder
|
||||
std::string shaderFolderPath(argv[1]);
|
||||
std::string meshFolderPath(argv[2]);
|
||||
|
||||
// Register callback methods
|
||||
viewer->registerUpdateFunction(update);
|
||||
viewer->registerKeyboardCallback(keyboard);
|
||||
viewer->registerMouseButtonCallback(mouseButton);
|
||||
viewer->registerMouseCursorCallback(mouseMotion);
|
||||
viewer->registerScrollingCallback(scroll);
|
||||
|
||||
// Create the scene
|
||||
scene = new Scene(viewer);
|
||||
scene = new Scene(viewer, shaderFolderPath, meshFolderPath);
|
||||
|
||||
init();
|
||||
|
||||
// Glut Idle function that is continuously called
|
||||
glutIdleFunc(simulate);
|
||||
glutDisplayFunc(display);
|
||||
glutReshapeFunc(reshape);
|
||||
glutMouseFunc(mouseButton);
|
||||
glutMotionFunc(mouseMotion);
|
||||
glutKeyboardFunc(keyboard);
|
||||
#ifdef USE_FREEGLUT
|
||||
glutCloseFunc(finish);
|
||||
#else
|
||||
atexit(finish);
|
||||
#endif
|
||||
viewer->startMainLoop();
|
||||
|
||||
// Glut main looop
|
||||
glutMainLoop();
|
||||
delete viewer;
|
||||
delete scene;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Update function that is called each frame
|
||||
void update() {
|
||||
|
||||
// Take a simulation step
|
||||
simulate();
|
||||
|
||||
// Render
|
||||
render();
|
||||
}
|
||||
|
||||
// Simulate function
|
||||
void simulate() {
|
||||
|
||||
|
@ -86,9 +102,6 @@ void simulate() {
|
|||
scene->simulate();
|
||||
|
||||
viewer->computeFPS();
|
||||
|
||||
// Ask GLUT to render the scene
|
||||
glutPostRedisplay ();
|
||||
}
|
||||
|
||||
// Initialization
|
||||
|
@ -98,49 +111,33 @@ void init() {
|
|||
glClearColor(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
// Reshape function
|
||||
void reshape(int newWidth, int newHeight) {
|
||||
viewer->reshape(newWidth, newHeight);
|
||||
}
|
||||
|
||||
// Called when a mouse button event occurs
|
||||
void mouseButton(int button, int state, int x, int y) {
|
||||
viewer->mouseButtonEvent(button, state, x, y);
|
||||
}
|
||||
|
||||
// Called when a mouse motion event occurs
|
||||
void mouseMotion(int x, int y) {
|
||||
viewer->mouseMotionEvent(x, y);
|
||||
}
|
||||
|
||||
// Called when the user hits a special key on the keyboard
|
||||
void keyboard(unsigned char key, int x, int y) {
|
||||
switch(key) {
|
||||
|
||||
// Escape key
|
||||
case 27:
|
||||
#ifdef USE_FREEGLUT
|
||||
glutLeaveMainLoop();
|
||||
#endif
|
||||
break;
|
||||
|
||||
// Space bar
|
||||
case 32:
|
||||
scene->pauseContinueSimulation();
|
||||
break;
|
||||
// Callback method to receive keyboard events
|
||||
void keyboard(GLFWwindow* window, int key, int scancode, int action, int mods) {
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) {
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
}
|
||||
else if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) {
|
||||
scene->pauseContinueSimulation();
|
||||
}
|
||||
}
|
||||
|
||||
// End of the application
|
||||
void finish() {
|
||||
// Callback method to receive scrolling events
|
||||
void scroll(GLFWwindow* window, double xAxis, double yAxis) {
|
||||
viewer->scrollingEvent(static_cast<float>(yAxis));
|
||||
}
|
||||
|
||||
// Destroy the viewer and the scene
|
||||
delete viewer;
|
||||
delete scene;
|
||||
// Called when a mouse button event occurs
|
||||
void mouseButton(GLFWwindow* window, int button, int action, int mods) {
|
||||
viewer->mouseButtonEvent(button, action);
|
||||
}
|
||||
|
||||
// Called when a mouse motion event occurs
|
||||
void mouseMotion(GLFWwindow* window, double x, double y) {
|
||||
viewer->mouseMotionEvent(x, y);
|
||||
}
|
||||
|
||||
// Display the scene
|
||||
void display() {
|
||||
void render() {
|
||||
|
||||
// Render the scene
|
||||
scene->render();
|
||||
|
@ -148,11 +145,8 @@ void display() {
|
|||
// Display the FPS
|
||||
viewer->displayGUI();
|
||||
|
||||
// Swap the buffers
|
||||
glutSwapBuffers();
|
||||
|
||||
// Check the OpenGL errors
|
||||
GlutViewer::checkOpenGLErrors();
|
||||
Viewer::checkOpenGLErrors();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -30,22 +30,23 @@
|
|||
using namespace openglframework;
|
||||
|
||||
// Constructor
|
||||
Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
||||
mPhongShader("shaders/phong.vert",
|
||||
"shaders/phong.frag"), mIsRunning(false) {
|
||||
Scene::Scene(Viewer* viewer, const std::string& shaderFolderPath, const std::string& meshFolderPath)
|
||||
: mViewer(viewer), mLight0(0),
|
||||
mPhongShader(shaderFolderPath + "phong.vert",
|
||||
shaderFolderPath +"phong.frag"), mIsRunning(false) {
|
||||
|
||||
// Move the light 0
|
||||
mLight0.translateWorld(Vector3(50, 50, 50));
|
||||
|
||||
// Compute the radius and the center of the scene
|
||||
float radiusScene = 10.0f;
|
||||
float radiusScene = 30.0f;
|
||||
openglframework::Vector3 center(0, 5, 0);
|
||||
|
||||
// Set the center of the scene
|
||||
mViewer->setScenePosition(center, radiusScene);
|
||||
|
||||
// Gravity vector in the dynamics world
|
||||
rp3d::Vector3 gravity(0, rp3d::decimal(-9.81), 0);
|
||||
rp3d::Vector3 gravity(0, -9.81, 0);
|
||||
|
||||
// Time step for the physics simulation
|
||||
rp3d::decimal timeStep = 1.0f / 60.0f;
|
||||
|
@ -57,10 +58,29 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
mDynamicsWorld->setNbIterationsVelocitySolver(15);
|
||||
|
||||
// Create the static data for the visual contact points
|
||||
VisualContactPoint::createStaticData();
|
||||
VisualContactPoint::createStaticData(meshFolderPath);
|
||||
|
||||
float radius = 3.0f;
|
||||
|
||||
for (int i=0; i<NB_COMPOUND_SHAPES; i++) {
|
||||
|
||||
// Position
|
||||
float angle = i * 30.0f;
|
||||
openglframework::Vector3 position(radius * cos(angle),
|
||||
100 + i * (DUMBBELL_HEIGHT + 0.3f),
|
||||
radius * sin(angle));
|
||||
|
||||
// Create a convex mesh and a corresponding rigid in the dynamics world
|
||||
Dumbbell* dumbbell = new Dumbbell(position, mDynamicsWorld, meshFolderPath);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = dumbbell->getRigidBody()->getMaterial();
|
||||
material.setBounciness(rp3d::decimal(0.2));
|
||||
|
||||
// Add the mesh the list of dumbbells in the scene
|
||||
mDumbbells.push_back(dumbbell);
|
||||
}
|
||||
|
||||
// Create all the boxes of the scene
|
||||
for (int i=0; i<NB_BOXES; i++) {
|
||||
|
||||
|
@ -73,9 +93,6 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
// Create a sphere and a corresponding rigid in the dynamics world
|
||||
Box* box = new Box(BOX_SIZE, position , BOX_MASS, mDynamicsWorld);
|
||||
|
||||
// The sphere is a moving rigid body
|
||||
box->getRigidBody()->enableMotion(true);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = box->getRigidBody()->getMaterial();
|
||||
material.setBounciness(rp3d::decimal(0.2));
|
||||
|
@ -85,7 +102,7 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
}
|
||||
|
||||
// Create all the spheres of the scene
|
||||
for (int i=0; i<NB_SPHERES; i++) {
|
||||
for (int i=0; i<NB_CUBES; i++) {
|
||||
|
||||
// Position
|
||||
float angle = i * 35.0f;
|
||||
|
@ -94,10 +111,8 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
radius * sin(angle));
|
||||
|
||||
// Create a sphere and a corresponding rigid in the dynamics world
|
||||
Sphere* sphere = new Sphere(SPHERE_RADIUS, position , BOX_MASS, mDynamicsWorld);
|
||||
|
||||
// The sphere is a moving rigid body
|
||||
sphere->getRigidBody()->enableMotion(true);
|
||||
Sphere* sphere = new Sphere(SPHERE_RADIUS, position , BOX_MASS, mDynamicsWorld,
|
||||
meshFolderPath);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = sphere->getRigidBody()->getMaterial();
|
||||
|
@ -117,10 +132,8 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
radius * sin(angle));
|
||||
|
||||
// Create a cone and a corresponding rigid in the dynamics world
|
||||
Cone* cone = new Cone(CONE_RADIUS, CONE_HEIGHT, position , CONE_MASS, mDynamicsWorld);
|
||||
|
||||
// The cone is a moving rigid body
|
||||
cone->getRigidBody()->enableMotion(true);
|
||||
Cone* cone = new Cone(CONE_RADIUS, CONE_HEIGHT, position, CONE_MASS, mDynamicsWorld,
|
||||
meshFolderPath);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = cone->getRigidBody()->getMaterial();
|
||||
|
@ -141,10 +154,7 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
|
||||
// Create a cylinder and a corresponding rigid in the dynamics world
|
||||
Cylinder* cylinder = new Cylinder(CYLINDER_RADIUS, CYLINDER_HEIGHT, position ,
|
||||
CYLINDER_MASS, mDynamicsWorld);
|
||||
|
||||
// The cylinder is a moving rigid body
|
||||
cylinder->getRigidBody()->enableMotion(true);
|
||||
CYLINDER_MASS, mDynamicsWorld, meshFolderPath);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = cylinder->getRigidBody()->getMaterial();
|
||||
|
@ -165,10 +175,7 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
|
||||
// Create a cylinder and a corresponding rigid in the dynamics world
|
||||
Capsule* capsule = new Capsule(CAPSULE_RADIUS, CAPSULE_HEIGHT, position ,
|
||||
CAPSULE_MASS, mDynamicsWorld);
|
||||
|
||||
// The cylinder is a moving rigid body
|
||||
capsule->getRigidBody()->enableMotion(true);
|
||||
CAPSULE_MASS, mDynamicsWorld, meshFolderPath);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = capsule->getRigidBody()->getMaterial();
|
||||
|
@ -188,10 +195,7 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
radius * sin(angle));
|
||||
|
||||
// Create a convex mesh and a corresponding rigid in the dynamics world
|
||||
ConvexMesh* mesh = new ConvexMesh(position, MESH_MASS, mDynamicsWorld);
|
||||
|
||||
// The mesh is a moving rigid body
|
||||
mesh->getRigidBody()->enableMotion(true);
|
||||
ConvexMesh* mesh = new ConvexMesh(position, MESH_MASS, mDynamicsWorld, meshFolderPath);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = mesh->getRigidBody()->getMaterial();
|
||||
|
@ -205,8 +209,8 @@ Scene::Scene(GlutViewer* viewer) : mViewer(viewer), mLight0(0),
|
|||
openglframework::Vector3 floorPosition(0, 0, 0);
|
||||
mFloor = new Box(FLOOR_SIZE, floorPosition, FLOOR_MASS, mDynamicsWorld);
|
||||
|
||||
// The floor must be a non-moving rigid body
|
||||
mFloor->getRigidBody()->enableMotion(false);
|
||||
// The floor must be a static rigid body
|
||||
mFloor->getRigidBody()->setType(rp3d::STATIC);
|
||||
|
||||
// Change the material properties of the rigid body
|
||||
rp3d::Material& material = mFloor->getRigidBody()->getMaterial();
|
||||
|
@ -286,15 +290,17 @@ Scene::~Scene() {
|
|||
delete (*it);
|
||||
}
|
||||
|
||||
// Destroy all the visual contact points
|
||||
for (std::vector<VisualContactPoint*>::iterator it = mContactPoints.begin();
|
||||
it != mContactPoints.end(); ++it) {
|
||||
// Destroy all the dumbbell of the scene
|
||||
for (std::vector<Dumbbell*>::iterator it = mDumbbells.begin();
|
||||
it != mDumbbells.end(); ++it) {
|
||||
|
||||
// Destroy the corresponding rigid body from the dynamics world
|
||||
mDynamicsWorld->destroyRigidBody((*it)->getRigidBody());
|
||||
|
||||
// Destroy the convex mesh
|
||||
delete (*it);
|
||||
}
|
||||
|
||||
// Destroy the static data for the visual contact points
|
||||
VisualContactPoint::destroyStaticData();
|
||||
|
||||
// Destroy the rigid body of the floor
|
||||
mDynamicsWorld->destroyRigidBody(mFloor->getRigidBody());
|
||||
|
||||
|
@ -357,25 +363,12 @@ void Scene::simulate() {
|
|||
(*it)->updateTransform();
|
||||
}
|
||||
|
||||
// Destroy all the visual contact points
|
||||
for (std::vector<VisualContactPoint*>::iterator it = mContactPoints.begin();
|
||||
it != mContactPoints.end(); ++it) {
|
||||
delete (*it);
|
||||
}
|
||||
mContactPoints.clear();
|
||||
// Update the position and orientation of the dumbbells
|
||||
for (std::vector<Dumbbell*>::iterator it = mDumbbells.begin();
|
||||
it != mDumbbells.end(); ++it) {
|
||||
|
||||
// Generate the new visual contact points
|
||||
const std::vector<rp3d::ContactManifold*>& manifolds = mDynamicsWorld->getContactManifolds();
|
||||
for (std::vector<rp3d::ContactManifold*>::const_iterator it = manifolds.begin();
|
||||
it != manifolds.end(); ++it) {
|
||||
for (unsigned int i=0; i<(*it)->getNbContactPoints(); i++) {
|
||||
rp3d::ContactPoint* point = (*it)->getContactPoint(i);
|
||||
|
||||
const rp3d::Vector3 pos = point->getWorldPointOnBody1();
|
||||
openglframework::Vector3 position(pos.x, pos.y, pos.z);
|
||||
VisualContactPoint* visualPoint = new VisualContactPoint(position);
|
||||
mContactPoints.push_back(visualPoint);
|
||||
}
|
||||
// Update the transform used for the rendering
|
||||
(*it)->updateTransform();
|
||||
}
|
||||
|
||||
mFloor->updateTransform();
|
||||
|
@ -437,9 +430,9 @@ void Scene::render() {
|
|||
(*it)->render(mPhongShader, worldToCameraMatrix);
|
||||
}
|
||||
|
||||
// Render all the visual contact points
|
||||
for (std::vector<VisualContactPoint*>::iterator it = mContactPoints.begin();
|
||||
it != mContactPoints.end(); ++it) {
|
||||
// Render all the dumbbells of the scene
|
||||
for (std::vector<Dumbbell*>::iterator it = mDumbbells.begin();
|
||||
it != mDumbbells.end(); ++it) {
|
||||
(*it)->render(mPhongShader, worldToCameraMatrix);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -35,15 +35,18 @@
|
|||
#include "Cylinder.h"
|
||||
#include "Capsule.h"
|
||||
#include "ConvexMesh.h"
|
||||
#include "Dumbbell.h"
|
||||
#include "VisualContactPoint.h"
|
||||
#include "../common/Viewer.h"
|
||||
|
||||
// Constants
|
||||
const int NB_BOXES = 3;
|
||||
const int NB_SPHERES = 3;
|
||||
const int NB_BOXES = 2;
|
||||
const int NB_CUBES = 1;
|
||||
const int NB_CONES = 3;
|
||||
const int NB_CYLINDERS = 3;
|
||||
const int NB_CAPSULES = 3;
|
||||
const int NB_MESHES = 3;
|
||||
const int NB_CYLINDERS = 2;
|
||||
const int NB_CAPSULES = 1;
|
||||
const int NB_MESHES = 2;
|
||||
const int NB_COMPOUND_SHAPES = 2;
|
||||
const openglframework::Vector3 BOX_SIZE(2, 2, 2);
|
||||
const float SPHERE_RADIUS = 1.5f;
|
||||
const float CONE_RADIUS = 2.0f;
|
||||
|
@ -52,6 +55,7 @@ const float CYLINDER_RADIUS = 1.0f;
|
|||
const float CYLINDER_HEIGHT = 5.0f;
|
||||
const float CAPSULE_RADIUS = 1.0f;
|
||||
const float CAPSULE_HEIGHT = 1.0f;
|
||||
const float DUMBBELL_HEIGHT = 1.0f;
|
||||
const openglframework::Vector3 FLOOR_SIZE(20, 0.5f, 20); // Floor dimensions in meters
|
||||
const float BOX_MASS = 1.0f;
|
||||
const float CONE_MASS = 1.0f;
|
||||
|
@ -68,7 +72,7 @@ class Scene {
|
|||
// -------------------- Attributes -------------------- //
|
||||
|
||||
/// Pointer to the viewer
|
||||
openglframework::GlutViewer* mViewer;
|
||||
Viewer* mViewer;
|
||||
|
||||
/// Light 0
|
||||
openglframework::Light mLight0;
|
||||
|
@ -90,8 +94,8 @@ class Scene {
|
|||
/// All the convex meshes of the scene
|
||||
std::vector<ConvexMesh*> mConvexMeshes;
|
||||
|
||||
/// All the visual contact points
|
||||
std::vector<VisualContactPoint*> mContactPoints;
|
||||
/// All the dumbbell of the scene
|
||||
std::vector<Dumbbell*> mDumbbells;
|
||||
|
||||
/// Box for the floor
|
||||
Box* mFloor;
|
||||
|
@ -107,7 +111,8 @@ class Scene {
|
|||
// -------------------- Methods -------------------- //
|
||||
|
||||
/// Constructor
|
||||
Scene(openglframework::GlutViewer* viewer);
|
||||
Scene(Viewer* viewer, const std::string& shaderFolderPath,
|
||||
const std::string& meshFolderPath);
|
||||
|
||||
/// Destructor
|
||||
~Scene();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -58,7 +58,7 @@ GLuint Box::mCubeIndices[36] = { 0, 1, 2,
|
|||
|
||||
// Constructor
|
||||
Box::Box(const openglframework::Vector3& size, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld)
|
||||
reactphysics3d::CollisionWorld* world)
|
||||
: openglframework::Object3D(), mColor(0.5f, 0.5f, 0.5f, 1.0f) {
|
||||
|
||||
// Initialize the size of the box
|
||||
|
@ -77,26 +77,73 @@ Box::Box(const openglframework::Vector3& size, const openglframework::Vector3 &p
|
|||
|
||||
// Create the collision shape for the rigid body (box shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling Dynamics::createRigidBody()
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::BoxShape collisionShape(rp3d::Vector3(mSize[0], mSize[1], mSize[2]));
|
||||
|
||||
// Compute the inertia tensor of the body using its collision shape
|
||||
rp3d::Matrix3x3 inertiaTensor;
|
||||
collisionShape.computeLocalInertiaTensor(inertiaTensor, mass);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the cube in the dynamics world
|
||||
mRigidBody = dynamicsWorld->createRigidBody(transform, mass, inertiaTensor, collisionShape);
|
||||
// Create a rigid body in the dynamics world
|
||||
mRigidBody = world->createCollisionBody(transform);
|
||||
|
||||
// Add the collision shape to the body
|
||||
mRigidBody->addCollisionShape(collisionShape, rp3d::Transform::identity());
|
||||
|
||||
// If the Vertex Buffer object has not been created yet
|
||||
if (!areVBOsCreated) {
|
||||
// Create the Vertex Buffer
|
||||
createVBO();
|
||||
}
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Box::Box(const openglframework::Vector3& size, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* world)
|
||||
: openglframework::Object3D(), mColor(0.5f, 0.5f, 0.5f, 1.0f) {
|
||||
|
||||
// Initialize the size of the box
|
||||
mSize[0] = size.x * 0.5f;
|
||||
mSize[1] = size.y * 0.5f;
|
||||
mSize[2] = size.z * 0.5f;
|
||||
|
||||
// Compute the scaling matrix
|
||||
mScalingMatrix = openglframework::Matrix4(mSize[0], 0, 0, 0,
|
||||
0, mSize[1], 0, 0,
|
||||
0, 0, mSize[2], 0,
|
||||
0, 0, 0, 1);
|
||||
|
||||
// Initialize the position where the cube will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Create the collision shape for the rigid body (box shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::BoxShape collisionShape(rp3d::Vector3(mSize[0], mSize[1], mSize[2]));
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body in the dynamics world
|
||||
rp3d::RigidBody* body = world->createRigidBody(transform);
|
||||
|
||||
// Add the collision shape to the body
|
||||
body->addCollisionShape(collisionShape, rp3d::Transform::identity(), mass);
|
||||
|
||||
mRigidBody = body;
|
||||
|
||||
// If the Vertex Buffer object has not been created yet
|
||||
if (!areVBOsCreated) {
|
||||
// Create the Vertex Buffer
|
||||
createVBO();
|
||||
}
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -164,7 +211,7 @@ void Box::updateTransform() {
|
|||
rp3d::Transform transform = mRigidBody->getInterpolatedTransform();
|
||||
|
||||
// Compute the transform used for rendering the box
|
||||
float matrix[16];
|
||||
rp3d::decimal matrix[16];
|
||||
transform.getOpenGLMatrix(matrix);
|
||||
openglframework::Matrix4 newMatrix(matrix[0], matrix[4], matrix[8], matrix[12],
|
||||
matrix[1], matrix[5], matrix[9], matrix[13],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -54,7 +54,7 @@ class Box : public openglframework::Object3D {
|
|||
float mSize[3];
|
||||
|
||||
/// Rigid body used to simulate the dynamics of the box
|
||||
rp3d::RigidBody* mRigidBody;
|
||||
rp3d::CollisionBody* mRigidBody;
|
||||
|
||||
/// Scaling matrix (applied to a cube to obtain the correct box dimensions)
|
||||
openglframework::Matrix4 mScalingMatrix;
|
||||
|
@ -88,13 +88,20 @@ class Box : public openglframework::Object3D {
|
|||
|
||||
/// Constructor
|
||||
Box(const openglframework::Vector3& size, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld);
|
||||
reactphysics3d::CollisionWorld* world);
|
||||
|
||||
/// Constructor
|
||||
Box(const openglframework::Vector3& size, const openglframework::Vector3& position,
|
||||
float mass, reactphysics3d::DynamicsWorld *world);
|
||||
|
||||
/// Destructor
|
||||
~Box();
|
||||
|
||||
/// Return a pointer to the collision body of the box
|
||||
reactphysics3d::CollisionBody* getCollisionBody();
|
||||
|
||||
/// Return a pointer to the rigid body of the box
|
||||
rp3d::RigidBody* getRigidBody();
|
||||
reactphysics3d::RigidBody* getRigidBody();
|
||||
|
||||
/// Update the transform matrix of the box
|
||||
void updateTransform();
|
||||
|
@ -106,9 +113,14 @@ class Box : public openglframework::Object3D {
|
|||
void setColor(const openglframework::Color& color);
|
||||
};
|
||||
|
||||
// Return a pointer to the collision body of the box
|
||||
inline rp3d::CollisionBody* Box::getCollisionBody() {
|
||||
return mRigidBody;
|
||||
}
|
||||
|
||||
// Return a pointer to the rigid body of the box
|
||||
inline rp3d::RigidBody* Box::getRigidBody() {
|
||||
return mRigidBody;
|
||||
return dynamic_cast<rp3d::RigidBody*>(mRigidBody);
|
||||
}
|
||||
|
||||
// Set the color of the box
|
||||
|
|
|
@ -2,3 +2,4 @@
|
|||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
|
||||
ADD_SUBDIRECTORY(opengl-framework/)
|
||||
ADD_SUBDIRECTORY(glfw/)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -26,14 +26,14 @@
|
|||
// Libraries
|
||||
#include "Capsule.h"
|
||||
|
||||
|
||||
// Constructor
|
||||
Capsule::Capsule(float radius, float height, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld)
|
||||
Capsule::Capsule(float radius, float height, const openglframework::Vector3& position,
|
||||
reactphysics3d::CollisionWorld* world,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius), mHeight(height) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile("meshes/capsule.obj", *this);
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "capsule.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
@ -49,20 +49,63 @@ Capsule::Capsule(float radius, float height, const openglframework::Vector3 &pos
|
|||
|
||||
// Create the collision shape for the rigid body (sphere shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling Dynamics::createRigidBody()
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::CapsuleShape collisionShape(mRadius, mHeight);
|
||||
|
||||
// Compute the inertia tensor of the body using its collision shape
|
||||
rp3d::Matrix3x3 inertiaTensor;
|
||||
collisionShape.computeLocalInertiaTensor(inertiaTensor, mass);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the sphere in the dynamics world
|
||||
mRigidBody = dynamicsWorld->createRigidBody(transform, mass, inertiaTensor, collisionShape);
|
||||
// Create a rigid body corresponding in the dynamics world
|
||||
mRigidBody = world->createCollisionBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
mRigidBody->addCollisionShape(collisionShape, rp3d::Transform::identity());
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Capsule::Capsule(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius), mHeight(height) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "capsule.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
||||
// Compute the scaling matrix
|
||||
mScalingMatrix = openglframework::Matrix4(mRadius, 0, 0, 0,
|
||||
0, (mHeight + 2.0f * mRadius) / 3.0f, 0,0,
|
||||
0, 0, mRadius, 0,
|
||||
0, 0, 0, 1.0f);
|
||||
|
||||
// Initialize the position where the sphere will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Create the collision shape for the rigid body (sphere shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::CapsuleShape collisionShape(mRadius, mHeight);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding in the dynamics world
|
||||
rp3d::RigidBody* body = dynamicsWorld->createRigidBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
body->addCollisionShape(collisionShape, rp3d::Transform::identity(), mass);
|
||||
|
||||
mRigidBody = body;
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -124,7 +167,7 @@ void Capsule::updateTransform() {
|
|||
rp3d::Transform transform = mRigidBody->getInterpolatedTransform();
|
||||
|
||||
// Compute the transform used for rendering the sphere
|
||||
float matrix[16];
|
||||
rp3d::decimal matrix[16];
|
||||
transform.getOpenGLMatrix(matrix);
|
||||
openglframework::Matrix4 newMatrix(matrix[0], matrix[4], matrix[8], matrix[12],
|
||||
matrix[1], matrix[5], matrix[9], matrix[13],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -44,7 +44,7 @@ class Capsule : public openglframework::Mesh {
|
|||
float mHeight;
|
||||
|
||||
/// Rigid body used to simulate the dynamics of the sphere
|
||||
rp3d::RigidBody* mRigidBody;
|
||||
rp3d::CollisionBody* mRigidBody;
|
||||
|
||||
/// Scaling matrix (applied to a sphere to obtain the correct sphere dimensions)
|
||||
openglframework::Matrix4 mScalingMatrix;
|
||||
|
@ -57,13 +57,21 @@ class Capsule : public openglframework::Mesh {
|
|||
|
||||
/// Constructor
|
||||
Capsule(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld);
|
||||
reactphysics3d::CollisionWorld* world, const std::string& meshFolderPath);
|
||||
|
||||
/// Constructor
|
||||
Capsule(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld,
|
||||
const std::string& meshFolderPath);
|
||||
|
||||
/// Destructor
|
||||
~Capsule();
|
||||
|
||||
/// Return a pointer to the rigid body of the sphere
|
||||
rp3d::RigidBody* getRigidBody();
|
||||
/// Return a pointer to the collision body of the box
|
||||
reactphysics3d::CollisionBody* getCollisionBody();
|
||||
|
||||
/// Return a pointer to the rigid body of the box
|
||||
reactphysics3d::RigidBody* getRigidBody();
|
||||
|
||||
/// Update the transform matrix of the sphere
|
||||
void updateTransform();
|
||||
|
@ -73,9 +81,14 @@ class Capsule : public openglframework::Mesh {
|
|||
const openglframework::Matrix4& worldToCameraMatrix);
|
||||
};
|
||||
|
||||
// Return a pointer to the rigid body of the sphere
|
||||
inline rp3d::RigidBody* Capsule::getRigidBody() {
|
||||
// Return a pointer to the collision body of the box
|
||||
inline rp3d::CollisionBody* Capsule::getCollisionBody() {
|
||||
return mRigidBody;
|
||||
}
|
||||
|
||||
// Return a pointer to the rigid body of the box
|
||||
inline rp3d::RigidBody* Capsule::getRigidBody() {
|
||||
return dynamic_cast<rp3d::RigidBody*>(mRigidBody);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -26,14 +26,14 @@
|
|||
// Libraries
|
||||
#include "Cone.h"
|
||||
|
||||
|
||||
// Constructor
|
||||
Cone::Cone(float radius, float height, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld)
|
||||
reactphysics3d::CollisionWorld* world,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius), mHeight(height) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile("meshes/cone.obj", *this);
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "cone.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
@ -49,20 +49,63 @@ Cone::Cone(float radius, float height, const openglframework::Vector3 &position,
|
|||
|
||||
// Create the collision shape for the rigid body (cone shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling Dynamics::createRigidBody()
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::ConeShape collisionShape(mRadius, mHeight);
|
||||
|
||||
// Compute the inertia tensor of the body using its collision shape
|
||||
rp3d::Matrix3x3 inertiaTensor;
|
||||
collisionShape.computeLocalInertiaTensor(inertiaTensor, mass);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the cone in the dynamics world
|
||||
mRigidBody = dynamicsWorld->createRigidBody(transform, mass, inertiaTensor, collisionShape);
|
||||
mRigidBody = world->createCollisionBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
mRigidBody->addCollisionShape(collisionShape, rp3d::Transform::identity());
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Cone::Cone(float radius, float height, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius), mHeight(height) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "cone.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
||||
// Compute the scaling matrix
|
||||
mScalingMatrix = openglframework::Matrix4(mRadius, 0, 0, 0,
|
||||
0, mHeight, 0, 0,
|
||||
0, 0, mRadius, 0,
|
||||
0, 0, 0, 1);
|
||||
|
||||
// Initialize the position where the cone will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Create the collision shape for the rigid body (cone shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::ConeShape collisionShape(mRadius, mHeight);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the cone in the dynamics world
|
||||
rp3d::RigidBody* body = dynamicsWorld->createRigidBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
body->addCollisionShape(collisionShape, rp3d::Transform::identity(), mass);
|
||||
|
||||
mRigidBody = body;
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -124,7 +167,7 @@ void Cone::updateTransform() {
|
|||
rp3d::Transform transform = mRigidBody->getInterpolatedTransform();
|
||||
|
||||
// Compute the transform used for rendering the cone
|
||||
float matrix[16];
|
||||
rp3d::decimal matrix[16];
|
||||
transform.getOpenGLMatrix(matrix);
|
||||
openglframework::Matrix4 newMatrix(matrix[0], matrix[4], matrix[8], matrix[12],
|
||||
matrix[1], matrix[5], matrix[9], matrix[13],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -44,7 +44,7 @@ class Cone : public openglframework::Mesh {
|
|||
float mHeight;
|
||||
|
||||
/// Rigid body used to simulate the dynamics of the cone
|
||||
rp3d::RigidBody* mRigidBody;
|
||||
rp3d::CollisionBody* mRigidBody;
|
||||
|
||||
/// Scaling matrix (applied to a sphere to obtain the correct cone dimensions)
|
||||
openglframework::Matrix4 mScalingMatrix;
|
||||
|
@ -57,13 +57,20 @@ class Cone : public openglframework::Mesh {
|
|||
|
||||
/// Constructor
|
||||
Cone(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld);
|
||||
rp3d::CollisionWorld* world, const std::string& meshFolderPath);
|
||||
|
||||
/// Constructor
|
||||
Cone(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld, const std::string& meshFolderPath);
|
||||
|
||||
/// Destructor
|
||||
~Cone();
|
||||
|
||||
/// Return a pointer to the rigid body of the cone
|
||||
rp3d::RigidBody* getRigidBody();
|
||||
/// Return a pointer to the collision body of the box
|
||||
reactphysics3d::CollisionBody* getCollisionBody();
|
||||
|
||||
/// Return a pointer to the rigid body of the box
|
||||
reactphysics3d::RigidBody* getRigidBody();
|
||||
|
||||
/// Update the transform matrix of the cone
|
||||
void updateTransform();
|
||||
|
@ -73,9 +80,14 @@ class Cone : public openglframework::Mesh {
|
|||
const openglframework::Matrix4& worldToCameraMatrix);
|
||||
};
|
||||
|
||||
// Return a pointer to the rigid body of the cone
|
||||
inline rp3d::RigidBody* Cone::getRigidBody() {
|
||||
// Return a pointer to the collision body of the box
|
||||
inline rp3d::CollisionBody* Cone::getCollisionBody() {
|
||||
return mRigidBody;
|
||||
}
|
||||
|
||||
// Return a pointer to the rigid body of the box
|
||||
inline rp3d::RigidBody* Cone::getRigidBody() {
|
||||
return dynamic_cast<rp3d::RigidBody*>(mRigidBody);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -26,14 +26,14 @@
|
|||
// Libraries
|
||||
#include "ConvexMesh.h"
|
||||
|
||||
|
||||
// Constructor
|
||||
ConvexMesh::ConvexMesh(const openglframework::Vector3 &position, float mass,
|
||||
reactphysics3d::DynamicsWorld* dynamicsWorld)
|
||||
ConvexMesh::ConvexMesh(const openglframework::Vector3 &position,
|
||||
reactphysics3d::CollisionWorld* world,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh() {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile("meshes/convexmesh.obj", *this);
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "convexmesh.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
@ -41,12 +41,21 @@ ConvexMesh::ConvexMesh(const openglframework::Vector3 &position, float mass,
|
|||
// Initialize the position where the sphere will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Convert the vertices array to the rp3d::decimal type
|
||||
rp3d::decimal* vertices = new rp3d::decimal[3 * mVertices.size()];
|
||||
for (int i=0; i < mVertices.size(); i++) {
|
||||
vertices[3 * i] = static_cast<rp3d::decimal>(mVertices[i].x);
|
||||
vertices[3 * i + 1] = static_cast<rp3d::decimal>(mVertices[i].y);
|
||||
vertices[3 * i + 2] = static_cast<rp3d::decimal>(mVertices[i].z);
|
||||
}
|
||||
|
||||
// Create the collision shape for the rigid body (convex mesh shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling Dynamics::createRigidBody()
|
||||
rp3d::decimal* verticesArray = (rp3d::decimal*) getVerticesPointer();
|
||||
rp3d::ConvexMeshShape collisionShape(verticesArray, mVertices.size(),
|
||||
sizeof(openglframework::Vector3));
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
|
||||
rp3d::ConvexMeshShape collisionShape(vertices, mVertices.size(), 3 * sizeof(rp3d::decimal));
|
||||
|
||||
delete[] vertices;
|
||||
|
||||
// Add the edges information of the mesh into the convex mesh collision shape.
|
||||
// This is optional but it really speed up the convex mesh collision detection at the
|
||||
|
@ -65,9 +74,64 @@ ConvexMesh::ConvexMesh(const openglframework::Vector3 &position, float mass,
|
|||
}
|
||||
collisionShape.setIsEdgesInformationUsed(true);// Enable the fast collision detection with edges
|
||||
|
||||
// Compute the inertia tensor of the body using its collision shape
|
||||
rp3d::Matrix3x3 inertiaTensor;
|
||||
collisionShape.computeLocalInertiaTensor(inertiaTensor, mass);
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the sphere in the dynamics world
|
||||
mRigidBody = world->createCollisionBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the collision shape
|
||||
mRigidBody->addCollisionShape(collisionShape, rp3d::Transform::identity());
|
||||
}
|
||||
|
||||
// Constructor
|
||||
ConvexMesh::ConvexMesh(const openglframework::Vector3 &position, float mass,
|
||||
reactphysics3d::DynamicsWorld* dynamicsWorld,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh() {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "convexmesh.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
||||
// Initialize the position where the sphere will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Convert the vertices array to the rp3d::decimal type
|
||||
rp3d::decimal* vertices = new rp3d::decimal[3 * mVertices.size()];
|
||||
for (int i=0; i < mVertices.size(); i++) {
|
||||
vertices[3 * i] = static_cast<rp3d::decimal>(mVertices[i].x);
|
||||
vertices[3 * i + 1] = static_cast<rp3d::decimal>(mVertices[i].y);
|
||||
vertices[3 * i + 2] = static_cast<rp3d::decimal>(mVertices[i].z);
|
||||
}
|
||||
|
||||
// Create the collision shape for the rigid body (convex mesh shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
rp3d::ConvexMeshShape collisionShape(vertices, mVertices.size(), 3 * sizeof(rp3d::decimal));
|
||||
|
||||
delete[] vertices;
|
||||
|
||||
// Add the edges information of the mesh into the convex mesh collision shape.
|
||||
// This is optional but it really speed up the convex mesh collision detection at the
|
||||
// cost of some additional memory to store the edges inside the collision shape.
|
||||
for (unsigned int i=0; i<getNbFaces(); i++) { // For each triangle face of the mesh
|
||||
|
||||
// Get the three vertex IDs of the vertices of the face
|
||||
unsigned int v1 = getVertexIndexInFace(i, 0);
|
||||
unsigned int v2 = getVertexIndexInFace(i, 1);
|
||||
unsigned int v3 = getVertexIndexInFace(i, 2);
|
||||
|
||||
// Add the three edges into the collision shape
|
||||
collisionShape.addEdge(v1, v2);
|
||||
collisionShape.addEdge(v1, v3);
|
||||
collisionShape.addEdge(v2, v3);
|
||||
}
|
||||
collisionShape.setIsEdgesInformationUsed(true);// Enable the fast collision detection with edges
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
|
@ -75,7 +139,12 @@ ConvexMesh::ConvexMesh(const openglframework::Vector3 &position, float mass,
|
|||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the sphere in the dynamics world
|
||||
mRigidBody = dynamicsWorld->createRigidBody(transform, mass, inertiaTensor, collisionShape);
|
||||
rp3d::RigidBody* body = dynamicsWorld->createRigidBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the collision shape
|
||||
body->addCollisionShape(collisionShape, rp3d::Transform::identity(), mass);
|
||||
|
||||
mRigidBody = body;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -137,7 +206,7 @@ void ConvexMesh::updateTransform() {
|
|||
rp3d::Transform transform = mRigidBody->getInterpolatedTransform();
|
||||
|
||||
// Compute the transform used for rendering the sphere
|
||||
float matrix[16];
|
||||
rp3d::decimal matrix[16];
|
||||
transform.getOpenGLMatrix(matrix);
|
||||
openglframework::Matrix4 newMatrix(matrix[0], matrix[4], matrix[8], matrix[12],
|
||||
matrix[1], matrix[5], matrix[9], matrix[13],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -38,7 +38,7 @@ class ConvexMesh : public openglframework::Mesh {
|
|||
// -------------------- Attributes -------------------- //
|
||||
|
||||
/// Rigid body used to simulate the dynamics of the mesh
|
||||
rp3d::RigidBody* mRigidBody;
|
||||
rp3d::CollisionBody* mRigidBody;
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
|
@ -46,15 +46,22 @@ class ConvexMesh : public openglframework::Mesh {
|
|||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
/// Constructor
|
||||
ConvexMesh(const openglframework::Vector3& position,
|
||||
rp3d::CollisionWorld* world, const std::string& meshFolderPath);
|
||||
|
||||
/// Constructor
|
||||
ConvexMesh(const openglframework::Vector3& position, float mass,
|
||||
rp3d::DynamicsWorld* dynamicsWorld);
|
||||
rp3d::DynamicsWorld* dynamicsWorld, const std::string& meshFolderPath);
|
||||
|
||||
/// Destructor
|
||||
~ConvexMesh();
|
||||
|
||||
/// Return a pointer to the rigid body of the mesh
|
||||
rp3d::RigidBody* getRigidBody();
|
||||
/// Return a pointer to the collision body of the box
|
||||
reactphysics3d::CollisionBody* getCollisionBody();
|
||||
|
||||
/// Return a pointer to the rigid body of the box
|
||||
reactphysics3d::RigidBody* getRigidBody();
|
||||
|
||||
/// Update the transform matrix of the mesh
|
||||
void updateTransform();
|
||||
|
@ -64,9 +71,14 @@ class ConvexMesh : public openglframework::Mesh {
|
|||
const openglframework::Matrix4& worldToCameraMatrix);
|
||||
};
|
||||
|
||||
// Return a pointer to the rigid body of the mesh
|
||||
inline rp3d::RigidBody* ConvexMesh::getRigidBody() {
|
||||
// Return a pointer to the collision body of the box
|
||||
inline rp3d::CollisionBody* ConvexMesh::getCollisionBody() {
|
||||
return mRigidBody;
|
||||
}
|
||||
|
||||
// Return a pointer to the rigid body of the box
|
||||
inline rp3d::RigidBody* ConvexMesh::getRigidBody() {
|
||||
return dynamic_cast<rp3d::RigidBody*>(mRigidBody);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -26,14 +26,14 @@
|
|||
// Libraries
|
||||
#include "Cylinder.h"
|
||||
|
||||
|
||||
// Constructor
|
||||
Cylinder::Cylinder(float radius, float height, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld)
|
||||
Cylinder::Cylinder(float radius, float height, const openglframework::Vector3& position,
|
||||
reactphysics3d::CollisionWorld* world,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius), mHeight(height) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile("meshes/cylinder.obj", *this);
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "cylinder.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
@ -49,20 +49,63 @@ Cylinder::Cylinder(float radius, float height, const openglframework::Vector3 &p
|
|||
|
||||
// Create the collision shape for the rigid body (cylinder shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling Dynamics::createRigidBody()
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::CylinderShape collisionShape(mRadius, mHeight);
|
||||
|
||||
// Compute the inertia tensor of the body using its collision shape
|
||||
rp3d::Matrix3x3 inertiaTensor;
|
||||
collisionShape.computeLocalInertiaTensor(inertiaTensor, mass);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the cylinder in the dynamics world
|
||||
mRigidBody = dynamicsWorld->createRigidBody(transform, mass, inertiaTensor, collisionShape);
|
||||
mRigidBody = world->createCollisionBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
mRigidBody->addCollisionShape(collisionShape, rp3d::Transform::identity());
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Cylinder::Cylinder(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius), mHeight(height) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "cylinder.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
||||
// Compute the scaling matrix
|
||||
mScalingMatrix = openglframework::Matrix4(mRadius, 0, 0, 0,
|
||||
0, mHeight, 0, 0,
|
||||
0, 0, mRadius, 0,
|
||||
0, 0, 0, 1);
|
||||
|
||||
// Initialize the position where the cylinder will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Create the collision shape for the rigid body (cylinder shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::CylinderShape collisionShape(mRadius, mHeight);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the cylinder in the dynamics world
|
||||
rp3d::RigidBody* body = dynamicsWorld->createRigidBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
body->addCollisionShape(collisionShape, rp3d::Transform::identity(), mass);
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
|
||||
mRigidBody = body;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -124,7 +167,7 @@ void Cylinder::updateTransform() {
|
|||
rp3d::Transform transform = mRigidBody->getInterpolatedTransform();
|
||||
|
||||
// Compute the transform used for rendering the cylinder
|
||||
float matrix[16];
|
||||
rp3d::decimal matrix[16];
|
||||
transform.getOpenGLMatrix(matrix);
|
||||
openglframework::Matrix4 newMatrix(matrix[0], matrix[4], matrix[8], matrix[12],
|
||||
matrix[1], matrix[5], matrix[9], matrix[13],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -44,7 +44,7 @@ class Cylinder : public openglframework::Mesh {
|
|||
float mHeight;
|
||||
|
||||
/// Rigid body used to simulate the dynamics of the cylinder
|
||||
rp3d::RigidBody* mRigidBody;
|
||||
rp3d::CollisionBody* mRigidBody;
|
||||
|
||||
/// Scaling matrix (applied to a sphere to obtain the correct cylinder dimensions)
|
||||
openglframework::Matrix4 mScalingMatrix;
|
||||
|
@ -57,13 +57,20 @@ class Cylinder : public openglframework::Mesh {
|
|||
|
||||
/// Constructor
|
||||
Cylinder(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld);
|
||||
rp3d::CollisionWorld* world, const std::string &meshFolderPath);
|
||||
|
||||
/// Constructor
|
||||
Cylinder(float radius, float height, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld, const std::string &meshFolderPath);
|
||||
|
||||
/// Destructor
|
||||
~Cylinder();
|
||||
|
||||
/// Return a pointer to the rigid body of the cylinder
|
||||
rp3d::RigidBody* getRigidBody();
|
||||
/// Return a pointer to the collision body of the box
|
||||
reactphysics3d::CollisionBody* getCollisionBody();
|
||||
|
||||
/// Return a pointer to the rigid body of the box
|
||||
reactphysics3d::RigidBody* getRigidBody();
|
||||
|
||||
/// Update the transform matrix of the cylinder
|
||||
void updateTransform();
|
||||
|
@ -73,9 +80,14 @@ class Cylinder : public openglframework::Mesh {
|
|||
const openglframework::Matrix4& worldToCameraMatrix);
|
||||
};
|
||||
|
||||
// Return a pointer to the rigid body of the cylinder
|
||||
inline rp3d::RigidBody* Cylinder::getRigidBody() {
|
||||
// Return a pointer to the collision body of the box
|
||||
inline rp3d::CollisionBody* Cylinder::getCollisionBody() {
|
||||
return mRigidBody;
|
||||
}
|
||||
|
||||
// Return a pointer to the rigid body of the box
|
||||
inline rp3d::RigidBody* Cylinder::getRigidBody() {
|
||||
return dynamic_cast<rp3d::RigidBody*>(mRigidBody);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
216
examples/common/Dumbbell.cpp
Normal file
216
examples/common/Dumbbell.cpp
Normal file
|
@ -0,0 +1,216 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* 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. *
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
// Libraries
|
||||
#include "Dumbbell.h"
|
||||
|
||||
// Constructor
|
||||
Dumbbell::Dumbbell(const openglframework::Vector3 &position,
|
||||
reactphysics3d::DynamicsWorld* dynamicsWorld, const std::string& meshFolderPath)
|
||||
: openglframework::Mesh() {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "dumbbell.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
||||
// Identity scaling matrix
|
||||
mScalingMatrix.setToIdentity();
|
||||
|
||||
// Initialize the position where the sphere will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Create a sphere collision shape for the two ends of the dumbbell
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::decimal radiusSphere = rp3d::decimal(1.5);
|
||||
const rp3d::decimal massSphere = rp3d::decimal(2.0);
|
||||
const rp3d::SphereShape sphereCollisionShape(radiusSphere);
|
||||
|
||||
// Create a cylinder collision shape for the middle of the dumbbell
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::decimal radiusCylinder = rp3d::decimal(0.5);
|
||||
const rp3d::decimal heightCylinder = rp3d::decimal(8.0);
|
||||
const rp3d::decimal massCylinder = rp3d::decimal(1.0);
|
||||
const rp3d::CylinderShape cylinderCollisionShape(radiusCylinder, heightCylinder);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::decimal angleAroundX = 0;//rp3d::PI / 2;
|
||||
rp3d::Quaternion initOrientation(angleAroundX, 0, 0);
|
||||
rp3d::Transform transformBody(initPosition, initOrientation);
|
||||
|
||||
// Initial transform of the first sphere collision shape of the dumbbell (in local-space)
|
||||
rp3d::Transform transformSphereShape1(rp3d::Vector3(0, 4.0, 0), rp3d::Quaternion::identity());
|
||||
|
||||
// Initial transform of the second sphere collision shape of the dumbell (in local-space)
|
||||
rp3d::Transform transformSphereShape2(rp3d::Vector3(0, -4.0, 0), rp3d::Quaternion::identity());
|
||||
|
||||
// Initial transform of the cylinder collision shape of the dumbell (in local-space)
|
||||
rp3d::Transform transformCylinderShape(rp3d::Vector3(0, 0, 0), rp3d::Quaternion::identity());
|
||||
|
||||
// Create a rigid body corresponding to the dumbbell in the dynamics world
|
||||
rp3d::RigidBody* body = dynamicsWorld->createRigidBody(transformBody);
|
||||
|
||||
// Add the three collision shapes to the body and specify the mass and transform of the shapes
|
||||
body->addCollisionShape(sphereCollisionShape, transformSphereShape1, massSphere);
|
||||
body->addCollisionShape(sphereCollisionShape, transformSphereShape2, massSphere);
|
||||
body->addCollisionShape(cylinderCollisionShape, transformCylinderShape, massCylinder);
|
||||
|
||||
mBody = body;
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Dumbbell::Dumbbell(const openglframework::Vector3 &position,
|
||||
reactphysics3d::CollisionWorld* world, const std::string& meshFolderPath)
|
||||
: openglframework::Mesh() {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "dumbbell.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
||||
// Identity scaling matrix
|
||||
mScalingMatrix.setToIdentity();
|
||||
|
||||
// Initialize the position where the sphere will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Create a sphere collision shape for the two ends of the dumbbell
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::decimal radiusSphere = rp3d::decimal(1.5);
|
||||
const rp3d::decimal massSphere = rp3d::decimal(2.0);
|
||||
const rp3d::SphereShape sphereCollisionShape(radiusSphere);
|
||||
|
||||
// Create a cylinder collision shape for the middle of the dumbbell
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::decimal radiusCylinder = rp3d::decimal(0.5);
|
||||
const rp3d::decimal heightCylinder = rp3d::decimal(8.0);
|
||||
const rp3d::decimal massCylinder = rp3d::decimal(1.0);
|
||||
const rp3d::CylinderShape cylinderCollisionShape(radiusCylinder, heightCylinder);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::decimal angleAroundX = 0;//rp3d::PI / 2;
|
||||
rp3d::Quaternion initOrientation(angleAroundX, 0, 0);
|
||||
rp3d::Transform transformBody(initPosition, initOrientation);
|
||||
|
||||
// Initial transform of the first sphere collision shape of the dumbbell (in local-space)
|
||||
rp3d::Transform transformSphereShape1(rp3d::Vector3(0, 4.0, 0), rp3d::Quaternion::identity());
|
||||
|
||||
// Initial transform of the second sphere collision shape of the dumbell (in local-space)
|
||||
rp3d::Transform transformSphereShape2(rp3d::Vector3(0, -4.0, 0), rp3d::Quaternion::identity());
|
||||
|
||||
// Initial transform of the cylinder collision shape of the dumbell (in local-space)
|
||||
rp3d::Transform transformCylinderShape(rp3d::Vector3(0, 0, 0), rp3d::Quaternion::identity());
|
||||
|
||||
// Create a rigid body corresponding to the dumbbell in the dynamics world
|
||||
mBody = world->createCollisionBody(transformBody);
|
||||
|
||||
// Add the three collision shapes to the body and specify the mass and transform of the shapes
|
||||
mBody->addCollisionShape(sphereCollisionShape, transformSphereShape1);
|
||||
mBody->addCollisionShape(sphereCollisionShape, transformSphereShape2);
|
||||
mBody->addCollisionShape(cylinderCollisionShape, transformCylinderShape);
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Dumbbell::~Dumbbell() {
|
||||
|
||||
// Destroy the mesh
|
||||
destroy();
|
||||
}
|
||||
|
||||
// Render the sphere at the correct position and with the correct orientation
|
||||
void Dumbbell::render(openglframework::Shader& shader,
|
||||
const openglframework::Matrix4& worldToCameraMatrix) {
|
||||
|
||||
// Bind the shader
|
||||
shader.bind();
|
||||
|
||||
// Set the model to camera matrix
|
||||
const openglframework::Matrix4 localToCameraMatrix = worldToCameraMatrix * mTransformMatrix;
|
||||
shader.setMatrix4x4Uniform("localToCameraMatrix", localToCameraMatrix);
|
||||
|
||||
// Set the normal matrix (inverse transpose of the 3x3 upper-left sub matrix of the
|
||||
// model-view matrix)
|
||||
const openglframework::Matrix3 normalMatrix =
|
||||
localToCameraMatrix.getUpperLeft3x3Matrix().getInverse().getTranspose();
|
||||
shader.setMatrix3x3Uniform("normalMatrix", normalMatrix);
|
||||
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_NORMAL_ARRAY);
|
||||
if (hasTexture()) {
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
glVertexPointer(3, GL_FLOAT, 0, getVerticesPointer());
|
||||
glNormalPointer(GL_FLOAT, 0, getNormalsPointer());
|
||||
if(hasTexture()) {
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, getUVTextureCoordinatesPointer());
|
||||
}
|
||||
|
||||
// For each part of the mesh
|
||||
for (unsigned int i=0; i<getNbParts(); i++) {
|
||||
glDrawElements(GL_TRIANGLES, getNbFaces(i) * 3,
|
||||
GL_UNSIGNED_INT, getIndicesPointer());
|
||||
}
|
||||
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
if (hasTexture()) {
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
// Unbind the shader
|
||||
shader.unbind();
|
||||
}
|
||||
|
||||
// Update the transform matrix of the sphere
|
||||
void Dumbbell::updateTransform() {
|
||||
|
||||
// Get the interpolated transform of the rigid body
|
||||
rp3d::Transform transform = mBody->getInterpolatedTransform();
|
||||
|
||||
// Compute the transform used for rendering the sphere
|
||||
rp3d::decimal matrix[16];
|
||||
transform.getOpenGLMatrix(matrix);
|
||||
openglframework::Matrix4 newMatrix(matrix[0], matrix[4], matrix[8], matrix[12],
|
||||
matrix[1], matrix[5], matrix[9], matrix[13],
|
||||
matrix[2], matrix[6], matrix[10], matrix[14],
|
||||
matrix[3], matrix[7], matrix[11], matrix[15]);
|
||||
|
||||
// Apply the scaling matrix to have the correct sphere dimensions
|
||||
mTransformMatrix = newMatrix * mScalingMatrix;
|
||||
}
|
||||
|
91
examples/common/Dumbbell.h
Normal file
91
examples/common/Dumbbell.h
Normal file
|
@ -0,0 +1,91 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* 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 DUMBBELL_H
|
||||
#define DUMBBELL_H
|
||||
|
||||
// Libraries
|
||||
#include "openglframework.h"
|
||||
#include "reactphysics3d.h"
|
||||
|
||||
// Class Sphere
|
||||
class Dumbbell : public openglframework::Mesh {
|
||||
|
||||
private :
|
||||
|
||||
// -------------------- Attributes -------------------- //
|
||||
|
||||
/// Radius of the spheres
|
||||
float mRadius;
|
||||
|
||||
/// Rigid body used to simulate the dynamics of the sphere
|
||||
rp3d::CollisionBody* mBody;
|
||||
|
||||
/// Scaling matrix (applied to a sphere to obtain the correct sphere dimensions)
|
||||
openglframework::Matrix4 mScalingMatrix;
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
public :
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
/// Constructor
|
||||
Dumbbell(const openglframework::Vector3& position, rp3d::DynamicsWorld* dynamicsWorld,
|
||||
const std::string& meshFolderPath);
|
||||
|
||||
/// Constructor
|
||||
Dumbbell(const openglframework::Vector3& position, rp3d::CollisionWorld* world,
|
||||
const std::string& meshFolderPath);
|
||||
|
||||
|
||||
/// Destructor
|
||||
~Dumbbell();
|
||||
|
||||
/// Return a pointer to the rigid body
|
||||
rp3d::RigidBody* getRigidBody();
|
||||
|
||||
/// Return a pointer to the body
|
||||
rp3d::CollisionBody* getCollisionBody();
|
||||
|
||||
/// Update the transform matrix of the sphere
|
||||
void updateTransform();
|
||||
|
||||
/// Render the sphere at the correct position and with the correct orientation
|
||||
void render(openglframework::Shader& shader,
|
||||
const openglframework::Matrix4& worldToCameraMatrix);
|
||||
};
|
||||
|
||||
// Return a pointer to the rigid body of the sphere
|
||||
inline rp3d::RigidBody* Dumbbell::getRigidBody() {
|
||||
return dynamic_cast<rp3d::RigidBody*>(mBody);
|
||||
}
|
||||
|
||||
// Return a pointer to the body
|
||||
inline rp3d::CollisionBody* Dumbbell::getCollisionBody() {
|
||||
return mBody;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -24,20 +24,36 @@
|
|||
********************************************************************************/
|
||||
|
||||
// Libraries
|
||||
#include "NoBroadPhaseAlgorithm.h"
|
||||
#include "../CollisionDetection.h"
|
||||
|
||||
// We want to use the ReactPhysics3D namespace
|
||||
using namespace reactphysics3d;
|
||||
using namespace std;
|
||||
#include "Line.h"
|
||||
|
||||
// Constructor
|
||||
NoBroadPhaseAlgorithm::NoBroadPhaseAlgorithm(CollisionDetection& collisionDetection)
|
||||
: BroadPhaseAlgorithm(collisionDetection) {
|
||||
Line::Line(const openglframework::Vector3& worldPoint1,
|
||||
const openglframework::Vector3& worldPoint2)
|
||||
: mWorldPoint1(worldPoint1), mWorldPoint2(worldPoint2) {
|
||||
|
||||
}
|
||||
|
||||
// Destructor
|
||||
NoBroadPhaseAlgorithm::~NoBroadPhaseAlgorithm() {
|
||||
Line::~Line() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Render the sphere at the correct position and with the correct orientation
|
||||
void Line::render(openglframework::Shader& shader,
|
||||
const openglframework::Matrix4& worldToCameraMatrix) {
|
||||
|
||||
// Bind the shader
|
||||
shader.bind();
|
||||
|
||||
// Set the model to camera matrix
|
||||
shader.setMatrix4x4Uniform("localToCameraMatrix", worldToCameraMatrix);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
glVertex3f(mWorldPoint1.x, mWorldPoint1.y, mWorldPoint1.z);
|
||||
glVertex3f(mWorldPoint2.x, mWorldPoint2.y, mWorldPoint2.z);
|
||||
glEnd();
|
||||
|
||||
// Unbind the shader
|
||||
shader.unbind();
|
||||
}
|
79
examples/common/Line.h
Normal file
79
examples/common/Line.h
Normal file
|
@ -0,0 +1,79 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* 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 LINE_H
|
||||
#define LINE_H
|
||||
|
||||
// Libraries
|
||||
#include "openglframework.h"
|
||||
#include "reactphysics3d.h"
|
||||
|
||||
// Class Line
|
||||
class Line : public openglframework::Object3D {
|
||||
|
||||
private :
|
||||
|
||||
// -------------------- Attributes -------------------- //
|
||||
|
||||
openglframework::Vector3 mWorldPoint1, mWorldPoint2;
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
public :
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
/// Constructor
|
||||
Line(const openglframework::Vector3& worldPoint1,
|
||||
const openglframework::Vector3& worldPoint2);
|
||||
|
||||
/// Destructor
|
||||
~Line();
|
||||
|
||||
/// Return the first point of the line
|
||||
openglframework::Vector3 getPoint1() const;
|
||||
|
||||
/// Return the second point of the line
|
||||
openglframework::Vector3 getPoint2() const;
|
||||
|
||||
/// Update the transform matrix of the sphere
|
||||
void updateTransform();
|
||||
|
||||
/// Render the line at the correct position and with the correct orientation
|
||||
void render(openglframework::Shader& shader,
|
||||
const openglframework::Matrix4& worldToCameraMatrix);
|
||||
};
|
||||
|
||||
// Return the first point of the line
|
||||
inline openglframework::Vector3 Line::getPoint1() const {
|
||||
return mWorldPoint1;
|
||||
}
|
||||
|
||||
// Return the second point of the line
|
||||
inline openglframework::Vector3 Line::getPoint2() const {
|
||||
return mWorldPoint2;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -26,14 +26,14 @@
|
|||
// Libraries
|
||||
#include "Sphere.h"
|
||||
|
||||
|
||||
// Constructor
|
||||
Sphere::Sphere(float radius, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* dynamicsWorld)
|
||||
reactphysics3d::CollisionWorld* world,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile("meshes/sphere.obj", *this);
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "sphere.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
@ -49,20 +49,63 @@ Sphere::Sphere(float radius, const openglframework::Vector3 &position,
|
|||
|
||||
// Create the collision shape for the rigid body (sphere shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling Dynamics::createRigidBody()
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::SphereShape collisionShape(mRadius);
|
||||
|
||||
// Compute the inertia tensor of the body using its collision shape
|
||||
rp3d::Matrix3x3 inertiaTensor;
|
||||
collisionShape.computeLocalInertiaTensor(inertiaTensor, mass);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the sphere in the dynamics world
|
||||
mRigidBody = dynamicsWorld->createRigidBody(transform, mass, inertiaTensor, collisionShape);
|
||||
mRigidBody = world->createCollisionBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
mRigidBody->addCollisionShape(collisionShape, rp3d::Transform::identity());
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
Sphere::Sphere(float radius, const openglframework::Vector3 &position,
|
||||
float mass, reactphysics3d::DynamicsWorld* world,
|
||||
const std::string& meshFolderPath)
|
||||
: openglframework::Mesh(), mRadius(radius) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "sphere.obj", *this);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
calculateNormals();
|
||||
|
||||
// Compute the scaling matrix
|
||||
mScalingMatrix = openglframework::Matrix4(mRadius, 0, 0, 0,
|
||||
0, mRadius, 0, 0,
|
||||
0, 0, mRadius, 0,
|
||||
0, 0, 0, 1);
|
||||
|
||||
// Initialize the position where the sphere will be rendered
|
||||
translateWorld(position);
|
||||
|
||||
// Create the collision shape for the rigid body (sphere shape)
|
||||
// ReactPhysics3D will clone this object to create an internal one. Therefore,
|
||||
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
|
||||
const rp3d::SphereShape collisionShape(mRadius);
|
||||
|
||||
// Initial position and orientation of the rigid body
|
||||
rp3d::Vector3 initPosition(position.x, position.y, position.z);
|
||||
rp3d::Quaternion initOrientation = rp3d::Quaternion::identity();
|
||||
rp3d::Transform transform(initPosition, initOrientation);
|
||||
|
||||
// Create a rigid body corresponding to the sphere in the dynamics world
|
||||
rp3d::RigidBody* body = world->createRigidBody(transform);
|
||||
|
||||
// Add a collision shape to the body and specify the mass of the shape
|
||||
body->addCollisionShape(collisionShape, rp3d::Transform::identity(), mass);
|
||||
|
||||
mRigidBody = body;
|
||||
|
||||
mTransformMatrix = mTransformMatrix * mScalingMatrix;
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
@ -124,7 +167,7 @@ void Sphere::updateTransform() {
|
|||
rp3d::Transform transform = mRigidBody->getInterpolatedTransform();
|
||||
|
||||
// Compute the transform used for rendering the sphere
|
||||
float matrix[16];
|
||||
rp3d::decimal matrix[16];
|
||||
transform.getOpenGLMatrix(matrix);
|
||||
openglframework::Matrix4 newMatrix(matrix[0], matrix[4], matrix[8], matrix[12],
|
||||
matrix[1], matrix[5], matrix[9], matrix[13],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -41,7 +41,7 @@ class Sphere : public openglframework::Mesh {
|
|||
float mRadius;
|
||||
|
||||
/// Rigid body used to simulate the dynamics of the sphere
|
||||
rp3d::RigidBody* mRigidBody;
|
||||
rp3d::CollisionBody* mRigidBody;
|
||||
|
||||
/// Scaling matrix (applied to a sphere to obtain the correct sphere dimensions)
|
||||
openglframework::Matrix4 mScalingMatrix;
|
||||
|
@ -54,13 +54,20 @@ class Sphere : public openglframework::Mesh {
|
|||
|
||||
/// Constructor
|
||||
Sphere(float radius, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld);
|
||||
rp3d::CollisionWorld* world, const std::string& meshFolderPath);
|
||||
|
||||
/// Constructor
|
||||
Sphere(float radius, const openglframework::Vector3& position,
|
||||
float mass, rp3d::DynamicsWorld* dynamicsWorld, const std::string& meshFolderPath);
|
||||
|
||||
/// Destructor
|
||||
~Sphere();
|
||||
|
||||
/// Return a pointer to the rigid body of the sphere
|
||||
rp3d::RigidBody* getRigidBody();
|
||||
/// Return a pointer to the collision body of the box
|
||||
reactphysics3d::CollisionBody* getCollisionBody();
|
||||
|
||||
/// Return a pointer to the rigid body of the box
|
||||
reactphysics3d::RigidBody* getRigidBody();
|
||||
|
||||
/// Update the transform matrix of the sphere
|
||||
void updateTransform();
|
||||
|
@ -70,9 +77,14 @@ class Sphere : public openglframework::Mesh {
|
|||
const openglframework::Matrix4& worldToCameraMatrix);
|
||||
};
|
||||
|
||||
// Return a pointer to the rigid body of the sphere
|
||||
inline rp3d::RigidBody* Sphere::getRigidBody() {
|
||||
// Return a pointer to the collision body of the box
|
||||
inline rp3d::CollisionBody* Sphere::getCollisionBody() {
|
||||
return mRigidBody;
|
||||
}
|
||||
|
||||
// Return a pointer to the rigid body of the box
|
||||
inline rp3d::RigidBody* Sphere::getRigidBody() {
|
||||
return dynamic_cast<rp3d::RigidBody*>(mRigidBody);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -26,38 +26,304 @@
|
|||
// Libraries
|
||||
#include "Viewer.h"
|
||||
#include "openglframework.h"
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <sstream>
|
||||
|
||||
using namespace openglframework;
|
||||
|
||||
// Initialization of static variables
|
||||
const float Viewer::SCROLL_SENSITIVITY = 0.02f;
|
||||
|
||||
// Constructor
|
||||
Viewer::Viewer() : openglframework::GlutViewer(), fps(0), nbFrames(0) {
|
||||
Viewer::Viewer() : mFPS(0), mNbFrames(0), mPreviousTime(0) {
|
||||
|
||||
}
|
||||
|
||||
// Destructor
|
||||
Viewer::~Viewer() {
|
||||
|
||||
// Destroy the window
|
||||
glfwDestroyWindow(mWindow);
|
||||
|
||||
// Terminate GLFW
|
||||
glfwTerminate();
|
||||
}
|
||||
|
||||
// Initialize the viewer
|
||||
void Viewer::init(int argc, char** argv, const std::string& windowsTitle,
|
||||
const Vector2& windowsSize, const Vector2& windowsPosition,
|
||||
bool isMultisamplingActive) {
|
||||
|
||||
mWindowTitle = windowsTitle;
|
||||
|
||||
// Set the GLFW error callback method
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
// Initialize the GLFW library
|
||||
if (!glfwInit()) {
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Active the multi-sampling by default
|
||||
if (isMultisamplingActive) {
|
||||
glfwWindowHint(GLFW_SAMPLES, 4);
|
||||
}
|
||||
|
||||
// Create the GLFW window
|
||||
mWindow = glfwCreateWindow(static_cast<int>(windowsSize.x),
|
||||
static_cast<int>(windowsSize.y), mWindowTitle.c_str(), NULL, NULL);
|
||||
if (!mWindow) {
|
||||
glfwTerminate();
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
glfwMakeContextCurrent(mWindow);
|
||||
|
||||
// Disable Vertical Synchronization
|
||||
glfwSwapInterval(0);
|
||||
|
||||
// Initialize the GLEW library
|
||||
GLenum errorGLEW = glewInit();
|
||||
if (errorGLEW != GLEW_OK) {
|
||||
|
||||
// Problem: glewInit failed, something is wrong
|
||||
std::cerr << "GLEW Error : " << glewGetErrorString(errorGLEW) << std::endl;
|
||||
assert(false);
|
||||
std::exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (isMultisamplingActive) {
|
||||
glEnable(GL_MULTISAMPLE);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the dimension of the camera viewport
|
||||
void Viewer::reshape() {
|
||||
|
||||
// Get the framebuffer dimension
|
||||
int width, height;
|
||||
glfwGetFramebufferSize(mWindow, &width, &height);
|
||||
|
||||
// Resize the viewport
|
||||
mCamera.setDimensions(width, height);
|
||||
glViewport(0, 0, width, height);
|
||||
}
|
||||
|
||||
// Start the main loop where rendering occur
|
||||
void Viewer::startMainLoop() {
|
||||
|
||||
// Loop until the user closes the window
|
||||
while (!glfwWindowShouldClose(mWindow)) {
|
||||
|
||||
// Reshape the viewport
|
||||
reshape();
|
||||
|
||||
// Call the update function
|
||||
(*mUpdateFunctionPointer)();
|
||||
|
||||
// Swap front and back buffers
|
||||
glfwSwapBuffers(mWindow);
|
||||
|
||||
// Poll for and process events
|
||||
glfwPollEvents();
|
||||
}
|
||||
}
|
||||
|
||||
// Set the camera so that we can view the whole scene
|
||||
void Viewer::resetCameraToViewAll() {
|
||||
|
||||
// Move the camera to the origin of the scene
|
||||
mCamera.translateWorld(-mCamera.getOrigin());
|
||||
|
||||
// Move the camera to the center of the scene
|
||||
mCamera.translateWorld(mCenterScene);
|
||||
|
||||
// Set the zoom of the camera so that the scene center is
|
||||
// in negative view direction of the camera
|
||||
mCamera.setZoom(1.0);
|
||||
}
|
||||
|
||||
// Called when a mouse button event occurs
|
||||
void Viewer::mouseButtonEvent(int button, int action) {
|
||||
|
||||
// Get the mouse cursor position
|
||||
double x, y;
|
||||
glfwGetCursorPos(mWindow, &x, &y);
|
||||
|
||||
// If the mouse button is pressed
|
||||
if (action == GLFW_PRESS) {
|
||||
mLastMouseX = x;
|
||||
mLastMouseY = y;
|
||||
mIsLastPointOnSphereValid = mapMouseCoordinatesToSphere(x, y, mLastPointOnSphere);
|
||||
}
|
||||
else { // If the mouse button is released
|
||||
mIsLastPointOnSphereValid = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Called when a mouse motion event occurs
|
||||
void Viewer::mouseMotionEvent(double xMouse, double yMouse) {
|
||||
|
||||
int leftButtonState = glfwGetMouseButton(mWindow, GLFW_MOUSE_BUTTON_LEFT);
|
||||
int rightButtonState = glfwGetMouseButton(mWindow, GLFW_MOUSE_BUTTON_RIGHT);
|
||||
int middleButtonState = glfwGetMouseButton(mWindow, GLFW_MOUSE_BUTTON_MIDDLE);
|
||||
int altKeyState = glfwGetKey(mWindow, GLFW_KEY_LEFT_ALT);
|
||||
|
||||
// Zoom
|
||||
if (leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS) {
|
||||
|
||||
// Get the window dimension
|
||||
int width, height;
|
||||
glfwGetWindowSize(mWindow, &width, &height);
|
||||
|
||||
float dy = static_cast<float>(yMouse - mLastMouseY);
|
||||
float h = static_cast<float>(height);
|
||||
|
||||
// Zoom the camera
|
||||
zoom(-dy / h);
|
||||
}
|
||||
// Translation
|
||||
else if (middleButtonState == GLFW_PRESS || rightButtonState == GLFW_PRESS ||
|
||||
(leftButtonState == GLFW_PRESS && altKeyState == GLFW_PRESS)) {
|
||||
translate(xMouse, yMouse);
|
||||
}
|
||||
// Rotation
|
||||
else if (leftButtonState == GLFW_PRESS) {
|
||||
rotate(xMouse, yMouse);
|
||||
}
|
||||
|
||||
// Remember the mouse position
|
||||
mLastMouseX = xMouse;
|
||||
mLastMouseY = yMouse;
|
||||
mIsLastPointOnSphereValid = mapMouseCoordinatesToSphere(xMouse, yMouse, mLastPointOnSphere);
|
||||
}
|
||||
|
||||
// Called when a scrolling event occurs
|
||||
void Viewer::scrollingEvent(float scrollAxis) {
|
||||
zoom(scrollAxis * SCROLL_SENSITIVITY);
|
||||
}
|
||||
|
||||
// Map the mouse x,y coordinates to a point on a sphere
|
||||
bool Viewer::mapMouseCoordinatesToSphere(double xMouse, double yMouse, Vector3& spherePoint) const {
|
||||
|
||||
// Get the window dimension
|
||||
int width, height;
|
||||
glfwGetWindowSize(mWindow, &width, &height);
|
||||
|
||||
if ((xMouse >= 0) && (xMouse <= width) && (yMouse >= 0) && (yMouse <= height)) {
|
||||
float x = float(xMouse - 0.5f * width) / float(width);
|
||||
float y = float(0.5f * height - yMouse) / float(height);
|
||||
float sinx = sin(PI * x * 0.5f);
|
||||
float siny = sin(PI * y * 0.5f);
|
||||
float sinx2siny2 = sinx * sinx + siny * siny;
|
||||
|
||||
// Compute the point on the sphere
|
||||
spherePoint.x = sinx;
|
||||
spherePoint.y = siny;
|
||||
spherePoint.z = (sinx2siny2 < 1.0) ? sqrt(1.0f - sinx2siny2) : 0.0f;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Zoom the camera
|
||||
void Viewer::zoom(float zoomDiff) {
|
||||
|
||||
// Zoom the camera
|
||||
mCamera.setZoom(zoomDiff);
|
||||
}
|
||||
|
||||
// Translate the camera
|
||||
void Viewer::translate(int xMouse, int yMouse) {
|
||||
float dx = static_cast<float>(xMouse - mLastMouseX);
|
||||
float dy = static_cast<float>(yMouse - mLastMouseY);
|
||||
|
||||
// Translate the camera
|
||||
mCamera.translateCamera(-dx / float(mCamera.getWidth()),
|
||||
-dy / float(mCamera.getHeight()), mCenterScene);
|
||||
}
|
||||
|
||||
// Rotate the camera
|
||||
void Viewer::rotate(int xMouse, int yMouse) {
|
||||
|
||||
if (mIsLastPointOnSphereValid) {
|
||||
|
||||
Vector3 newPoint3D;
|
||||
bool isNewPointOK = mapMouseCoordinatesToSphere(xMouse, yMouse, newPoint3D);
|
||||
|
||||
if (isNewPointOK) {
|
||||
Vector3 axis = mLastPointOnSphere.cross(newPoint3D);
|
||||
float cosAngle = mLastPointOnSphere.dot(newPoint3D);
|
||||
|
||||
float epsilon = std::numeric_limits<float>::epsilon();
|
||||
if (fabs(cosAngle) < 1.0f && axis.length() > epsilon) {
|
||||
axis.normalize();
|
||||
float angle = 2.0f * acos(cosAngle);
|
||||
|
||||
// Rotate the camera around the center of the scene
|
||||
mCamera.rotateAroundLocalPoint(axis, -angle, mCenterScene);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check the OpenGL errors
|
||||
void Viewer::checkOpenGLErrors() {
|
||||
GLenum glError;
|
||||
|
||||
// Get the OpenGL errors
|
||||
glError = glGetError();
|
||||
|
||||
// While there are errors
|
||||
while (glError != GL_NO_ERROR) {
|
||||
|
||||
// Get the error string
|
||||
const GLubyte* stringError = gluErrorString(glError);
|
||||
|
||||
// Display the error
|
||||
if (stringError)
|
||||
std::cerr << "OpenGL Error #" << glError << "(" << gluErrorString(glError) << std::endl;
|
||||
else
|
||||
std::cerr << "OpenGL Error #" << glError << " (no message available)" << std::endl;
|
||||
|
||||
// Get the next error
|
||||
glError = glGetError();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Compute the FPS
|
||||
void Viewer::computeFPS() {
|
||||
|
||||
nbFrames++;
|
||||
mNbFrames++;
|
||||
|
||||
// Get the number of milliseconds since glutInit called
|
||||
currentTime = glutGet(GLUT_ELAPSED_TIME);
|
||||
mCurrentTime = glfwGetTime();
|
||||
|
||||
// Calculate time passed
|
||||
int timeInterval = currentTime - previousTime;
|
||||
double timeInterval = mCurrentTime - mPreviousTime;
|
||||
|
||||
// Update the FPS counter each second
|
||||
if(timeInterval > 1000){
|
||||
if(timeInterval > 1.0) {
|
||||
|
||||
// calculate the number of frames per second
|
||||
fps = static_cast<int>(nbFrames / (timeInterval / 1000.0f));
|
||||
mFPS = static_cast<double>(mNbFrames) / timeInterval;
|
||||
|
||||
// Set time
|
||||
previousTime = currentTime;
|
||||
// Set time
|
||||
mPreviousTime = mCurrentTime;
|
||||
|
||||
// Reset frame count
|
||||
nbFrames = 0;
|
||||
// Reset frame count
|
||||
mNbFrames = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// GLFW error callback method
|
||||
void Viewer::error_callback(int error, const char* description) {
|
||||
fputs(description, stderr);
|
||||
}
|
||||
|
||||
// Display the GUI
|
||||
void Viewer::displayGUI() {
|
||||
|
||||
|
@ -68,18 +334,9 @@ void Viewer::displayGUI() {
|
|||
// Display the FPS
|
||||
void Viewer::displayFPS() {
|
||||
|
||||
#ifdef USE_FREEGLUT
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0, mCamera.getWidth(), mCamera.getHeight(), 0, -1, 1);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
glRasterPos2i(10, 20);
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
std::stringstream ss;
|
||||
ss << "FPS : " << fps;
|
||||
glutBitmapString(GLUT_BITMAP_HELVETICA_12, (const unsigned char*)ss.str().c_str());
|
||||
#endif
|
||||
ss << mFPS;
|
||||
std::string fpsString = ss.str();
|
||||
std::string windowTitle = mWindowTitle + " | FPS : " + fpsString;
|
||||
glfwSetWindowTitle(mWindow, windowTitle.c_str());
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -28,30 +28,58 @@
|
|||
|
||||
// Libraries
|
||||
#include "openglframework.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
// Class Viewer
|
||||
class Viewer : public openglframework::GlutViewer {
|
||||
class Viewer {
|
||||
|
||||
private :
|
||||
|
||||
// -------------------- Constants -------------------- //
|
||||
|
||||
static const float SCROLL_SENSITIVITY;
|
||||
|
||||
// -------------------- Attributes -------------------- //
|
||||
|
||||
/// GLFW window
|
||||
GLFWwindow* mWindow;
|
||||
|
||||
/// Window title
|
||||
std::string mWindowTitle;
|
||||
|
||||
/// Camera
|
||||
openglframework::Camera mCamera;
|
||||
|
||||
/// Center of the scene
|
||||
openglframework::Vector3 mCenterScene;
|
||||
|
||||
/// Last mouse coordinates on the windows
|
||||
double mLastMouseX, mLastMouseY;
|
||||
|
||||
/// Last point computed on a sphere (for camera rotation)
|
||||
openglframework::Vector3 mLastPointOnSphere;
|
||||
|
||||
/// True if the last point computed on a sphere (for camera rotation) is valid
|
||||
bool mIsLastPointOnSphereValid;
|
||||
|
||||
/// Current number of frames per seconds
|
||||
int fps;
|
||||
double mFPS;
|
||||
|
||||
/// Number of frames during the last second
|
||||
int nbFrames;
|
||||
int mNbFrames;
|
||||
|
||||
/// Current time for fps computation
|
||||
int currentTime;
|
||||
double mCurrentTime;
|
||||
|
||||
/// Previous time for fps computation
|
||||
int previousTime;
|
||||
double mPreviousTime;
|
||||
|
||||
/// Pointer to the update function
|
||||
void (*mUpdateFunctionPointer)();
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
/// Display the FPS
|
||||
void displayFPS();
|
||||
bool mapMouseCoordinatesToSphere(double xMouse, double yMouse, openglframework::Vector3& spherePoint) const;
|
||||
|
||||
public :
|
||||
|
||||
|
@ -60,12 +88,121 @@ class Viewer : public openglframework::GlutViewer {
|
|||
/// Constructor
|
||||
Viewer();
|
||||
|
||||
/// Destructor
|
||||
~Viewer();
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
/// Initialize the viewer
|
||||
void init(int argc, char** argv, const std::string& windowsTitle,
|
||||
const openglframework::Vector2& windowsSize,
|
||||
const openglframework::Vector2& windowsPosition,
|
||||
bool isMultisamplingActive = false);
|
||||
|
||||
/// Start the main loop where rendering occur
|
||||
void startMainLoop();
|
||||
|
||||
/// Called when the windows is reshaped
|
||||
void reshape();
|
||||
|
||||
/// Set the scene position (where the camera needs to look at)
|
||||
void setScenePosition(const openglframework::Vector3& position, float sceneRadius);
|
||||
|
||||
/// Set the camera so that we can view the whole scene
|
||||
void resetCameraToViewAll();
|
||||
|
||||
/// Zoom the camera
|
||||
void zoom(float zoomDiff);
|
||||
|
||||
/// Translate the camera
|
||||
void translate(int xMouse, int yMouse);
|
||||
|
||||
/// Rotate the camera
|
||||
void rotate(int xMouse, int yMouse);
|
||||
|
||||
/// Get the camera
|
||||
openglframework::Camera& getCamera();
|
||||
|
||||
/// Called when a GLUT mouse button event occurs
|
||||
void mouseButtonEvent(int button, int action);
|
||||
|
||||
/// Called when a GLUT mouse motion event occurs
|
||||
void mouseMotionEvent(double xMouse, double yMouse);
|
||||
|
||||
/// Called when a scrolling event occurs
|
||||
void scrollingEvent(float scrollAxis);
|
||||
|
||||
/// Check the OpenGL errors
|
||||
static void checkOpenGLErrors();
|
||||
|
||||
/// Display the FPS
|
||||
void displayFPS();
|
||||
|
||||
/// Compute the FPS
|
||||
void computeFPS();
|
||||
|
||||
/// Display the GUI
|
||||
void displayGUI();
|
||||
|
||||
/// GLFW error callback method
|
||||
static void error_callback(int error, const char* description);
|
||||
|
||||
/// Register the update function that has to be called each frame
|
||||
void registerUpdateFunction(void (*updateFunctionPointer)());
|
||||
|
||||
/// Register a keyboard callback method
|
||||
void registerKeyboardCallback(GLFWkeyfun method);
|
||||
|
||||
/// Register a mouse button callback method
|
||||
void registerMouseButtonCallback(GLFWmousebuttonfun method);
|
||||
|
||||
/// Register a mouse cursor motion callback method
|
||||
void registerMouseCursorCallback(GLFWcursorposfun method);
|
||||
|
||||
/// Register a scrolling cursor callback method
|
||||
void registerScrollingCallback(GLFWscrollfun method);
|
||||
|
||||
};
|
||||
|
||||
// Set the scene position (where the camera needs to look at)
|
||||
inline void Viewer::setScenePosition(const openglframework::Vector3& position, float sceneRadius) {
|
||||
|
||||
// Set the position and radius of the scene
|
||||
mCenterScene = position;
|
||||
mCamera.setSceneRadius(sceneRadius);
|
||||
|
||||
// Reset the camera position and zoom in order to view all the scene
|
||||
resetCameraToViewAll();
|
||||
}
|
||||
|
||||
// Get the camera
|
||||
inline openglframework::Camera& Viewer::getCamera() {
|
||||
return mCamera;
|
||||
}
|
||||
|
||||
// Register the update function that has to be called each frame
|
||||
inline void Viewer::registerUpdateFunction(void (*updateFunctionPointer)()) {
|
||||
mUpdateFunctionPointer = updateFunctionPointer;
|
||||
}
|
||||
|
||||
// Register a keyboard callback method
|
||||
inline void Viewer::registerKeyboardCallback(GLFWkeyfun method) {
|
||||
glfwSetKeyCallback(mWindow, method);
|
||||
}
|
||||
|
||||
// Register a mouse button callback method
|
||||
inline void Viewer::registerMouseButtonCallback(GLFWmousebuttonfun method) {
|
||||
glfwSetMouseButtonCallback(mWindow, method);
|
||||
}
|
||||
|
||||
// Register a mouse cursor motion callback method
|
||||
inline void Viewer::registerMouseCursorCallback(GLFWcursorposfun method) {
|
||||
glfwSetCursorPosCallback(mWindow, method);
|
||||
}
|
||||
|
||||
// Register a scrolling cursor callback method
|
||||
inline void Viewer::registerScrollingCallback(GLFWscrollfun method) {
|
||||
glfwSetScrollCallback(mWindow, method);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -32,7 +32,7 @@ bool VisualContactPoint::mIsMeshInitialized = false;
|
|||
openglframework::Mesh VisualContactPoint::mMesh;
|
||||
|
||||
// Constructor
|
||||
VisualContactPoint::VisualContactPoint(const openglframework::Vector3 &position) {
|
||||
VisualContactPoint::VisualContactPoint(const openglframework::Vector3& position) {
|
||||
|
||||
assert(mIsMeshInitialized);
|
||||
|
||||
|
@ -46,12 +46,12 @@ VisualContactPoint::~VisualContactPoint() {
|
|||
}
|
||||
|
||||
// Load and initialize the mesh for all the contact points
|
||||
void VisualContactPoint::createStaticData() {
|
||||
void VisualContactPoint::createStaticData(const std::string& meshFolderPath) {
|
||||
|
||||
if (!mIsMeshInitialized) {
|
||||
|
||||
// Load the mesh from a file
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile("meshes/sphere.obj", mMesh);
|
||||
openglframework::MeshReaderWriter::loadMeshFromFile(meshFolderPath + "sphere.obj", mMesh);
|
||||
|
||||
// Calculate the normals of the mesh
|
||||
mMesh.calculateNormals();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************************
|
||||
* ReactPhysics3D physics library, http://code.google.com/p/reactphysics3d/ *
|
||||
* Copyright (c) 2010-2013 Daniel Chappuis *
|
||||
* ReactPhysics3D physics library, http://www.reactphysics3d.com *
|
||||
* Copyright (c) 2010-2015 Daniel Chappuis *
|
||||
*********************************************************************************
|
||||
* *
|
||||
* This software is provided 'as-is', without any express or implied warranty. *
|
||||
|
@ -60,7 +60,7 @@ class VisualContactPoint : public openglframework::Object3D {
|
|||
~VisualContactPoint();
|
||||
|
||||
/// Load and initialize the mesh for all the contact points
|
||||
static void createStaticData();
|
||||
static void createStaticData(const std::string& meshFolderPath);
|
||||
|
||||
/// Destroy the mesh for the contact points
|
||||
static void destroyStaticData();
|
||||
|
|
70
examples/common/glfw/.gitignore
vendored
Normal file
70
examples/common/glfw/.gitignore
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
# External junk
|
||||
.DS_Store
|
||||
_ReSharper*
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.dir
|
||||
*.vcxproj*
|
||||
*.sln
|
||||
Win32
|
||||
Debug
|
||||
Release
|
||||
|
||||
# CMake files
|
||||
Makefile
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
cmake_install.cmake
|
||||
cmake_uninstall.cmake
|
||||
|
||||
# Generated files
|
||||
docs/Doxyfile
|
||||
docs/html
|
||||
docs/warnings.txt
|
||||
src/config.h
|
||||
src/glfw3.pc
|
||||
src/glfwConfig.cmake
|
||||
src/glfwConfigVersion.cmake
|
||||
|
||||
# Compiled binaries
|
||||
src/libglfw.so
|
||||
src/libglfw.so.3
|
||||
src/libglfw.so.3.0
|
||||
src/libglfw.dylib
|
||||
src/libglfw.dylib
|
||||
src/libglfw.3.dylib
|
||||
src/libglfw.3.0.dylib
|
||||
src/libglfw3.a
|
||||
src/glfw3.lib
|
||||
src/glfw3.dll
|
||||
src/glfw3dll.lib
|
||||
src/glfw3dll.a
|
||||
examples/*.app
|
||||
examples/*.exe
|
||||
examples/boing
|
||||
examples/gears
|
||||
examples/heightmap
|
||||
examples/splitview
|
||||
examples/simple
|
||||
examples/wave
|
||||
tests/*.app
|
||||
tests/*.exe
|
||||
tests/accuracy
|
||||
tests/clipboard
|
||||
tests/defaults
|
||||
tests/events
|
||||
tests/fsaa
|
||||
tests/gamma
|
||||
tests/glfwinfo
|
||||
tests/iconify
|
||||
tests/joysticks
|
||||
tests/modes
|
||||
tests/peter
|
||||
tests/reopen
|
||||
tests/sharing
|
||||
tests/tearing
|
||||
tests/threads
|
||||
tests/title
|
||||
tests/version
|
||||
tests/windows
|
||||
|
13
examples/common/glfw/CMake/amd64-mingw32msvc.cmake
Normal file
13
examples/common/glfw/CMake/amd64-mingw32msvc.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Define the environment for cross compiling from Linux to Win64
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "amd64-mingw32msvc-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++")
|
||||
SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres")
|
||||
SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
13
examples/common/glfw/CMake/i586-mingw32msvc.cmake
Normal file
13
examples/common/glfw/CMake/i586-mingw32msvc.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
SET(CMAKE_SYSTEM_NAME Windows)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "i586-mingw32msvc-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++")
|
||||
SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres")
|
||||
SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
13
examples/common/glfw/CMake/i686-pc-mingw32.cmake
Normal file
13
examples/common/glfw/CMake/i686-pc-mingw32.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "i686-pc-mingw32-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++")
|
||||
SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib")
|
||||
|
||||
#Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
13
examples/common/glfw/CMake/i686-w64-mingw32.cmake
Normal file
13
examples/common/glfw/CMake/i686-w64-mingw32.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
|
||||
SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
16
examples/common/glfw/CMake/modules/FindEGL.cmake
Normal file
16
examples/common/glfw/CMake/modules/FindEGL.cmake
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Find EGL
|
||||
#
|
||||
# EGL_INCLUDE_DIR
|
||||
# EGL_LIBRARY
|
||||
# EGL_FOUND
|
||||
|
||||
find_path(EGL_INCLUDE_DIR NAMES EGL/egl.h PATHS /opt/vc/include)
|
||||
|
||||
set(EGL_NAMES ${EGL_NAMES} egl EGL)
|
||||
find_library(EGL_LIBRARY NAMES ${EGL_NAMES} PATHS /opt/vc/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(EGL DEFAULT_MSG EGL_LIBRARY EGL_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY)
|
||||
|
16
examples/common/glfw/CMake/modules/FindGLESv1.cmake
Normal file
16
examples/common/glfw/CMake/modules/FindGLESv1.cmake
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Find GLESv1
|
||||
#
|
||||
# GLESv1_INCLUDE_DIR
|
||||
# GLESv1_LIBRARY
|
||||
# GLESv1_FOUND
|
||||
|
||||
find_path(GLESv1_INCLUDE_DIR NAMES GLES/gl.h PATHS /opt/vc/include)
|
||||
|
||||
set(GLESv1_NAMES ${GLESv1_NAMES} GLESv1_CM)
|
||||
find_library(GLESv1_LIBRARY NAMES ${GLESv1_NAMES} PATHS /opt/vc/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLESv1 DEFAULT_MSG GLESv1_LIBRARY GLESv1_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GLESv1_INCLUDE_DIR GLESv1_LIBRARY)
|
||||
|
16
examples/common/glfw/CMake/modules/FindGLESv2.cmake
Normal file
16
examples/common/glfw/CMake/modules/FindGLESv2.cmake
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Find GLESv2
|
||||
#
|
||||
# GLESv2_INCLUDE_DIR
|
||||
# GLESv2_LIBRARY
|
||||
# GLESv2_FOUND
|
||||
|
||||
find_path(GLESv2_INCLUDE_DIR NAMES GLES2/gl2.h PATHS /opt/vc/include)
|
||||
|
||||
set(GLESv2_NAMES ${GLESv2_NAMES} GLESv2)
|
||||
find_library(GLESv2_LIBRARY NAMES ${GLESv2_NAMES} PATHS /opt/vc/lib)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GLESv2 DEFAULT_MSG GLESv2_LIBRARY GLESv2_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY)
|
||||
|
18
examples/common/glfw/CMake/modules/FindMir.cmake
Normal file
18
examples/common/glfw/CMake/modules/FindMir.cmake
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Try to find Mir on a Unix system
|
||||
#
|
||||
# This will define:
|
||||
#
|
||||
# MIR_LIBRARIES - Link these to use Wayland
|
||||
# MIR_INCLUDE_DIR - Include directory for Wayland
|
||||
#
|
||||
# Copyright (c) 2014 Brandon Schaefer <brandon.schaefer@canonical.com>
|
||||
|
||||
if (NOT WIN32)
|
||||
|
||||
find_package (PkgConfig)
|
||||
pkg_check_modules (PKG_MIR QUIET mirclient)
|
||||
|
||||
set (MIR_INCLUDE_DIR ${PKG_MIR_INCLUDE_DIRS})
|
||||
set (MIR_LIBRARIES ${PKG_MIR_LIBRARIES})
|
||||
|
||||
endif ()
|
66
examples/common/glfw/CMake/modules/FindWayland.cmake
Normal file
66
examples/common/glfw/CMake/modules/FindWayland.cmake
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Try to find Wayland on a Unix system
|
||||
#
|
||||
# This will define:
|
||||
#
|
||||
# WAYLAND_FOUND - True if Wayland is found
|
||||
# WAYLAND_LIBRARIES - Link these to use Wayland
|
||||
# WAYLAND_INCLUDE_DIR - Include directory for Wayland
|
||||
# WAYLAND_DEFINITIONS - Compiler flags for using Wayland
|
||||
#
|
||||
# In addition the following more fine grained variables will be defined:
|
||||
#
|
||||
# WAYLAND_CLIENT_FOUND WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES
|
||||
# WAYLAND_SERVER_FOUND WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES
|
||||
# WAYLAND_EGL_FOUND WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES
|
||||
#
|
||||
# Copyright (c) 2013 Martin Gräßlin <mgraesslin@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
IF (NOT WIN32)
|
||||
IF (WAYLAND_INCLUDE_DIR AND WAYLAND_LIBRARIES)
|
||||
# In the cache already
|
||||
SET(WAYLAND_FIND_QUIETLY TRUE)
|
||||
ENDIF ()
|
||||
|
||||
# Use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
PKG_CHECK_MODULES(PKG_WAYLAND QUIET wayland-client wayland-server wayland-egl wayland-cursor)
|
||||
|
||||
SET(WAYLAND_DEFINITIONS ${PKG_WAYLAND_CFLAGS})
|
||||
|
||||
FIND_PATH(WAYLAND_CLIENT_INCLUDE_DIR NAMES wayland-client.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
FIND_PATH(WAYLAND_SERVER_INCLUDE_DIR NAMES wayland-server.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
FIND_PATH(WAYLAND_EGL_INCLUDE_DIR NAMES wayland-egl.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
FIND_PATH(WAYLAND_CURSOR_INCLUDE_DIR NAMES wayland-cursor.h HINTS ${PKG_WAYLAND_INCLUDE_DIRS})
|
||||
|
||||
FIND_LIBRARY(WAYLAND_CLIENT_LIBRARIES NAMES wayland-client HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
FIND_LIBRARY(WAYLAND_CURSOR_LIBRARIES NAMES wayland-cursor HINTS ${PKG_WAYLAND_LIBRARY_DIRS})
|
||||
|
||||
set(WAYLAND_INCLUDE_DIR ${WAYLAND_CLIENT_INCLUDE_DIR} ${WAYLAND_SERVER_INCLUDE_DIR} ${WAYLAND_EGL_INCLUDE_DIR} ${WAYLAND_CURSOR_INCLUDE_DIR})
|
||||
|
||||
set(WAYLAND_LIBRARIES ${WAYLAND_CLIENT_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} ${WAYLAND_EGL_LIBRARIES} ${WAYLAND_CURSOR_LIBRARIES})
|
||||
|
||||
list(REMOVE_DUPLICATES WAYLAND_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CLIENT DEFAULT_MSG WAYLAND_CLIENT_LIBRARIES WAYLAND_CLIENT_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_SERVER DEFAULT_MSG WAYLAND_SERVER_LIBRARIES WAYLAND_SERVER_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_EGL DEFAULT_MSG WAYLAND_EGL_LIBRARIES WAYLAND_EGL_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND_CURSOR DEFAULT_MSG WAYLAND_CURSOR_LIBRARIES WAYLAND_CURSOR_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARIES WAYLAND_INCLUDE_DIR)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
WAYLAND_INCLUDE_DIR WAYLAND_LIBRARIES
|
||||
WAYLAND_CLIENT_INCLUDE_DIR WAYLAND_CLIENT_LIBRARIES
|
||||
WAYLAND_SERVER_INCLUDE_DIR WAYLAND_SERVER_LIBRARIES
|
||||
WAYLAND_EGL_INCLUDE_DIR WAYLAND_EGL_LIBRARIES
|
||||
WAYLAND_CURSOR_INCLUDE_DIR WAYLAND_CURSOR_LIBRARIES
|
||||
)
|
||||
|
||||
ENDIF ()
|
34
examples/common/glfw/CMake/modules/FindXKBCommon.cmake
Normal file
34
examples/common/glfw/CMake/modules/FindXKBCommon.cmake
Normal file
|
@ -0,0 +1,34 @@
|
|||
# - Try to find XKBCommon
|
||||
# Once done, this will define
|
||||
#
|
||||
# XKBCOMMON_FOUND - System has XKBCommon
|
||||
# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
|
||||
# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
|
||||
# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
|
||||
set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
|
||||
|
||||
find_path(XKBCOMMON_INCLUDE_DIR
|
||||
NAMES xkbcommon/xkbcommon.h
|
||||
HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(XKBCOMMON_LIBRARY
|
||||
NAMES xkbcommon
|
||||
HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
|
||||
set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS})
|
||||
set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(XKBCommon DEFAULT_MSG
|
||||
XKBCOMMON_LIBRARY
|
||||
XKBCOMMON_INCLUDE_DIR
|
||||
)
|
||||
|
||||
mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)
|
||||
|
13
examples/common/glfw/CMake/x86_64-w64-mingw32.cmake
Normal file
13
examples/common/glfw/CMake/x86_64-w64-mingw32.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Define the environment for cross compiling from Linux to Win32
|
||||
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
|
||||
SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
|
||||
SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
|
||||
SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib")
|
||||
|
||||
# Configure the behaviour of the find commands
|
||||
SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
586
examples/common/glfw/CMakeLists.txt
Normal file
586
examples/common/glfw/CMakeLists.txt
Normal file
|
@ -0,0 +1,586 @@
|
|||
project(GLFW C)
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.9)
|
||||
|
||||
if (CMAKE_VERSION VERSION_EQUAL "3.0" OR CMAKE_VERSION VERSION_GREATER "3.0")
|
||||
# Until all major package systems have moved to CMake 3,
|
||||
# we stick with the older INSTALL_NAME_DIR mechanism
|
||||
cmake_policy(SET CMP0042 OLD)
|
||||
endif()
|
||||
|
||||
set(GLFW_VERSION_MAJOR "3")
|
||||
set(GLFW_VERSION_MINOR "1")
|
||||
set(GLFW_VERSION_PATCH "0")
|
||||
set(GLFW_VERSION_EXTRA "")
|
||||
set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
|
||||
set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
|
||||
set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib will be installed: lib or lib64")
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||
option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
|
||||
option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
|
||||
option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
|
||||
option(GLFW_INSTALL "Generate installation target" ON)
|
||||
option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
|
||||
|
||||
if (WIN32)
|
||||
option(GLFW_USE_DWM_SWAP_INTERVAL "Set swap interval even when DWM compositing is enabled" OFF)
|
||||
option(GLFW_USE_OPTIMUS_HPG "Force use of high-performance GPU on Optimus systems" OFF)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
option(GLFW_BUILD_UNIVERSAL "Build GLFW as a Universal Binary" OFF)
|
||||
option(GLFW_USE_CHDIR "Make glfwInit chdir to Contents/Resources" ON)
|
||||
option(GLFW_USE_MENUBAR "Populate the menu bar on first window creation" ON)
|
||||
option(GLFW_USE_RETINA "Use the full resolution of Retina displays" ON)
|
||||
else()
|
||||
option(GLFW_USE_EGL "Use EGL for context creation" OFF)
|
||||
endif()
|
||||
|
||||
if (UNIX AND NOT APPLE)
|
||||
option(GLFW_USE_WAYLAND "Use Wayland for context creation (implies EGL as well)" OFF)
|
||||
option(GLFW_USE_MIR "Use Mir for context creation (implies EGL as well)" OFF)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
|
||||
endif()
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set(_GLFW_BUILD_DLL 1)
|
||||
endif()
|
||||
|
||||
if (GLFW_USE_WAYLAND)
|
||||
set(GLFW_USE_EGL ON)
|
||||
elseif (GLFW_USE_MIR)
|
||||
set(GLFW_USE_EGL ON)
|
||||
endif()
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(GLFW_CLIENT_LIBRARY "opengl" CACHE STRING
|
||||
"The client library to use; one of opengl, glesv1 or glesv2")
|
||||
|
||||
if (${GLFW_CLIENT_LIBRARY} STREQUAL "opengl")
|
||||
set(_GLFW_USE_OPENGL 1)
|
||||
elseif (${GLFW_CLIENT_LIBRARY} STREQUAL "glesv1")
|
||||
set(_GLFW_USE_GLESV1 1)
|
||||
elseif (${GLFW_CLIENT_LIBRARY} STREQUAL "glesv2")
|
||||
set(_GLFW_USE_GLESV2 1)
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported client library")
|
||||
endif()
|
||||
|
||||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake/modules")
|
||||
find_package(EGL REQUIRED)
|
||||
|
||||
if (NOT _GLFW_USE_OPENGL)
|
||||
set(GLFW_BUILD_EXAMPLES OFF)
|
||||
set(GLFW_BUILD_TESTS OFF)
|
||||
message(STATUS "NOTE: Examples and tests require OpenGL")
|
||||
endif()
|
||||
else()
|
||||
set(_GLFW_USE_OPENGL 1)
|
||||
endif()
|
||||
|
||||
if (_GLFW_USE_OPENGL)
|
||||
find_package(OpenGL REQUIRED)
|
||||
elseif (_GLFW_USE_GLESV1)
|
||||
find_package(GLESv1 REQUIRED)
|
||||
elseif (_GLFW_USE_GLESV2)
|
||||
find_package(GLESv2 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
if (GLFW_BUILD_DOCS)
|
||||
set(DOXYGEN_SKIP_DOT TRUE)
|
||||
find_package(Doxygen)
|
||||
|
||||
if (GLFW_DOCUMENT_INTERNALS)
|
||||
set(GLFW_INTERNAL_DOCS "${GLFW_SOURCE_DIR}/src/internal.h ${GLFW_SOURCE_DIR}/docs/internal.dox")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Set compiler specific flags
|
||||
#--------------------------------------------------------------------
|
||||
if (UNIX)
|
||||
add_definitions(-Wall)
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_definitions(-fvisibility=hidden)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
|
||||
if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
|
||||
foreach (flag CMAKE_C_FLAGS
|
||||
CMAKE_C_FLAGS_DEBUG
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_MINSIZEREL
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||
|
||||
if (${flag} MATCHES "/MD")
|
||||
string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
|
||||
endif()
|
||||
if (${flag} MATCHES "/MDd")
|
||||
string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (MINGW)
|
||||
# Enable link-time exploit mitigation features enabled by default on MSVC
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
# Compatibility with data execution prevention (DEP)
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
|
||||
check_c_compiler_flag("" _GLFW_HAS_DEP)
|
||||
if (_GLFW_HAS_DEP)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Compatibility with address space layout randomization (ASLR)
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
|
||||
check_c_compiler_flag("" _GLFW_HAS_ASLR)
|
||||
if (_GLFW_HAS_ASLR)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
|
||||
# Compatibility with 64-bit address space layout randomization (ASLR)
|
||||
set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
|
||||
check_c_compiler_flag("" _GLFW_HAS_64ASLR)
|
||||
if (_GLFW_HAS_64ASLR)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Detect and select backend APIs
|
||||
#--------------------------------------------------------------------
|
||||
if (WIN32)
|
||||
set(_GLFW_WIN32 1)
|
||||
message(STATUS "Using Win32 for window creation")
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(_GLFW_EGL 1)
|
||||
message(STATUS "Using EGL for context creation")
|
||||
else()
|
||||
set(_GLFW_WGL 1)
|
||||
message(STATUS "Using WGL for context creation")
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
set(_GLFW_COCOA 1)
|
||||
message(STATUS "Using Cocoa for window creation")
|
||||
set(_GLFW_NSGL 1)
|
||||
message(STATUS "Using NSGL for context creation")
|
||||
elseif (UNIX)
|
||||
if (GLFW_USE_WAYLAND)
|
||||
set(_GLFW_WAYLAND 1)
|
||||
message(STATUS "Using Wayland for window creation")
|
||||
elseif (GLFW_USE_MIR)
|
||||
set(_GLFW_MIR 1)
|
||||
message(STATUS "Using Mir for window creation")
|
||||
else()
|
||||
set(_GLFW_X11 1)
|
||||
message(STATUS "Using X11 for window creation")
|
||||
endif()
|
||||
|
||||
if (GLFW_USE_EGL)
|
||||
set(_GLFW_EGL 1)
|
||||
message(STATUS "Using EGL for context creation")
|
||||
else()
|
||||
set(_GLFW_GLX 1)
|
||||
message(STATUS "Using GLX for context creation")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "No supported platform was detected")
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use Win32 for window creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_WIN32)
|
||||
|
||||
list(APPEND glfw_PKG_LIBS "-lgdi32")
|
||||
|
||||
if (GLFW_USE_DWM_SWAP_INTERVAL)
|
||||
set(_GLFW_USE_DWM_SWAP_INTERVAL 1)
|
||||
endif()
|
||||
if (GLFW_USE_OPTIMUS_HPG)
|
||||
set(_GLFW_USE_OPTIMUS_HPG 1)
|
||||
endif()
|
||||
|
||||
# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
|
||||
# the inclusion of stddef.h (by glfw3.h), which is itself included before
|
||||
# win32_platform.h. We define them here until a saner solution can be found
|
||||
# NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
|
||||
add_definitions(-DUNICODE -DWINVER=0x0501)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use WGL for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_WGL)
|
||||
|
||||
list(APPEND glfw_PKG_LIBS "-lopengl32")
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
|
||||
list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use X11 for window creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_X11)
|
||||
|
||||
find_package(X11 REQUIRED)
|
||||
|
||||
list(APPEND glfw_PKG_DEPS "x11")
|
||||
|
||||
# Set up library and include paths
|
||||
list(APPEND glfw_INCLUDE_DIRS "${X11_X11_INCLUDE_PATH}")
|
||||
list(APPEND glfw_LIBRARIES "${X11_X11_LIB}" "${CMAKE_THREAD_LIBS_INIT}")
|
||||
if (UNIX AND NOT APPLE)
|
||||
list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
|
||||
endif()
|
||||
|
||||
# Check for XRandR (modern resolution switching and gamma control)
|
||||
if (NOT X11_Xrandr_FOUND)
|
||||
message(FATAL_ERROR "The RandR library and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}")
|
||||
list(APPEND glfw_LIBRARIES "${X11_Xrandr_LIB}")
|
||||
list(APPEND glfw_PKG_DEPS "xrandr")
|
||||
|
||||
# Check for Xinerama (legacy multi-monitor support)
|
||||
if (NOT X11_Xinerama_FOUND)
|
||||
message(FATAL_ERROR "The Xinerama library and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${X11_Xinerama_INCLUDE_PATH}")
|
||||
list(APPEND glfw_LIBRARIES "${X11_Xinerama_LIB}")
|
||||
list(APPEND glfw_PKG_DEPS "xinerama")
|
||||
|
||||
# Check for XInput (high-resolution cursor motion)
|
||||
if (NOT X11_Xinput_FOUND)
|
||||
message(FATAL_ERROR "The XInput library and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${X11_Xinput_INCLUDE_PATH}")
|
||||
|
||||
if (X11_Xinput_LIB)
|
||||
list(APPEND glfw_LIBRARIES "${X11_Xinput_LIB}")
|
||||
else()
|
||||
# Backwards compatibility (bug in CMake 2.8.7)
|
||||
list(APPEND glfw_LIBRARIES Xi)
|
||||
endif()
|
||||
list(APPEND glfw_PKG_DEPS "xi")
|
||||
|
||||
# Check for Xf86VidMode (fallback gamma control)
|
||||
if (NOT X11_xf86vmode_FOUND)
|
||||
message(FATAL_ERROR "The Xf86VidMode library and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${X11_xf86vmode_INCLUDE_PATH}")
|
||||
list(APPEND glfw_PKG_DEPS "xxf86vm")
|
||||
|
||||
if (X11_Xxf86vm_LIB)
|
||||
list(APPEND glfw_LIBRARIES "${X11_Xxf86vm_LIB}")
|
||||
else()
|
||||
# Backwards compatibility (see CMake bug 0006976)
|
||||
list(APPEND glfw_LIBRARIES Xxf86vm)
|
||||
endif()
|
||||
|
||||
# Check for Xkb (X keyboard extension)
|
||||
if (NOT X11_Xkb_FOUND)
|
||||
message(FATAL_ERROR "The X keyboard extension headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIR "${X11_Xkb_INCLUDE_PATH}")
|
||||
|
||||
find_library(RT_LIBRARY rt)
|
||||
mark_as_advanced(RT_LIBRARY)
|
||||
if (RT_LIBRARY)
|
||||
list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lrt")
|
||||
endif()
|
||||
|
||||
find_library(MATH_LIBRARY m)
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
if (MATH_LIBRARY)
|
||||
list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lm")
|
||||
endif()
|
||||
|
||||
# Check for Xcursor
|
||||
if (NOT X11_Xcursor_FOUND)
|
||||
message(FATAL_ERROR "The Xcursor libraries and headers were not found")
|
||||
endif()
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIR "${X11_Xcursor_INCLUDE_PATH}")
|
||||
list(APPEND glfw_LIBRARIES "${X11_Xcursor_LIB}")
|
||||
list(APPEND glfw_PKG_DEPS "xcursor")
|
||||
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use Wayland for window creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_WAYLAND)
|
||||
find_package(Wayland REQUIRED)
|
||||
list(APPEND glfw_PKG_DEPS "wayland-egl")
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${WAYLAND_INCLUDE_DIR}")
|
||||
list(APPEND glfw_LIBRARIES "${WAYLAND_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
|
||||
|
||||
find_package(XKBCommon REQUIRED)
|
||||
list(APPEND glfw_PKG_DEPS "xkbcommon")
|
||||
list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
|
||||
list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}")
|
||||
|
||||
find_library(MATH_LIBRARY m)
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
if (MATH_LIBRARY)
|
||||
list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lm")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use Mir for window creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_MIR)
|
||||
find_package(Mir REQUIRED)
|
||||
list(APPEND glfw_PKG_DEPS "mirclient")
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${MIR_INCLUDE_DIR}")
|
||||
list(APPEND glfw_LIBRARIES "${MIR_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
|
||||
|
||||
find_package(XKBCommon REQUIRED)
|
||||
list(APPEND glfw_PKG_DEPS "xkbcommon")
|
||||
list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
|
||||
list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}")
|
||||
|
||||
find_library(MATH_LIBRARY m)
|
||||
mark_as_advanced(MATH_LIBRARY)
|
||||
if (MATH_LIBRARY)
|
||||
list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
|
||||
list(APPEND glfw_PKG_LIBS "-lm")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use GLX for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_GLX)
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
|
||||
list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
|
||||
|
||||
list(APPEND glfw_PKG_DEPS "gl")
|
||||
|
||||
include(CheckFunctionExists)
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${OPENGL_gl_LIBRARY}")
|
||||
check_function_exists(glXGetProcAddress _GLFW_HAS_GLXGETPROCADDRESS)
|
||||
check_function_exists(glXGetProcAddressARB _GLFW_HAS_GLXGETPROCADDRESSARB)
|
||||
check_function_exists(glXGetProcAddressEXT _GLFW_HAS_GLXGETPROCADDRESSEXT)
|
||||
|
||||
if (NOT _GLFW_HAS_GLXGETPROCADDRESS AND
|
||||
NOT _GLFW_HAS_GLXGETPROCADDRESSARB AND
|
||||
NOT _GLFW_HAS_GLXGETPROCADDRESSEXT)
|
||||
message(WARNING "No glXGetProcAddressXXX variant found")
|
||||
|
||||
# Check for dlopen support as a fallback
|
||||
|
||||
set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_DL_LIBS}")
|
||||
check_function_exists(dlopen _GLFW_HAS_DLOPEN)
|
||||
if (NOT _GLFW_HAS_DLOPEN)
|
||||
message(FATAL_ERROR "No entry point retrieval mechanism found")
|
||||
endif()
|
||||
|
||||
if (CMAKE_DL_LIBS)
|
||||
list(APPEND glfw_LIBRARIES "${CMAKE_DL_LIBS}")
|
||||
list(APPEND glfw_PKG_LIBS "-l${CMAKE_DL_LIBS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use EGL for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_EGL)
|
||||
|
||||
list(APPEND glfw_INCLUDE_DIRS "${EGL_INCLUDE_DIR}")
|
||||
list(APPEND glfw_LIBRARIES "${EGL_LIBRARY}")
|
||||
|
||||
list(APPEND glfw_PKG_DEPS "egl")
|
||||
|
||||
if (_GLFW_USE_OPENGL)
|
||||
list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
|
||||
list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
|
||||
list(APPEND glfw_PKG_DEPS "gl")
|
||||
elseif (_GLFW_USE_GLESV1)
|
||||
list(APPEND glfw_LIBRARIES "${GLESv1_LIBRARY}")
|
||||
list(APPEND glfw_INCLUDE_DIRS "${GLESv1_INCLUDE_DIR}")
|
||||
list(APPEND glfw_PKG_DEPS "glesv1_cm")
|
||||
elseif (_GLFW_USE_GLESV2)
|
||||
list(APPEND glfw_LIBRARIES "${GLESv2_LIBRARY}")
|
||||
list(APPEND glfw_INCLUDE_DIRS "${GLESv2_INCLUDE_DIR}")
|
||||
list(APPEND glfw_PKG_DEPS "glesv2")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Use Cocoa for window creation and NSOpenGL for context creation
|
||||
#--------------------------------------------------------------------
|
||||
if (_GLFW_COCOA AND _GLFW_NSGL)
|
||||
|
||||
if (GLFW_USE_MENUBAR)
|
||||
set(_GLFW_USE_MENUBAR 1)
|
||||
endif()
|
||||
|
||||
if (GLFW_USE_CHDIR)
|
||||
set(_GLFW_USE_CHDIR 1)
|
||||
endif()
|
||||
|
||||
if (GLFW_USE_RETINA)
|
||||
set(_GLFW_USE_RETINA 1)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_UNIVERSAL)
|
||||
message(STATUS "Building GLFW as Universal Binaries")
|
||||
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
|
||||
else()
|
||||
message(STATUS "Building GLFW only for the native architecture")
|
||||
endif()
|
||||
|
||||
# Set up library and include paths
|
||||
find_library(COCOA_FRAMEWORK Cocoa)
|
||||
find_library(IOKIT_FRAMEWORK IOKit)
|
||||
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
|
||||
find_library(CORE_VIDEO_FRAMEWORK CoreVideo)
|
||||
mark_as_advanced(COCOA_FRAMEWORK
|
||||
IOKIT_FRAMEWORK
|
||||
CORE_FOUNDATION_FRAMEWORK
|
||||
CORE_VIDEO_FRAMEWORK)
|
||||
list(APPEND glfw_LIBRARIES "${COCOA_FRAMEWORK}"
|
||||
"${OPENGL_gl_LIBRARY}"
|
||||
"${IOKIT_FRAMEWORK}"
|
||||
"${CORE_FOUNDATION_FRAMEWORK}"
|
||||
"${CORE_VIDEO_FRAMEWORK}")
|
||||
|
||||
set(glfw_PKG_DEPS "")
|
||||
set(glfw_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo")
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Export GLFW library dependencies
|
||||
#--------------------------------------------------------------------
|
||||
set(GLFW_LIBRARIES ${glfw_LIBRARIES} CACHE STRING "Dependencies of GLFW")
|
||||
foreach(arg ${glfw_PKG_DEPS})
|
||||
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}")
|
||||
endforeach()
|
||||
foreach(arg ${glfw_PKG_LIBS})
|
||||
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}")
|
||||
endforeach()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Choose library output name
|
||||
#--------------------------------------------------------------------
|
||||
if (BUILD_SHARED_LIBS AND UNIX)
|
||||
# On Unix-like systems, shared libraries can use the soname system.
|
||||
set(GLFW_LIB_NAME glfw)
|
||||
else()
|
||||
set(GLFW_LIB_NAME glfw3)
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Create generated files
|
||||
#--------------------------------------------------------------------
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if (UNIX)
|
||||
set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/lib/cmake/glfw3/")
|
||||
else()
|
||||
set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/")
|
||||
endif()
|
||||
|
||||
configure_package_config_file("${GLFW_SOURCE_DIR}/src/glfw3Config.cmake.in"
|
||||
"${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
|
||||
INSTALL_DESTINATION "${GLFW_CONFIG_PATH}"
|
||||
PATH_VARS CMAKE_INSTALL_PREFIX
|
||||
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
|
||||
|
||||
write_basic_package_version_file("${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
|
||||
VERSION ${GLFW_VERSION_FULL}
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
if (GLFW_BUILD_DOCS)
|
||||
configure_file("${GLFW_SOURCE_DIR}/docs/Doxyfile.in"
|
||||
"${GLFW_BINARY_DIR}/docs/Doxyfile" @ONLY)
|
||||
endif()
|
||||
|
||||
configure_file("${GLFW_SOURCE_DIR}/src/glfw_config.h.in"
|
||||
"${GLFW_BINARY_DIR}/src/glfw_config.h" @ONLY)
|
||||
|
||||
configure_file("${GLFW_SOURCE_DIR}/src/glfw3.pc.in"
|
||||
"${GLFW_BINARY_DIR}/src/glfw3.pc" @ONLY)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Add subdirectories
|
||||
#--------------------------------------------------------------------
|
||||
add_subdirectory(src)
|
||||
|
||||
if (GLFW_BUILD_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
if (GLFW_BUILD_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
|
||||
add_subdirectory(docs)
|
||||
endif()
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Install files other than the library
|
||||
# The library is installed by src/CMakeLists.txt
|
||||
#--------------------------------------------------------------------
|
||||
if (GLFW_INSTALL)
|
||||
install(DIRECTORY include/GLFW DESTINATION include
|
||||
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
|
||||
|
||||
install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
|
||||
"${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
|
||||
DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
|
||||
|
||||
install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
|
||||
install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
|
||||
DESTINATION lib${LIB_SUFFIX}/pkgconfig)
|
||||
|
||||
# Only generate this target if no higher-level project already has
|
||||
if (NOT TARGET uninstall)
|
||||
configure_file("${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${GLFW_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
"${CMAKE_COMMAND}" -P
|
||||
"${GLFW_BINARY_DIR}/cmake_uninstall.cmake")
|
||||
endif()
|
||||
endif()
|
||||
|
22
examples/common/glfw/COPYING.txt
Normal file
22
examples/common/glfw/COPYING.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) 2002-2006 Marcus Geelnard
|
||||
Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.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.
|
||||
|
294
examples/common/glfw/README.md
Normal file
294
examples/common/glfw/README.md
Normal file
|
@ -0,0 +1,294 @@
|
|||
# GLFW
|
||||
|
||||
## Introduction
|
||||
|
||||
GLFW is a free, Open Source, multi-platform library for OpenGL and OpenGL ES
|
||||
application development. It provides a simple, platform-independent API for
|
||||
creating windows and contexts, reading input, handling events, etc.
|
||||
|
||||
Version 3.1 adds improved documentation, support for custom system cursors, file
|
||||
drop events, main thread wake-up, window frame size retrieval, floating windows,
|
||||
character input with modifier keys, single buffered windows, build improvements
|
||||
and fixes for a large number of bugs.
|
||||
|
||||
If you are new to GLFW, you may find the
|
||||
[introductory tutorial](http://www.glfw.org/docs/latest/quick.html) for GLFW
|
||||
3 useful. If you have used GLFW 2 in the past, there is a
|
||||
[transition guide](http://www.glfw.org/docs/latest/moving.html) for moving to
|
||||
the GLFW 3 API.
|
||||
|
||||
Note that a number of source files have been added or renamed in 3.1, which may
|
||||
require you to update any custom build files you have.
|
||||
|
||||
|
||||
## Compiling GLFW
|
||||
|
||||
See the [Compiling GLFW](http://www.glfw.org/docs/latest/compile.html) guide in
|
||||
the GLFW documentation.
|
||||
|
||||
|
||||
## Using GLFW
|
||||
|
||||
See the
|
||||
[Building programs that use GLFW](http://www.glfw.org/docs/latest/build.html)
|
||||
guide in the GLFW documentation.
|
||||
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues).
|
||||
Please always include the name and version of the OS where the bug occurs and
|
||||
the version of GLFW used. If you have cloned it, include the commit ID used.
|
||||
|
||||
If it's a build issue, please also include the build log and the name and
|
||||
version of your development environment.
|
||||
|
||||
If it's a context creation issue, please also include the make and model of your
|
||||
graphics card and the version of your driver.
|
||||
|
||||
This will help both us and other people experiencing the same bug.
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
GLFW bundles a number of dependencies in the `deps/` directory.
|
||||
|
||||
- [Khronos extension headers](https://www.opengl.org/registry/) for API
|
||||
extension symbols used by GLFW
|
||||
- [getopt\_port](https://github.com/kimgr/getopt_port/) for examples
|
||||
with command-line options
|
||||
- [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded
|
||||
examples
|
||||
- An OpenGL 3.2 core loader generated by
|
||||
[glad](https://github.com/Dav1dde/glad) for examples using modern OpenGL
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
- Added `GLFWcursor` custom system cursor handle
|
||||
- Added `glfwCreateCursor`, `glfwCreateStandardCursor`, `glfwDestroyCursor` and
|
||||
`glfwSetCursor` for managing system cursor images
|
||||
- Added `GLFWimage` struct for passing 32-bit RGBA images
|
||||
- Added monitor and adapter identifier access to native API
|
||||
- Added `glfwSetDropCallback` and `GLFWdropfun` for receiving dropped files
|
||||
- Added `glfwPostEmptyEvent` for allowing secondary threads to cause
|
||||
`glfwWaitEvents` to return
|
||||
- Added `empty` test program for verifying posting of empty events
|
||||
- Added `glfwSetCharModsCallback` for receiving character events with modifiers
|
||||
- Added `glfwGetWindowFrameSize` for retrieving the size of the frame around
|
||||
the client area of a window
|
||||
- Added `GLFW_AUTO_ICONIFY` for controlling whether full screen windows
|
||||
automatically iconify (and restore the previous video mode) on focus loss
|
||||
- Added `GLFW_DONT_CARE` for indicating that any value is acceptable
|
||||
- Added `GLFW_DOUBLEBUFFER` for controlling whether to use double buffering
|
||||
- Added `GLFW_CONTEXT_RELEASE_BEHAVIOR` and values
|
||||
`GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` and
|
||||
`GLFW_RELEASE_BEHAVIOR_NONE` for `GL_KHR_context_flush_control` support
|
||||
- Added `GLFW_INCLUDE_ES31` for including the OpenGL ES 3.1 header
|
||||
- Added `GLFW_FLOATING` for creating always-on-top windowed mode windows
|
||||
- Added `GLFW_FOCUSED` window hint for controlling initial input focus
|
||||
- Added *partial and experimental* support for Wayland
|
||||
- Added *partial and experimental* support for Mir
|
||||
- Changed the window state attributes (focused, iconified and visible) to query
|
||||
the system directly
|
||||
- Changed the default of `GLFW_REFRESH_RATE` to `GLFW_DONT_CARE` to maintain
|
||||
the default behavior
|
||||
- Changed static library to build as position independent code for easier use
|
||||
from the Rust language
|
||||
- Changed `glfwGetCursorPos` to query the system directly for all cursor modes
|
||||
except captured mode
|
||||
- Bugfix: The debug context attribute was set from `GL_ARB_debug_output` even
|
||||
when a debug context had not been requested
|
||||
- Bugfix: The particles example was not linked against the threading library
|
||||
- Bugfix: The cursor was not positioned over newly created full screen windows
|
||||
- Bugfix: The queried cursor position was not always up-to-date
|
||||
- Bugfix: `glfwExtensionSupported` always failed for OpenGL ES 3.0 and later if
|
||||
the library was compiled for OpenGL ES
|
||||
- [Cocoa] Added `_GLFW_USE_RETINA` to control whether windows will use the full
|
||||
resolution on Retina displays
|
||||
- [Cocoa] Made content view subclass of `NSOpenGLView`
|
||||
- [Cocoa] Bugfix: Using a 1x1 cursor for hidden mode caused some screen
|
||||
recorders to fail
|
||||
- [Cocoa] Bugfix: Some Core Foundation objects were leaked during joystick
|
||||
enumeration and termination
|
||||
- [Cocoa] Bugfix: One copy of each display name string was leaked
|
||||
- [Cocoa] Bugfix: Monitor enumeration caused a segfault if no `NSScreen` was
|
||||
found for a given `CGDisplay`
|
||||
- [Cocoa] Bugfix: Modifier key events were lost if the corresponding modifier
|
||||
bit field was unchanged
|
||||
- [Cocoa] Bugfix: Joystick enumeration took hundreds of ms on some systems
|
||||
- [Cocoa] Bugfix: The cursor was hidden when the user resized a GLFW window
|
||||
- [Cocoa] Bugfix: The 10.10 Yosemite OpenGL 4.1 profile token was not used
|
||||
- [Cocoa] Bugfix: The generic software OpenGL renderer could be selected under
|
||||
certain conditions
|
||||
- [Cocoa] Bugfix: The virtual cursor jumped unpredictably when entering
|
||||
disabled cursor mode
|
||||
- [Win32] Enabled generation of pkg-config file for MinGW
|
||||
- [Win32] Removed option to require explicitly linking against `winmm.dll`
|
||||
- [Win32] Bugfix: Failure to load winmm or its functions was not reported to
|
||||
the error callback
|
||||
- [Win32] Bugfix: Some keys were reported based on the current layout instead
|
||||
of their physical location
|
||||
- [Win32] Bugfix: Maximized hidden windows were restored by `glfwShowWindow`
|
||||
- [Win32] Bugfix: Context re-creation was not triggered by sRGB hint
|
||||
- [Win32] Bugfix: Full screen windows were incorrectly sized and placed on some
|
||||
systems
|
||||
- [Win32] Bugfix: Gamma ramp functions acted on entire desktop instead of the
|
||||
specified monitor
|
||||
- [Win32] Bugfix: The wrong incorrect physical size was returned for
|
||||
non-primary monitors
|
||||
- [Win32] Bugfix: X-axis scroll offsets were inverted
|
||||
- [Win32] Bugfix: The Optimus HPG forcing variable was not correctly exported
|
||||
- [Win32] Bugfix: The iconified window state attribute was not always updated
|
||||
- [Win32] Bugfix: Previously focused windows with disabled cursor mode and that
|
||||
had been iconified by Win+D were not visible when restored
|
||||
- [Win32] Bugfix: The virtual cursor jumped unpredictably when entering
|
||||
disabled cursor mode
|
||||
- [X11] Added run-time support for systems lacking the XKB extension
|
||||
- [X11] Made GLX 1.3 the minimum supported version
|
||||
- [X11] Replaced `XRRGetScreenResources` with `XRRGetScreenResourcesCurrent`
|
||||
for monitor property retrieval
|
||||
- [X11] Bugfix: The case of finding no usable CRTCs was not detected
|
||||
- [X11] Bugfix: Detection of broken Nvidia RandR gamma support did not verify
|
||||
that at least one CRTC was present
|
||||
- [X11] Bugfix: A stale `_NET_SUPPORTING_WM_CHECK` root window property would
|
||||
cause an uncaught `BadWindow` error
|
||||
- [X11] Bugfix: No check was made for the presence of GLX 1.3 when
|
||||
`GLX_SGIX_fbconfig` was unavailable
|
||||
- [X11] Bugfix: The message type of ICCCM protocol events was not checked
|
||||
- [X11] Bugfix: `glfwDestroyWindow` did not flush the output buffer
|
||||
- [X11] Bugfix: Window frame interactions were reported as focus events
|
||||
- [X11] Bugfix: Workaround for legacy Compiz caused flickering during resize
|
||||
- [X11] Bugfix: The name pointer of joysticks were not cleared on disconnection
|
||||
- [X11] Bugfix: Video mode resolutions and monitor physical sizes were not
|
||||
corrected for rotated CRTCs
|
||||
- [X11] Bugfix: Unicode character input ignored dead keys
|
||||
- [X11] Bugfix: X-axis scroll offsets were inverted
|
||||
- [X11] Bugfix: Full screen override redirect windows were not always
|
||||
positioned over the specified monitor
|
||||
- [X11] Bugfix: Character input did not work for the default `"C"` locale
|
||||
- [X11] Bugfix: Joysticks connected after `glfwInit` were not detected
|
||||
(temporary inotify solution until proper libudev solution)
|
||||
|
||||
|
||||
## Contact
|
||||
|
||||
The official website for GLFW is [glfw.org](http://www.glfw.org/). There you
|
||||
can find the latest version of GLFW, as well as news, documentation and other
|
||||
information about the project.
|
||||
|
||||
If you have questions related to the use of GLFW, we have a
|
||||
[support forum](https://sourceforge.net/p/glfw/discussion/247562/), and the IRC
|
||||
channel `#glfw` on [Freenode](http://freenode.net/).
|
||||
|
||||
If you have a bug to report, a patch to submit or a feature you'd like to
|
||||
request, please file it in the
|
||||
[issue tracker](https://github.com/glfw/glfw/issues) on GitHub.
|
||||
|
||||
Finally, if you're interested in helping out with the development of GLFW or
|
||||
porting it to your favorite platform, we have an occasionally active
|
||||
[developer's mailing list](https://lists.stacken.kth.se/mailman/listinfo/glfw-dev),
|
||||
or you could join us on `#glfw`.
|
||||
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
GLFW exists because people around the world donated their time and lent their
|
||||
skills.
|
||||
|
||||
- Bobyshev Alexander
|
||||
- artblanc
|
||||
- arturo
|
||||
- Matt Arsenault
|
||||
- Keith Bauer
|
||||
- John Bartholomew
|
||||
- Niklas Behrens
|
||||
- Niklas Bergström
|
||||
- Doug Binks
|
||||
- blanco
|
||||
- Martin Capitanio
|
||||
- Lambert Clara
|
||||
- Andrew Corrigan
|
||||
- Noel Cower
|
||||
- Jarrod Davis
|
||||
- Olivier Delannoy
|
||||
- Paul R. Deppe
|
||||
- Michael Dickens
|
||||
- Jonathan Dummer
|
||||
- Ralph Eastwood
|
||||
- Michael Fogleman
|
||||
- Gerald Franz
|
||||
- GeO4d
|
||||
- Marcus Geelnard
|
||||
- Eloi Marín Gratacós
|
||||
- Stefan Gustavson
|
||||
- Sylvain Hellegouarch
|
||||
- Matthew Henry
|
||||
- heromyth
|
||||
- Lucas Hinderberger
|
||||
- Paul Holden
|
||||
- Toni Jovanoski
|
||||
- Arseny Kapoulkine
|
||||
- Osman Keskin
|
||||
- Cameron King
|
||||
- Peter Knut
|
||||
- Robin Leffmann
|
||||
- Glenn Lewis
|
||||
- Shane Liesegang
|
||||
- Дмитри Малышев
|
||||
- Martins Mozeiko
|
||||
- Tristam MacDonald
|
||||
- Hans Mackowiak
|
||||
- Kyle McDonald
|
||||
- David Medlock
|
||||
- Jonathan Mercier
|
||||
- Marcel Metz
|
||||
- Kenneth Miller
|
||||
- Bruce Mitchener
|
||||
- Jack Moffitt
|
||||
- Jeff Molofee
|
||||
- Jon Morton
|
||||
- Pierre Moulon
|
||||
- Julian Møller
|
||||
- Kamil Nowakowski
|
||||
- Ozzy
|
||||
- Andri Pálsson
|
||||
- Peoro
|
||||
- Braden Pellett
|
||||
- Arturo J. Pérez
|
||||
- Cyril Pichard
|
||||
- Pieroman
|
||||
- Jorge Rodriguez
|
||||
- Ed Ropple
|
||||
- Riku Salminen
|
||||
- Brandon Schaefer
|
||||
- Sebastian Schuberth
|
||||
- Matt Sealey
|
||||
- SephiRok
|
||||
- Steve Sexton
|
||||
- Systemcluster
|
||||
- Dmitri Shuralyov
|
||||
- Daniel Skorupski
|
||||
- Bradley Smith
|
||||
- Julian Squires
|
||||
- Johannes Stein
|
||||
- Justin Stoecker
|
||||
- Nathan Sweet
|
||||
- TTK-Bandit
|
||||
- Sergey Tikhomirov
|
||||
- Samuli Tuomola
|
||||
- urraka
|
||||
- Jari Vetoniemi
|
||||
- Ricardo Vieira
|
||||
- Simon Voordouw
|
||||
- Torsten Walluhn
|
||||
- Patrick Walton
|
||||
- Jay Weisskopf
|
||||
- Frank Wille
|
||||
- yuriks
|
||||
- Santi Zupancic
|
||||
- Jonas Ådahl
|
||||
- Lasse Öörni
|
||||
- All the unmentioned and anonymous contributors in the GLFW community, for bug
|
||||
reports, patches, feedback, testing and encouragement
|
||||
|
29
examples/common/glfw/cmake_uninstall.cmake.in
Normal file
29
examples/common/glfw/cmake_uninstall.cmake.in
Normal file
|
@ -0,0 +1,29 @@
|
|||
|
||||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif()
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
|
||||
foreach (file ${files})
|
||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
if (EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval)
|
||||
if (NOT "${rm_retval}" STREQUAL 0)
|
||||
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
endif()
|
||||
elseif (IS_SYMLINK "$ENV{DESTDIR}${file}")
|
||||
EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval)
|
||||
if (NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
endif()
|
||||
endforeach()
|
||||
|
565
examples/common/glfw/deps/EGL/eglext.h
Normal file
565
examples/common/glfw/deps/EGL/eglext.h
Normal file
|
@ -0,0 +1,565 @@
|
|||
#ifndef __eglext_h_
|
||||
#define __eglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2013 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* Current version at http://www.khronos.org/registry/egl/ */
|
||||
/* $Revision: 20690 $ on $Date: 2013-02-22 17:15:05 -0800 (Fri, 22 Feb 2013) $ */
|
||||
#define EGL_EGLEXT_VERSION 15
|
||||
|
||||
#ifndef EGL_KHR_config_attribs
|
||||
#define EGL_KHR_config_attribs 1
|
||||
#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface
|
||||
#define EGL_KHR_lock_surface 1
|
||||
#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
|
||||
#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
|
||||
#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image
|
||||
#define EGL_KHR_image 1
|
||||
#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
|
||||
typedef void *EGLImageKHR;
|
||||
#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_vg_parent_image
|
||||
#define EGL_KHR_vg_parent_image 1
|
||||
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_2D_image
|
||||
#define EGL_KHR_gl_texture_2D_image 1
|
||||
#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_cubemap_image
|
||||
#define EGL_KHR_gl_texture_cubemap_image 1
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_3D_image
|
||||
#define EGL_KHR_gl_texture_3D_image 1
|
||||
#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_renderbuffer_image
|
||||
#define EGL_KHR_gl_renderbuffer_image 1
|
||||
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_reusable_sync
|
||||
#define EGL_KHR_reusable_sync 1
|
||||
|
||||
typedef void* EGLSyncKHR;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
||||
|
||||
#define EGL_SYNC_STATUS_KHR 0x30F1
|
||||
#define EGL_SIGNALED_KHR 0x30F2
|
||||
#define EGL_UNSIGNALED_KHR 0x30F3
|
||||
#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
|
||||
#define EGL_CONDITION_SATISFIED_KHR 0x30F6
|
||||
#define EGL_SYNC_TYPE_KHR 0x30F7
|
||||
#define EGL_SYNC_REUSABLE_KHR 0x30FA
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */
|
||||
#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image_base
|
||||
#define EGL_KHR_image_base 1
|
||||
/* Most interfaces defined by EGL_KHR_image_pixmap above */
|
||||
#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image_pixmap
|
||||
#define EGL_KHR_image_pixmap 1
|
||||
/* Interfaces defined by EGL_KHR_image above */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_IMG_context_priority
|
||||
#define EGL_IMG_context_priority 1
|
||||
#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
|
||||
#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
|
||||
#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
|
||||
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface2
|
||||
#define EGL_KHR_lock_surface2 1
|
||||
#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_coverage_sample
|
||||
#define EGL_NV_coverage_sample 1
|
||||
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
|
||||
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_depth_nonlinear
|
||||
#define EGL_NV_depth_nonlinear 1
|
||||
#define EGL_DEPTH_ENCODING_NV 0x30E2
|
||||
#define EGL_DEPTH_ENCODING_NONE_NV 0
|
||||
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
|
||||
#ifndef EGL_NV_sync
|
||||
#define EGL_NV_sync 1
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
|
||||
#define EGL_SYNC_STATUS_NV 0x30E7
|
||||
#define EGL_SIGNALED_NV 0x30E8
|
||||
#define EGL_UNSIGNALED_NV 0x30E9
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
|
||||
#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_ALREADY_SIGNALED_NV 0x30EA
|
||||
#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
|
||||
#define EGL_CONDITION_SATISFIED_NV 0x30EC
|
||||
#define EGL_SYNC_TYPE_NV 0x30ED
|
||||
#define EGL_SYNC_CONDITION_NV 0x30EE
|
||||
#define EGL_SYNC_FENCE_NV 0x30EF
|
||||
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
|
||||
typedef void* EGLSyncNV;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeNV;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncNV EGLAPIENTRY eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncNV (EGLSyncNV sync);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglFenceNV (EGLSyncNV sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_fence_sync
|
||||
#define EGL_KHR_fence_sync 1
|
||||
/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
|
||||
#define EGL_SYNC_CONDITION_KHR 0x30F8
|
||||
#define EGL_SYNC_FENCE_KHR 0x30F9
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_HI_clientpixmap
|
||||
#define EGL_HI_clientpixmap 1
|
||||
|
||||
/* Surface Attribute */
|
||||
#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74
|
||||
/*
|
||||
* Structure representing a client pixmap
|
||||
* (pixmap's data is in client-space memory).
|
||||
*/
|
||||
struct EGLClientPixmapHI
|
||||
{
|
||||
void* pData;
|
||||
EGLint iWidth;
|
||||
EGLint iHeight;
|
||||
EGLint iStride;
|
||||
};
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
|
||||
#endif /* EGL_HI_clientpixmap */
|
||||
|
||||
#ifndef EGL_HI_colorformats
|
||||
#define EGL_HI_colorformats 1
|
||||
/* Config Attribute */
|
||||
#define EGL_COLOR_FORMAT_HI 0x8F70
|
||||
/* Color Formats */
|
||||
#define EGL_COLOR_RGB_HI 0x8F71
|
||||
#define EGL_COLOR_RGBA_HI 0x8F72
|
||||
#define EGL_COLOR_ARGB_HI 0x8F73
|
||||
#endif /* EGL_HI_colorformats */
|
||||
|
||||
#ifndef EGL_MESA_drm_image
|
||||
#define EGL_MESA_drm_image 1
|
||||
#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* CreateDRMImageMESA attribute */
|
||||
#define EGL_DRM_BUFFER_USE_MESA 0x31D1 /* CreateDRMImageMESA attribute */
|
||||
#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 /* EGL_IMAGE_FORMAT_MESA attribute value */
|
||||
#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
|
||||
#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
|
||||
#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 /* EGL_DRM_BUFFER_USE_MESA bits */
|
||||
#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 /* EGL_DRM_BUFFER_USE_MESA bits */
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_post_sub_buffer
|
||||
#define EGL_NV_post_sub_buffer 1
|
||||
#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_query_surface_pointer
|
||||
#define EGL_ANGLE_query_surface_pointer 1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean eglQuerySurfacePointerANGLE(EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
|
||||
#endif
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
|
||||
#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
|
||||
#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_coverage_sample_resolve
|
||||
#define EGL_NV_coverage_sample_resolve 1
|
||||
#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131
|
||||
#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
|
||||
#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLuint64NV requires 64-bit uint support */
|
||||
#ifndef EGL_NV_system_time
|
||||
#define EGL_NV_system_time 1
|
||||
typedef khronos_utime_nanoseconds_t EGLuint64NV;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
|
||||
EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
|
||||
typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64 /* EGLuint64KHR requires 64-bit uint support */
|
||||
#ifndef EGL_KHR_stream
|
||||
#define EGL_KHR_stream 1
|
||||
typedef void* EGLStreamKHR;
|
||||
typedef khronos_uint64_t EGLuint64KHR;
|
||||
#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
|
||||
#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
|
||||
#define EGL_PRODUCER_FRAME_KHR 0x3212
|
||||
#define EGL_CONSUMER_FRAME_KHR 0x3213
|
||||
#define EGL_STREAM_STATE_KHR 0x3214
|
||||
#define EGL_STREAM_STATE_CREATED_KHR 0x3215
|
||||
#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
|
||||
#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
|
||||
#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
|
||||
#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
|
||||
#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
|
||||
#define EGL_BAD_STREAM_KHR 0x321B
|
||||
#define EGL_BAD_STATE_KHR 0x321C
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_consumer_gltexture
|
||||
#define EGL_KHR_stream_consumer_gltexture 1
|
||||
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerReleaseKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERACQUIREKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_producer_eglsurface
|
||||
#define EGL_KHR_stream_producer_eglsurface 1
|
||||
#define EGL_STREAM_BIT_KHR 0x0800
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_producer_aldatalocator
|
||||
#define EGL_KHR_stream_producer_aldatalocator 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_fifo
|
||||
#define EGL_KHR_stream_fifo 1
|
||||
/* reuse EGLTimeKHR */
|
||||
#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
|
||||
#define EGL_STREAM_TIME_NOW_KHR 0x31FD
|
||||
#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
|
||||
#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_create_context_robustness
|
||||
#define EGL_EXT_create_context_robustness 1
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
|
||||
#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
|
||||
#define EGL_ANGLE_d3d_share_handle_client_buffer 1
|
||||
/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_create_context
|
||||
#define EGL_KHR_create_context 1
|
||||
#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
|
||||
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
|
||||
#define EGL_CONTEXT_FLAGS_KHR 0x30FC
|
||||
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
|
||||
#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
|
||||
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
|
||||
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
|
||||
#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_surfaceless_context
|
||||
#define EGL_KHR_surfaceless_context 1
|
||||
/* No tokens/entry points, just relaxes an error condition */
|
||||
#endif
|
||||
|
||||
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
|
||||
#ifndef EGL_KHR_stream_cross_process_fd
|
||||
#define EGL_KHR_stream_cross_process_fd 1
|
||||
typedef int EGLNativeFileDescriptorKHR;
|
||||
#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
|
||||
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_multiview_window
|
||||
#define EGL_EXT_multiview_window 1
|
||||
#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_wait_sync
|
||||
#define EGL_KHR_wait_sync 1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLint EGLAPIENTRY eglWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLWAITSYNCKHRPROC)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_post_convert_rounding
|
||||
#define EGL_NV_post_convert_rounding 1
|
||||
/* No tokens or entry points, just relaxes behavior of SwapBuffers */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_native_query
|
||||
#define EGL_NV_native_query 1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeDisplayNV( EGLDisplay dpy, EGLNativeDisplayType* display_id);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativeWindowNV( EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType* window);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryNativePixmapNV( EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType* pixmap);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC)(EGLDisplay dpy, EGLNativeDisplayType *display_id);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEWINDOWNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativeWindowType *window);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEPIXMAPNVPROC)(EGLDisplay dpy, EGLSurface surf, EGLNativePixmapType *pixmap);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_3dvision_surface
|
||||
#define EGL_NV_3dvision_surface 1
|
||||
#define EGL_AUTO_STEREO_NV 0x3136
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_framebuffer_target
|
||||
#define EGL_ANDROID_framebuffer_target 1
|
||||
#define EGL_FRAMEBUFFER_TARGET_ANDROID 0x3147
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_blob_cache
|
||||
#define EGL_ANDROID_blob_cache 1
|
||||
typedef khronos_ssize_t EGLsizeiANDROID;
|
||||
typedef void (*EGLSetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, const void *value, EGLsizeiANDROID valueSize);
|
||||
typedef EGLsizeiANDROID (*EGLGetBlobFuncANDROID) (const void *key, EGLsizeiANDROID keySize, void *value, EGLsizeiANDROID valueSize);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDPROC)(EGLDisplay dpy, EGLSetBlobFuncANDROID set, EGLGetBlobFuncANDROID get);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_image_native_buffer
|
||||
#define EGL_ANDROID_image_native_buffer 1
|
||||
#define EGL_NATIVE_BUFFER_ANDROID 0x3140
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_native_fence_sync
|
||||
#define EGL_ANDROID_native_fence_sync 1
|
||||
#define EGL_SYNC_NATIVE_FENCE_ANDROID 0x3144
|
||||
#define EGL_SYNC_NATIVE_FENCE_FD_ANDROID 0x3145
|
||||
#define EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID 0x3146
|
||||
#define EGL_NO_NATIVE_FENCE_FD_ANDROID -1
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID( EGLDisplay dpy, EGLSyncKHR);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLDUPNATIVEFENCEFDANDROIDPROC)(EGLDisplay dpy, EGLSyncKHR);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANDROID_recordable
|
||||
#define EGL_ANDROID_recordable 1
|
||||
#define EGL_RECORDABLE_ANDROID 0x3142
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_buffer_age
|
||||
#define EGL_EXT_buffer_age 1
|
||||
#define EGL_BUFFER_AGE_EXT 0x313D
|
||||
#endif
|
||||
|
||||
#ifndef EGL_EXT_image_dma_buf_import
|
||||
#define EGL_EXT_image_dma_buf_import 1
|
||||
#define EGL_LINUX_DMA_BUF_EXT 0x3270
|
||||
#define EGL_LINUX_DRM_FOURCC_EXT 0x3271
|
||||
#define EGL_DMA_BUF_PLANE0_FD_EXT 0x3272
|
||||
#define EGL_DMA_BUF_PLANE0_OFFSET_EXT 0x3273
|
||||
#define EGL_DMA_BUF_PLANE0_PITCH_EXT 0x3274
|
||||
#define EGL_DMA_BUF_PLANE1_FD_EXT 0x3275
|
||||
#define EGL_DMA_BUF_PLANE1_OFFSET_EXT 0x3276
|
||||
#define EGL_DMA_BUF_PLANE1_PITCH_EXT 0x3277
|
||||
#define EGL_DMA_BUF_PLANE2_FD_EXT 0x3278
|
||||
#define EGL_DMA_BUF_PLANE2_OFFSET_EXT 0x3279
|
||||
#define EGL_DMA_BUF_PLANE2_PITCH_EXT 0x327A
|
||||
#define EGL_YUV_COLOR_SPACE_HINT_EXT 0x327B
|
||||
#define EGL_SAMPLE_RANGE_HINT_EXT 0x327C
|
||||
#define EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT 0x327D
|
||||
#define EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT 0x327E
|
||||
#define EGL_ITU_REC601_EXT 0x327F
|
||||
#define EGL_ITU_REC709_EXT 0x3280
|
||||
#define EGL_ITU_REC2020_EXT 0x3281
|
||||
#define EGL_YUV_FULL_RANGE_EXT 0x3282
|
||||
#define EGL_YUV_NARROW_RANGE_EXT 0x3283
|
||||
#define EGL_YUV_CHROMA_SITING_0_EXT 0x3284
|
||||
#define EGL_YUV_CHROMA_SITING_0_5_EXT 0x3285
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __eglext_h_ */
|
11626
examples/common/glfw/deps/GL/glext.h
Normal file
11626
examples/common/glfw/deps/GL/glext.h
Normal file
File diff suppressed because it is too large
Load Diff
906
examples/common/glfw/deps/GL/glxext.h
Normal file
906
examples/common/glfw/deps/GL/glxext.h
Normal file
|
@ -0,0 +1,906 @@
|
|||
#ifndef __glxext_h_
|
||||
#define __glxext_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2014 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.opengl.org/registry/
|
||||
**
|
||||
** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $
|
||||
*/
|
||||
|
||||
#define GLX_GLXEXT_VERSION 20140810
|
||||
|
||||
/* Generated C header for:
|
||||
* API: glx
|
||||
* Versions considered: .*
|
||||
* Versions emitted: 1\.[3-9]
|
||||
* Default extensions included: glx
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_VERSION_1_3 1
|
||||
typedef XID GLXContextID;
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||
typedef XID GLXWindow;
|
||||
typedef XID GLXPbuffer;
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
typedef GLXFBConfig *( *PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig *( *PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int ( *PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo *( *PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow ( *PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap ( *PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer ( *PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void ( *PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext ( *PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool ( *PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( *PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef int ( *PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void ( *PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void ( *PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXFBConfig *glXGetFBConfigs (Display *dpy, int screen, int *nelements);
|
||||
GLXFBConfig *glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
XVisualInfo *glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);
|
||||
GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
void glXDestroyWindow (Display *dpy, GLXWindow win);
|
||||
GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);
|
||||
GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);
|
||||
void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
GLXDrawable glXGetCurrentReadDrawable (void);
|
||||
int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#endif
|
||||
#endif /* GLX_VERSION_1_3 */
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_VERSION_1_4 1
|
||||
typedef void ( *__GLXextFuncPtr)(void);
|
||||
#define GLX_SAMPLE_BUFFERS 100000
|
||||
#define GLX_SAMPLES 100001
|
||||
typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
__GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
|
||||
#endif
|
||||
#endif /* GLX_VERSION_1_4 */
|
||||
|
||||
#ifndef GLX_ARB_context_flush_control
|
||||
#define GLX_ARB_context_flush_control 1
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
|
||||
#endif /* GLX_ARB_context_flush_control */
|
||||
|
||||
#ifndef GLX_ARB_create_context
|
||||
#define GLX_ARB_create_context 1
|
||||
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define GLX_CONTEXT_FLAGS_ARB 0x2094
|
||||
typedef GLXContext ( *PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
||||
#endif
|
||||
#endif /* GLX_ARB_create_context */
|
||||
|
||||
#ifndef GLX_ARB_create_context_profile
|
||||
#define GLX_ARB_create_context_profile 1
|
||||
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#endif /* GLX_ARB_create_context_profile */
|
||||
|
||||
#ifndef GLX_ARB_create_context_robustness
|
||||
#define GLX_ARB_create_context_robustness 1
|
||||
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif /* GLX_ARB_create_context_robustness */
|
||||
|
||||
#ifndef GLX_ARB_fbconfig_float
|
||||
#define GLX_ARB_fbconfig_float 1
|
||||
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
|
||||
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
|
||||
#endif /* GLX_ARB_fbconfig_float */
|
||||
|
||||
#ifndef GLX_ARB_framebuffer_sRGB
|
||||
#define GLX_ARB_framebuffer_sRGB 1
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
|
||||
#endif /* GLX_ARB_framebuffer_sRGB */
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
__GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
|
||||
#endif
|
||||
#endif /* GLX_ARB_get_proc_address */
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_ARB_multisample 1
|
||||
#define GLX_SAMPLE_BUFFERS_ARB 100000
|
||||
#define GLX_SAMPLES_ARB 100001
|
||||
#endif /* GLX_ARB_multisample */
|
||||
|
||||
#ifndef GLX_ARB_robustness_application_isolation
|
||||
#define GLX_ARB_robustness_application_isolation 1
|
||||
#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
|
||||
#endif /* GLX_ARB_robustness_application_isolation */
|
||||
|
||||
#ifndef GLX_ARB_robustness_share_group_isolation
|
||||
#define GLX_ARB_robustness_share_group_isolation 1
|
||||
#endif /* GLX_ARB_robustness_share_group_isolation */
|
||||
|
||||
#ifndef GLX_ARB_vertex_buffer_object
|
||||
#define GLX_ARB_vertex_buffer_object 1
|
||||
#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
|
||||
#endif /* GLX_ARB_vertex_buffer_object */
|
||||
|
||||
#ifndef GLX_3DFX_multisample
|
||||
#define GLX_3DFX_multisample 1
|
||||
#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
|
||||
#define GLX_SAMPLES_3DFX 0x8051
|
||||
#endif /* GLX_3DFX_multisample */
|
||||
|
||||
#ifndef GLX_AMD_gpu_association
|
||||
#define GLX_AMD_gpu_association 1
|
||||
#define GLX_GPU_VENDOR_AMD 0x1F00
|
||||
#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define GLX_GPU_RAM_AMD 0x21A3
|
||||
#define GLX_GPU_CLOCK_AMD 0x21A4
|
||||
#define GLX_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define GLX_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define GLX_GPU_NUM_RB_AMD 0x21A7
|
||||
#define GLX_GPU_NUM_SPI_AMD 0x21A8
|
||||
#endif /* GLX_AMD_gpu_association */
|
||||
|
||||
#ifndef GLX_EXT_buffer_age
|
||||
#define GLX_EXT_buffer_age 1
|
||||
#define GLX_BACK_BUFFER_AGE_EXT 0x20F4
|
||||
#endif /* GLX_EXT_buffer_age */
|
||||
|
||||
#ifndef GLX_EXT_create_context_es2_profile
|
||||
#define GLX_EXT_create_context_es2_profile 1
|
||||
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* GLX_EXT_create_context_es2_profile */
|
||||
|
||||
#ifndef GLX_EXT_create_context_es_profile
|
||||
#define GLX_EXT_create_context_es_profile 1
|
||||
#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* GLX_EXT_create_context_es_profile */
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_EXT_fbconfig_packed_float 1
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
|
||||
#endif /* GLX_EXT_fbconfig_packed_float */
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_EXT_framebuffer_sRGB 1
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
|
||||
#endif /* GLX_EXT_framebuffer_sRGB */
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_EXT_import_context 1
|
||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||
#define GLX_VISUAL_ID_EXT 0x800B
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
typedef Display *( *PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
|
||||
typedef int ( *PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
typedef GLXContextID ( *PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
|
||||
typedef GLXContext ( *PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
|
||||
typedef void ( *PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Display *glXGetCurrentDisplayEXT (void);
|
||||
int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
GLXContextID glXGetContextIDEXT (const GLXContext context);
|
||||
GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
|
||||
void glXFreeContextEXT (Display *dpy, GLXContext context);
|
||||
#endif
|
||||
#endif /* GLX_EXT_import_context */
|
||||
|
||||
#ifndef GLX_EXT_stereo_tree
|
||||
#define GLX_EXT_stereo_tree 1
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial;
|
||||
Bool send_event;
|
||||
Display *display;
|
||||
int extension;
|
||||
int evtype;
|
||||
GLXDrawable window;
|
||||
Bool stereo_tree;
|
||||
} GLXStereoNotifyEventEXT;
|
||||
#define GLX_STEREO_TREE_EXT 0x20F5
|
||||
#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001
|
||||
#define GLX_STEREO_NOTIFY_EXT 0x00000000
|
||||
#endif /* GLX_EXT_stereo_tree */
|
||||
|
||||
#ifndef GLX_EXT_swap_control
|
||||
#define GLX_EXT_swap_control 1
|
||||
#define GLX_SWAP_INTERVAL_EXT 0x20F1
|
||||
#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
|
||||
typedef void ( *PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#endif
|
||||
#endif /* GLX_EXT_swap_control */
|
||||
|
||||
#ifndef GLX_EXT_swap_control_tear
|
||||
#define GLX_EXT_swap_control_tear 1
|
||||
#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
|
||||
#endif /* GLX_EXT_swap_control_tear */
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x20D6
|
||||
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
|
||||
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
|
||||
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
|
||||
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
|
||||
#define GLX_TEXTURE_1D_EXT 0x20DB
|
||||
#define GLX_TEXTURE_2D_EXT 0x20DC
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
|
||||
#define GLX_FRONT_LEFT_EXT 0x20DE
|
||||
#define GLX_FRONT_RIGHT_EXT 0x20DF
|
||||
#define GLX_BACK_LEFT_EXT 0x20E0
|
||||
#define GLX_BACK_RIGHT_EXT 0x20E1
|
||||
#define GLX_FRONT_EXT 0x20DE
|
||||
#define GLX_BACK_EXT 0x20E0
|
||||
#define GLX_AUX0_EXT 0x20E2
|
||||
#define GLX_AUX1_EXT 0x20E3
|
||||
#define GLX_AUX2_EXT 0x20E4
|
||||
#define GLX_AUX3_EXT 0x20E5
|
||||
#define GLX_AUX4_EXT 0x20E6
|
||||
#define GLX_AUX5_EXT 0x20E7
|
||||
#define GLX_AUX6_EXT 0x20E8
|
||||
#define GLX_AUX7_EXT 0x20E9
|
||||
#define GLX_AUX8_EXT 0x20EA
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
typedef void ( *PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
typedef void ( *PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#endif
|
||||
#endif /* GLX_EXT_texture_from_pixmap */
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_EXT_visual_info 1
|
||||
#define GLX_X_VISUAL_TYPE_EXT 0x22
|
||||
#define GLX_TRANSPARENT_TYPE_EXT 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
|
||||
#define GLX_NONE_EXT 0x8000
|
||||
#define GLX_TRUE_COLOR_EXT 0x8002
|
||||
#define GLX_DIRECT_COLOR_EXT 0x8003
|
||||
#define GLX_PSEUDO_COLOR_EXT 0x8004
|
||||
#define GLX_STATIC_COLOR_EXT 0x8005
|
||||
#define GLX_GRAY_SCALE_EXT 0x8006
|
||||
#define GLX_STATIC_GRAY_EXT 0x8007
|
||||
#define GLX_TRANSPARENT_RGB_EXT 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
|
||||
#endif /* GLX_EXT_visual_info */
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_EXT_visual_rating 1
|
||||
#define GLX_VISUAL_CAVEAT_EXT 0x20
|
||||
#define GLX_SLOW_VISUAL_EXT 0x8001
|
||||
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
|
||||
#endif /* GLX_EXT_visual_rating */
|
||||
|
||||
#ifndef GLX_INTEL_swap_event
|
||||
#define GLX_INTEL_swap_event 1
|
||||
#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
|
||||
#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
|
||||
#define GLX_COPY_COMPLETE_INTEL 0x8181
|
||||
#define GLX_FLIP_COMPLETE_INTEL 0x8182
|
||||
#endif /* GLX_INTEL_swap_event */
|
||||
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#define GLX_MESA_agp_offset 1
|
||||
typedef unsigned int ( *PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
unsigned int glXGetAGPOffsetMESA (const void *pointer);
|
||||
#endif
|
||||
#endif /* GLX_MESA_agp_offset */
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#define GLX_MESA_copy_sub_buffer 1
|
||||
typedef void ( *PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#endif
|
||||
#endif /* GLX_MESA_copy_sub_buffer */
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#define GLX_MESA_pixmap_colormap 1
|
||||
typedef GLXPixmap ( *PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#endif
|
||||
#endif /* GLX_MESA_pixmap_colormap */
|
||||
|
||||
#ifndef GLX_MESA_query_renderer
|
||||
#define GLX_MESA_query_renderer 1
|
||||
#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
|
||||
#define GLX_RENDERER_DEVICE_ID_MESA 0x8184
|
||||
#define GLX_RENDERER_VERSION_MESA 0x8185
|
||||
#define GLX_RENDERER_ACCELERATED_MESA 0x8186
|
||||
#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187
|
||||
#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188
|
||||
#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189
|
||||
#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A
|
||||
#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B
|
||||
#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C
|
||||
#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D
|
||||
#define GLX_RENDERER_ID_MESA 0x818E
|
||||
typedef Bool ( *PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value);
|
||||
typedef const char *( *PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute);
|
||||
typedef Bool ( *PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
|
||||
typedef const char *( *PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXQueryCurrentRendererIntegerMESA (int attribute, unsigned int *value);
|
||||
const char *glXQueryCurrentRendererStringMESA (int attribute);
|
||||
Bool glXQueryRendererIntegerMESA (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
|
||||
const char *glXQueryRendererStringMESA (Display *dpy, int screen, int renderer, int attribute);
|
||||
#endif
|
||||
#endif /* GLX_MESA_query_renderer */
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#define GLX_MESA_release_buffers 1
|
||||
typedef Bool ( *PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);
|
||||
#endif
|
||||
#endif /* GLX_MESA_release_buffers */
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_MESA_set_3dfx_mode 1
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
typedef Bool ( *PFNGLXSET3DFXMODEMESAPROC) (int mode);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXSet3DfxModeMESA (int mode);
|
||||
#endif
|
||||
#endif /* GLX_MESA_set_3dfx_mode */
|
||||
|
||||
#ifndef GLX_NV_copy_buffer
|
||||
#define GLX_NV_copy_buffer 1
|
||||
typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
void glXNamedCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
#endif
|
||||
#endif /* GLX_NV_copy_buffer */
|
||||
|
||||
#ifndef GLX_NV_copy_image
|
||||
#define GLX_NV_copy_image 1
|
||||
typedef void ( *PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
#endif /* GLX_NV_copy_image */
|
||||
|
||||
#ifndef GLX_NV_delay_before_swap
|
||||
#define GLX_NV_delay_before_swap 1
|
||||
typedef Bool ( *PFNGLXDELAYBEFORESWAPNVPROC) (Display *dpy, GLXDrawable drawable, GLfloat seconds);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXDelayBeforeSwapNV (Display *dpy, GLXDrawable drawable, GLfloat seconds);
|
||||
#endif
|
||||
#endif /* GLX_NV_delay_before_swap */
|
||||
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_NV_float_buffer 1
|
||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#endif /* GLX_NV_float_buffer */
|
||||
|
||||
#ifndef GLX_NV_multisample_coverage
|
||||
#define GLX_NV_multisample_coverage 1
|
||||
#define GLX_COVERAGE_SAMPLES_NV 100001
|
||||
#define GLX_COLOR_SAMPLES_NV 0x20B3
|
||||
#endif /* GLX_NV_multisample_coverage */
|
||||
|
||||
#ifndef GLX_NV_present_video
|
||||
#define GLX_NV_present_video 1
|
||||
#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
typedef unsigned int *( *PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef int ( *PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
unsigned int *glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);
|
||||
int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
|
||||
#endif
|
||||
#endif /* GLX_NV_present_video */
|
||||
|
||||
#ifndef GLX_NV_swap_group
|
||||
#define GLX_NV_swap_group 1
|
||||
typedef Bool ( *PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
|
||||
typedef Bool ( *PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
|
||||
typedef Bool ( *PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
||||
typedef Bool ( *PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef Bool ( *PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
|
||||
typedef Bool ( *PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);
|
||||
Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);
|
||||
Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
||||
Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);
|
||||
Bool glXResetFrameCountNV (Display *dpy, int screen);
|
||||
#endif
|
||||
#endif /* GLX_NV_swap_group */
|
||||
|
||||
#ifndef GLX_NV_video_capture
|
||||
#define GLX_NV_video_capture 1
|
||||
typedef XID GLXVideoCaptureDeviceNV;
|
||||
#define GLX_DEVICE_ID_NV 0x20CD
|
||||
#define GLX_UNIQUE_ID_NV 0x20CE
|
||||
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
typedef int ( *PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
|
||||
typedef GLXVideoCaptureDeviceNV *( *PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef void ( *PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
typedef int ( *PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
|
||||
typedef void ( *PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
|
||||
GLXVideoCaptureDeviceNV *glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);
|
||||
void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
|
||||
void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
#endif
|
||||
#endif /* GLX_NV_video_capture */
|
||||
|
||||
#ifndef GLX_NV_video_out
|
||||
#define GLX_NV_video_out 1
|
||||
typedef unsigned int GLXVideoDeviceNV;
|
||||
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
|
||||
#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
|
||||
#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
|
||||
typedef int ( *PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
|
||||
typedef int ( *PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
|
||||
typedef int ( *PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
|
||||
typedef int ( *PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef int ( *PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
|
||||
typedef int ( *PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
|
||||
int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
|
||||
int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
|
||||
int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
|
||||
int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
|
||||
int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
#endif /* GLX_NV_video_out */
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_OML_swap_method 1
|
||||
#define GLX_SWAP_METHOD_OML 0x8060
|
||||
#define GLX_SWAP_EXCHANGE_OML 0x8061
|
||||
#define GLX_SWAP_COPY_OML 0x8062
|
||||
#define GLX_SWAP_UNDEFINED_OML 0x8063
|
||||
#endif /* GLX_OML_swap_method */
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#define GLX_OML_sync_control 1
|
||||
#ifndef GLEXT_64_TYPES_DEFINED
|
||||
/* This code block is duplicated in glext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int int64_t;
|
||||
typedef unsigned long int uint64_t;
|
||||
#else
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined( __VMS ) || defined(__sgi)
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(__UNIXOS2__) || defined(__SOL64__)
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(_WIN32)
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
/* Fallback if nothing above works */
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#endif
|
||||
typedef Bool ( *PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( *PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
typedef int64_t ( *PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
typedef Bool ( *PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( *PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#endif
|
||||
#endif /* GLX_OML_sync_control */
|
||||
|
||||
#ifndef GLX_SGIS_blended_overlay
|
||||
#define GLX_SGIS_blended_overlay 1
|
||||
#define GLX_BLENDED_RGBA_SGIS 0x8025
|
||||
#endif /* GLX_SGIS_blended_overlay */
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SGIS_multisample 1
|
||||
#define GLX_SAMPLE_BUFFERS_SGIS 100000
|
||||
#define GLX_SAMPLES_SGIS 100001
|
||||
#endif /* GLX_SGIS_multisample */
|
||||
|
||||
#ifndef GLX_SGIS_shared_multisample
|
||||
#define GLX_SGIS_shared_multisample 1
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
|
||||
#endif /* GLX_SGIS_shared_multisample */
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_SGIX_dmbuffer 1
|
||||
typedef XID GLXPbufferSGIX;
|
||||
#ifdef _DM_BUFFER_H_
|
||||
#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
|
||||
typedef Bool ( *PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#endif
|
||||
#endif /* _DM_BUFFER_H_ */
|
||||
#endif /* GLX_SGIX_dmbuffer */
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_SGIX_fbconfig 1
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
|
||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||
#define GLX_PIXMAP_BIT_SGIX 0x00000002
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
|
||||
#define GLX_RENDER_TYPE_SGIX 0x8011
|
||||
#define GLX_X_RENDERABLE_SGIX 0x8012
|
||||
#define GLX_FBCONFIG_ID_SGIX 0x8013
|
||||
#define GLX_RGBA_TYPE_SGIX 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
|
||||
typedef int ( *PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
typedef GLXFBConfigSGIX *( *PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
typedef GLXPixmap ( *PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
typedef GLXContext ( *PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef XVisualInfo *( *PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
|
||||
typedef GLXFBConfigSGIX ( *PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
GLXFBConfigSGIX *glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
XVisualInfo *glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);
|
||||
GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_fbconfig */
|
||||
|
||||
#ifndef GLX_SGIX_hyperpipe
|
||||
#define GLX_SGIX_hyperpipe 1
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int networkId;
|
||||
} GLXHyperpipeNetworkSGIX;
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int channel;
|
||||
unsigned int participationType;
|
||||
int timeSlice;
|
||||
} GLXHyperpipeConfigSGIX;
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
|
||||
int destXOrigin, destYOrigin, destWidth, destHeight;
|
||||
} GLXPipeRect;
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int XOrigin, YOrigin, maxHeight, maxWidth;
|
||||
} GLXPipeRectLimits;
|
||||
#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
|
||||
#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
|
||||
#define GLX_BAD_HYPERPIPE_SGIX 92
|
||||
#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
|
||||
#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
|
||||
#define GLX_PIPE_RECT_SGIX 0x00000001
|
||||
#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
|
||||
#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
|
||||
#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
|
||||
#define GLX_HYPERPIPE_ID_SGIX 0x8030
|
||||
typedef GLXHyperpipeNetworkSGIX *( *PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
|
||||
typedef int ( *PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
|
||||
typedef GLXHyperpipeConfigSGIX *( *PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
|
||||
typedef int ( *PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( *PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( *PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
|
||||
typedef int ( *PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
|
||||
typedef int ( *PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXHyperpipeNetworkSGIX *glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);
|
||||
int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
|
||||
GLXHyperpipeConfigSGIX *glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);
|
||||
int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);
|
||||
int glXBindHyperpipeSGIX (Display *dpy, int hpId);
|
||||
int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
|
||||
int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
|
||||
int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_hyperpipe */
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_SGIX_pbuffer 1
|
||||
#define GLX_PBUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
|
||||
#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
|
||||
#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
|
||||
#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
|
||||
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
|
||||
#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
|
||||
#define GLX_LARGEST_PBUFFER_SGIX 0x801C
|
||||
#define GLX_WIDTH_SGIX 0x801D
|
||||
#define GLX_HEIGHT_SGIX 0x801E
|
||||
#define GLX_EVENT_MASK_SGIX 0x801F
|
||||
#define GLX_DAMAGED_SGIX 0x8020
|
||||
#define GLX_SAVED_SGIX 0x8021
|
||||
#define GLX_WINDOW_SGIX 0x8022
|
||||
#define GLX_PBUFFER_SGIX 0x8023
|
||||
typedef GLXPbufferSGIX ( *PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
typedef int ( *PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
typedef void ( *PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
typedef void ( *PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
int glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_pbuffer */
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#define GLX_SGIX_swap_barrier 1
|
||||
typedef void ( *PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
typedef Bool ( *PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_swap_barrier */
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#define GLX_SGIX_swap_group 1
|
||||
typedef void ( *PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_swap_group */
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SGIX_video_resize 1
|
||||
#define GLX_SYNC_FRAME_SGIX 0x00000000
|
||||
#define GLX_SYNC_SWAP_SGIX 0x00000001
|
||||
typedef int ( *PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
|
||||
typedef int ( *PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
typedef int ( *PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
typedef int ( *PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
typedef int ( *PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);
|
||||
int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_video_resize */
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#define GLX_SGIX_video_source 1
|
||||
typedef XID GLXVideoSourceSGIX;
|
||||
#ifdef _VL_H
|
||||
typedef GLXVideoSourceSGIX ( *PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
typedef void ( *PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#endif
|
||||
#endif /* _VL_H */
|
||||
#endif /* GLX_SGIX_video_source */
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_SGIX_visual_select_group 1
|
||||
#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
|
||||
#endif /* GLX_SGIX_visual_select_group */
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#define GLX_SGI_cushion 1
|
||||
typedef void ( *PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCushionSGI (Display *dpy, Window window, float cushion);
|
||||
#endif
|
||||
#endif /* GLX_SGI_cushion */
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#define GLX_SGI_make_current_read 1
|
||||
typedef Bool ( *PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( *PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
GLXDrawable glXGetCurrentReadDrawableSGI (void);
|
||||
#endif
|
||||
#endif /* GLX_SGI_make_current_read */
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#define GLX_SGI_swap_control 1
|
||||
typedef int ( *PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXSwapIntervalSGI (int interval);
|
||||
#endif
|
||||
#endif /* GLX_SGI_swap_control */
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#define GLX_SGI_video_sync 1
|
||||
typedef int ( *PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
|
||||
typedef int ( *PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXGetVideoSyncSGI (unsigned int *count);
|
||||
int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
|
||||
#endif
|
||||
#endif /* GLX_SGI_video_sync */
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#define GLX_SUN_get_transparent_index 1
|
||||
typedef Status ( *PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
|
||||
#endif
|
||||
#endif /* GLX_SUN_get_transparent_index */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
840
examples/common/glfw/deps/GL/wglext.h
Normal file
840
examples/common/glfw/deps/GL/wglext.h
Normal file
|
@ -0,0 +1,840 @@
|
|||
#ifndef __wglext_h_
|
||||
#define __wglext_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013-2014 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.opengl.org/registry/
|
||||
**
|
||||
** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#define WGL_WGLEXT_VERSION 20140810
|
||||
|
||||
/* Generated C header for:
|
||||
* API: wgl
|
||||
* Versions considered: .*
|
||||
* Versions emitted: _nomatch_^
|
||||
* Default extensions included: wgl
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
|
||||
VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
|
||||
BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
|
||||
BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
#endif /* WGL_ARB_buffer_region */
|
||||
|
||||
#ifndef WGL_ARB_context_flush_control
|
||||
#define WGL_ARB_context_flush_control 1
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
|
||||
#endif /* WGL_ARB_context_flush_control */
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_ARB_create_context 1
|
||||
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define ERROR_INVALID_VERSION_ARB 0x2095
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif
|
||||
#endif /* WGL_ARB_create_context */
|
||||
|
||||
#ifndef WGL_ARB_create_context_profile
|
||||
#define WGL_ARB_create_context_profile 1
|
||||
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define ERROR_INVALID_PROFILE_ARB 0x2096
|
||||
#endif /* WGL_ARB_create_context_profile */
|
||||
|
||||
#ifndef WGL_ARB_create_context_robustness
|
||||
#define WGL_ARB_create_context_robustness 1
|
||||
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif /* WGL_ARB_create_context_robustness */
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
const char *WINAPI wglGetExtensionsStringARB (HDC hdc);
|
||||
#endif
|
||||
#endif /* WGL_ARB_extensions_string */
|
||||
|
||||
#ifndef WGL_ARB_framebuffer_sRGB
|
||||
#define WGL_ARB_framebuffer_sRGB 1
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
|
||||
#endif /* WGL_ARB_framebuffer_sRGB */
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif
|
||||
#endif /* WGL_ARB_make_current_read */
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif /* WGL_ARB_multisample */
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
|
||||
int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
|
||||
BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_ARB_pbuffer */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_ARB_pixel_format */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
#endif /* WGL_ARB_pixel_format_float */
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
#endif /* WGL_ARB_render_texture */
|
||||
|
||||
#ifndef WGL_ARB_robustness_application_isolation
|
||||
#define WGL_ARB_robustness_application_isolation 1
|
||||
#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
|
||||
#endif /* WGL_ARB_robustness_application_isolation */
|
||||
|
||||
#ifndef WGL_ARB_robustness_share_group_isolation
|
||||
#define WGL_ARB_robustness_share_group_isolation 1
|
||||
#endif /* WGL_ARB_robustness_share_group_isolation */
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif /* WGL_3DFX_multisample */
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_3DL_stereo_control 1
|
||||
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
|
||||
#endif
|
||||
#endif /* WGL_3DL_stereo_control */
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_AMD_gpu_association 1
|
||||
#define WGL_GPU_VENDOR_AMD 0x1F00
|
||||
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define WGL_GPU_RAM_AMD 0x21A3
|
||||
#define WGL_GPU_CLOCK_AMD 0x21A4
|
||||
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
|
||||
INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
|
||||
UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
|
||||
BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||
VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
#endif /* WGL_AMD_gpu_association */
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#endif /* WGL_ATI_pixel_format_float */
|
||||
|
||||
#ifndef WGL_EXT_create_context_es2_profile
|
||||
#define WGL_EXT_create_context_es2_profile 1
|
||||
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* WGL_EXT_create_context_es2_profile */
|
||||
|
||||
#ifndef WGL_EXT_create_context_es_profile
|
||||
#define WGL_EXT_create_context_es_profile 1
|
||||
#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* WGL_EXT_create_context_es_profile */
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif /* WGL_EXT_depth_float */
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
|
||||
GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
|
||||
GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
|
||||
VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
|
||||
#endif
|
||||
#endif /* WGL_EXT_display_color_table */
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
const char *WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_extensions_string */
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_EXT_framebuffer_sRGB 1
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
|
||||
#endif /* WGL_EXT_framebuffer_sRGB */
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_make_current_read */
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif /* WGL_EXT_multisample */
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
|
||||
int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
|
||||
BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_EXT_pbuffer */
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_EXT_pixel_format */
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_EXT_pixel_format_packed_float 1
|
||||
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
|
||||
#endif /* WGL_EXT_pixel_format_packed_float */
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglSwapIntervalEXT (int interval);
|
||||
int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_swap_control */
|
||||
|
||||
#ifndef WGL_EXT_swap_control_tear
|
||||
#define WGL_EXT_swap_control_tear 1
|
||||
#endif /* WGL_EXT_swap_control_tear */
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_I3D_digital_video_control */
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
#endif /* WGL_I3D_gamma */
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
|
||||
BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
|
||||
BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
|
||||
BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
|
||||
BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
|
||||
BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
|
||||
BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
|
||||
BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
|
||||
BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
|
||||
BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
#endif /* WGL_I3D_genlock */
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
|
||||
BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
#endif /* WGL_I3D_image_buffer */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
|
||||
BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
|
||||
#endif
|
||||
#endif /* WGL_I3D_swap_frame_lock */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
|
||||
BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
#endif /* WGL_I3D_swap_frame_usage */
|
||||
|
||||
#ifndef WGL_NV_DX_interop
|
||||
#define WGL_NV_DX_interop 1
|
||||
#define WGL_ACCESS_READ_ONLY_NV 0x00000000
|
||||
#define WGL_ACCESS_READ_WRITE_NV 0x00000001
|
||||
#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
|
||||
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
|
||||
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
|
||||
HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
|
||||
BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
|
||||
HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
|
||||
BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
|
||||
BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#endif
|
||||
#endif /* WGL_NV_DX_interop */
|
||||
|
||||
#ifndef WGL_NV_DX_interop2
|
||||
#define WGL_NV_DX_interop2 1
|
||||
#endif /* WGL_NV_DX_interop2 */
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
#define WGL_NV_copy_image 1
|
||||
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
#endif /* WGL_NV_copy_image */
|
||||
|
||||
#ifndef WGL_NV_delay_before_swap
|
||||
#define WGL_NV_delay_before_swap 1
|
||||
typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds);
|
||||
#endif
|
||||
#endif /* WGL_NV_delay_before_swap */
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
#endif /* WGL_NV_float_buffer */
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_NV_gpu_affinity 1
|
||||
DECLARE_HANDLE(HGPUNV);
|
||||
struct _GPU_DEVICE {
|
||||
DWORD cb;
|
||||
CHAR DeviceName[32];
|
||||
CHAR DeviceString[128];
|
||||
DWORD Flags;
|
||||
RECT rcVirtualScreen;
|
||||
};
|
||||
typedef struct _GPU_DEVICE *PGPU_DEVICE;
|
||||
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
|
||||
BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
BOOL WINAPI wglDeleteDCNV (HDC hdc);
|
||||
#endif
|
||||
#endif /* WGL_NV_gpu_affinity */
|
||||
|
||||
#ifndef WGL_NV_multisample_coverage
|
||||
#define WGL_NV_multisample_coverage 1
|
||||
#define WGL_COVERAGE_SAMPLES_NV 0x2042
|
||||
#define WGL_COLOR_SAMPLES_NV 0x20B9
|
||||
#endif /* WGL_NV_multisample_coverage */
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NV_present_video 1
|
||||
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_NV_present_video */
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_NV_render_depth_texture 1
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
#endif /* WGL_NV_render_depth_texture */
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_NV_render_texture_rectangle 1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
#endif /* WGL_NV_render_texture_rectangle */
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#define WGL_NV_swap_group 1
|
||||
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
|
||||
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
|
||||
BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
|
||||
BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
|
||||
BOOL WINAPI wglResetFrameCountNV (HDC hDC);
|
||||
#endif
|
||||
#endif /* WGL_NV_swap_group */
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
typedef void *(WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
void *WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
void WINAPI wglFreeMemoryNV (void *pointer);
|
||||
#endif
|
||||
#endif /* WGL_NV_vertex_array_range */
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_NV_video_capture 1
|
||||
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#endif
|
||||
#endif /* WGL_NV_video_capture */
|
||||
|
||||
#ifndef WGL_NV_video_output
|
||||
#define WGL_NV_video_output 1
|
||||
DECLARE_HANDLE(HPVIDEODEV);
|
||||
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
|
||||
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
|
||||
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
|
||||
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define WGL_VIDEO_OUT_FRAME 0x20C8
|
||||
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
|
||||
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
|
||||
BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
#endif /* WGL_NV_video_output */
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
#endif /* WGL_OML_sync_control */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
282
examples/common/glfw/deps/KHR/khrplatform.h
Normal file
282
examples/common/glfw/deps/KHR/khrplatform.h
Normal file
|
@ -0,0 +1,282 @@
|
|||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2009 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by sending them to the public Khronos Bugzilla
|
||||
* (http://khronos.org/bugzilla) by filing a bug against product
|
||||
* "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
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
typedef signed char khronos_int8_t;
|
||||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
|
||||
/*
|
||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
typedef signed long long int khronos_intptr_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
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
230
examples/common/glfw/deps/getopt.c
Normal file
230
examples/common/glfw/deps/getopt.c
Normal file
|
@ -0,0 +1,230 @@
|
|||
/* Copyright (c) 2012, Kim Gräsman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Kim Gräsman nor the names of contributors may be used
|
||||
* to endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
const int no_argument = 0;
|
||||
const int required_argument = 1;
|
||||
const int optional_argument = 2;
|
||||
|
||||
char* optarg;
|
||||
int optopt;
|
||||
/* The variable optind [...] shall be initialized to 1 by the system. */
|
||||
int optind = 1;
|
||||
int opterr;
|
||||
|
||||
static char* optcursor = NULL;
|
||||
|
||||
/* Implemented based on [1] and [2] for optional arguments.
|
||||
optopt is handled FreeBSD-style, per [3].
|
||||
Other GNU and FreeBSD extensions are purely accidental.
|
||||
|
||||
[1] http://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html
|
||||
[2] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
|
||||
[3] http://www.freebsd.org/cgi/man.cgi?query=getopt&sektion=3&manpath=FreeBSD+9.0-RELEASE
|
||||
*/
|
||||
int getopt(int argc, char* const argv[], const char* optstring) {
|
||||
int optchar = -1;
|
||||
const char* optdecl = NULL;
|
||||
|
||||
optarg = NULL;
|
||||
opterr = 0;
|
||||
optopt = 0;
|
||||
|
||||
/* Unspecified, but we need it to avoid overrunning the argv bounds. */
|
||||
if (optind >= argc)
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called argv[optind] is a null pointer, getopt()
|
||||
shall return -1 without changing optind. */
|
||||
if (argv[optind] == NULL)
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called *argv[optind] is not the character '-',
|
||||
getopt() shall return -1 without changing optind. */
|
||||
if (*argv[optind] != '-')
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called argv[optind] points to the string "-",
|
||||
getopt() shall return -1 without changing optind. */
|
||||
if (strcmp(argv[optind], "-") == 0)
|
||||
goto no_more_optchars;
|
||||
|
||||
/* If, when getopt() is called argv[optind] points to the string "--",
|
||||
getopt() shall return -1 after incrementing optind. */
|
||||
if (strcmp(argv[optind], "--") == 0) {
|
||||
++optind;
|
||||
goto no_more_optchars;
|
||||
}
|
||||
|
||||
if (optcursor == NULL || *optcursor == '\0')
|
||||
optcursor = argv[optind] + 1;
|
||||
|
||||
optchar = *optcursor;
|
||||
|
||||
/* FreeBSD: The variable optopt saves the last known option character
|
||||
returned by getopt(). */
|
||||
optopt = optchar;
|
||||
|
||||
/* The getopt() function shall return the next option character (if one is
|
||||
found) from argv that matches a character in optstring, if there is
|
||||
one that matches. */
|
||||
optdecl = strchr(optstring, optchar);
|
||||
if (optdecl) {
|
||||
/* [I]f a character is followed by a colon, the option takes an
|
||||
argument. */
|
||||
if (optdecl[1] == ':') {
|
||||
optarg = ++optcursor;
|
||||
if (*optarg == '\0') {
|
||||
/* GNU extension: Two colons mean an option takes an
|
||||
optional arg; if there is text in the current argv-element
|
||||
(i.e., in the same word as the option name itself, for example,
|
||||
"-oarg"), then it is returned in optarg, otherwise optarg is set
|
||||
to zero. */
|
||||
if (optdecl[2] != ':') {
|
||||
/* If the option was the last character in the string pointed to by
|
||||
an element of argv, then optarg shall contain the next element
|
||||
of argv, and optind shall be incremented by 2. If the resulting
|
||||
value of optind is greater than argc, this indicates a missing
|
||||
option-argument, and getopt() shall return an error indication.
|
||||
|
||||
Otherwise, optarg shall point to the string following the
|
||||
option character in that element of argv, and optind shall be
|
||||
incremented by 1.
|
||||
*/
|
||||
if (++optind < argc) {
|
||||
optarg = argv[optind];
|
||||
} else {
|
||||
/* If it detects a missing option-argument, it shall return the
|
||||
colon character ( ':' ) if the first character of optstring
|
||||
was a colon, or a question-mark character ( '?' ) otherwise.
|
||||
*/
|
||||
optarg = NULL;
|
||||
optchar = (optstring[0] == ':') ? ':' : '?';
|
||||
}
|
||||
} else {
|
||||
optarg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
optcursor = NULL;
|
||||
}
|
||||
} else {
|
||||
/* If getopt() encounters an option character that is not contained in
|
||||
optstring, it shall return the question-mark ( '?' ) character. */
|
||||
optchar = '?';
|
||||
}
|
||||
|
||||
if (optcursor == NULL || *++optcursor == '\0')
|
||||
++optind;
|
||||
|
||||
return optchar;
|
||||
|
||||
no_more_optchars:
|
||||
optcursor = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Implementation based on [1].
|
||||
|
||||
[1] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
|
||||
*/
|
||||
int getopt_long(int argc, char* const argv[], const char* optstring,
|
||||
const struct option* longopts, int* longindex) {
|
||||
const struct option* o = longopts;
|
||||
const struct option* match = NULL;
|
||||
int num_matches = 0;
|
||||
size_t argument_name_length = 0;
|
||||
const char* current_argument = NULL;
|
||||
int retval = -1;
|
||||
|
||||
optarg = NULL;
|
||||
optopt = 0;
|
||||
|
||||
if (optind >= argc)
|
||||
return -1;
|
||||
|
||||
if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0)
|
||||
return getopt(argc, argv, optstring);
|
||||
|
||||
/* It's an option; starts with -- and is longer than two chars. */
|
||||
current_argument = argv[optind] + 2;
|
||||
argument_name_length = strcspn(current_argument, "=");
|
||||
for (; o->name; ++o) {
|
||||
if (strncmp(o->name, current_argument, argument_name_length) == 0) {
|
||||
match = o;
|
||||
++num_matches;
|
||||
}
|
||||
}
|
||||
|
||||
if (num_matches == 1) {
|
||||
/* If longindex is not NULL, it points to a variable which is set to the
|
||||
index of the long option relative to longopts. */
|
||||
if (longindex)
|
||||
*longindex = (int) (match - longopts);
|
||||
|
||||
/* If flag is NULL, then getopt_long() shall return val.
|
||||
Otherwise, getopt_long() returns 0, and flag shall point to a variable
|
||||
which shall be set to val if the option is found, but left unchanged if
|
||||
the option is not found. */
|
||||
if (match->flag)
|
||||
*(match->flag) = match->val;
|
||||
|
||||
retval = match->flag ? 0 : match->val;
|
||||
|
||||
if (match->has_arg != no_argument) {
|
||||
optarg = strchr(argv[optind], '=');
|
||||
if (optarg != NULL)
|
||||
++optarg;
|
||||
|
||||
if (match->has_arg == required_argument) {
|
||||
/* Only scan the next argv for required arguments. Behavior is not
|
||||
specified, but has been observed with Ubuntu and Mac OSX. */
|
||||
if (optarg == NULL && ++optind < argc) {
|
||||
optarg = argv[optind];
|
||||
}
|
||||
|
||||
if (optarg == NULL)
|
||||
retval = ':';
|
||||
}
|
||||
} else if (strchr(argv[optind], '=')) {
|
||||
/* An argument was provided to a non-argument option.
|
||||
I haven't seen this specified explicitly, but both GNU and BSD-based
|
||||
implementations show this behavior.
|
||||
*/
|
||||
retval = '?';
|
||||
}
|
||||
} else {
|
||||
/* Unknown option or ambiguous match. */
|
||||
retval = '?';
|
||||
}
|
||||
|
||||
++optind;
|
||||
return retval;
|
||||
}
|
57
examples/common/glfw/deps/getopt.h
Normal file
57
examples/common/glfw/deps/getopt.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
/* Copyright (c) 2012, Kim Gräsman
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* * Neither the name of Kim Gräsman nor the names of contributors may be used
|
||||
* to endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_GETOPT_PORT_H
|
||||
#define INCLUDED_GETOPT_PORT_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const int no_argument;
|
||||
extern const int required_argument;
|
||||
extern const int optional_argument;
|
||||
|
||||
extern char* optarg;
|
||||
extern int optind, opterr, optopt;
|
||||
|
||||
struct option {
|
||||
const char* name;
|
||||
int has_arg;
|
||||
int* flag;
|
||||
int val;
|
||||
};
|
||||
|
||||
int getopt(int argc, char* const argv[], const char* optstring);
|
||||
|
||||
int getopt_long(int argc, char* const argv[],
|
||||
const char* optstring, const struct option* longopts, int* longindex);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // INCLUDED_GETOPT_PORT_H
|
728
examples/common/glfw/deps/glad.c
Normal file
728
examples/common/glfw/deps/glad.c
Normal file
|
@ -0,0 +1,728 @@
|
|||
#include <string.h>
|
||||
#include <glad/glad.h>
|
||||
|
||||
struct gladGLversionStruct GLVersion;
|
||||
|
||||
#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
|
||||
#define _GLAD_IS_SOME_NEW_VERSION 1
|
||||
#endif
|
||||
|
||||
int GLAD_GL_VERSION_1_0;
|
||||
int GLAD_GL_VERSION_1_1;
|
||||
int GLAD_GL_VERSION_1_2;
|
||||
int GLAD_GL_VERSION_1_3;
|
||||
int GLAD_GL_VERSION_1_4;
|
||||
int GLAD_GL_VERSION_1_5;
|
||||
int GLAD_GL_VERSION_2_0;
|
||||
int GLAD_GL_VERSION_2_1;
|
||||
int GLAD_GL_VERSION_3_0;
|
||||
int GLAD_GL_VERSION_3_1;
|
||||
int GLAD_GL_VERSION_3_2;
|
||||
PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays;
|
||||
PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback;
|
||||
PFNGLFLUSHPROC glad_glFlush;
|
||||
PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D;
|
||||
PFNGLCLEARCOLORPROC glad_glClearColor;
|
||||
PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui;
|
||||
PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
|
||||
PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv;
|
||||
PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv;
|
||||
PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
|
||||
PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
|
||||
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
|
||||
PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation;
|
||||
PFNGLLINKPROGRAMPROC glad_glLinkProgram;
|
||||
PFNGLBINDTEXTUREPROC glad_glBindTexture;
|
||||
PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
|
||||
PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv;
|
||||
PFNGLFENCESYNCPROC glad_glFenceSync;
|
||||
PFNGLUNIFORM3UIPROC glad_glUniform3ui;
|
||||
PFNGLUNIFORM2UIVPROC glad_glUniform2uiv;
|
||||
PFNGLGETSTRINGPROC glad_glGetString;
|
||||
PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
|
||||
PFNGLDETACHSHADERPROC glad_glDetachShader;
|
||||
PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv;
|
||||
PFNGLGENBUFFERSPROC glad_glGenBuffers;
|
||||
PFNGLENDQUERYPROC glad_glEndQuery;
|
||||
PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv;
|
||||
PFNGLLINEWIDTHPROC glad_glLineWidth;
|
||||
PFNGLUNIFORM2FVPROC glad_glUniform2fv;
|
||||
PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
|
||||
PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v;
|
||||
PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
|
||||
PFNGLCOMPILESHADERPROC glad_glCompileShader;
|
||||
PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying;
|
||||
PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
|
||||
PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
|
||||
PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
|
||||
PFNGLPOLYGONMODEPROC glad_glPolygonMode;
|
||||
PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange;
|
||||
PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
|
||||
PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
|
||||
PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d;
|
||||
PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
|
||||
PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
|
||||
PFNGLISSYNCPROC glad_glIsSync;
|
||||
PFNGLCLAMPCOLORPROC glad_glClampColor;
|
||||
PFNGLUNIFORM4IVPROC glad_glUniform4iv;
|
||||
PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
|
||||
PFNGLCLEARSTENCILPROC glad_glClearStencil;
|
||||
PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture;
|
||||
PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv;
|
||||
PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s;
|
||||
PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex;
|
||||
PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv;
|
||||
PFNGLENABLEIPROC glad_glEnablei;
|
||||
PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
|
||||
PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv;
|
||||
PFNGLGENTEXTURESPROC glad_glGenTextures;
|
||||
PFNGLDEPTHFUNCPROC glad_glDepthFunc;
|
||||
PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
|
||||
PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
|
||||
PFNGLUNIFORM1FPROC glad_glUniform1f;
|
||||
PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
|
||||
PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv;
|
||||
PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv;
|
||||
PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
|
||||
PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage;
|
||||
PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
|
||||
PFNGLCREATESHADERPROC glad_glCreateShader;
|
||||
PFNGLISBUFFERPROC glad_glIsBuffer;
|
||||
PFNGLUNIFORM1IPROC glad_glUniform1i;
|
||||
PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s;
|
||||
PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
|
||||
PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
|
||||
PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv;
|
||||
PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
|
||||
PFNGLDISABLEPROC glad_glDisable;
|
||||
PFNGLUNIFORM2IPROC glad_glUniform2i;
|
||||
PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
|
||||
PFNGLLOGICOPPROC glad_glLogicOp;
|
||||
PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv;
|
||||
PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
|
||||
PFNGLCOLORMASKPROC glad_glColorMask;
|
||||
PFNGLHINTPROC glad_glHint;
|
||||
PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s;
|
||||
PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer;
|
||||
PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv;
|
||||
PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
|
||||
PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
|
||||
PFNGLSAMPLEMASKIPROC glad_glSampleMaski;
|
||||
PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
|
||||
PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback;
|
||||
PFNGLCULLFACEPROC glad_glCullFace;
|
||||
PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv;
|
||||
PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv;
|
||||
PFNGLUNIFORM4FVPROC glad_glUniform4fv;
|
||||
PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv;
|
||||
PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
|
||||
PFNGLUNIFORM1UIVPROC glad_glUniform1uiv;
|
||||
PFNGLPOINTSIZEPROC glad_glPointSize;
|
||||
PFNGLGETSTRINGIPROC glad_glGetStringi;
|
||||
PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv;
|
||||
PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv;
|
||||
PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
|
||||
PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv;
|
||||
PFNGLGENQUERIESPROC glad_glGenQueries;
|
||||
PFNGLWAITSYNCPROC glad_glWaitSync;
|
||||
PFNGLATTACHSHADERPROC glad_glAttachShader;
|
||||
PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer;
|
||||
PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
|
||||
PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
|
||||
PFNGLUNIFORM3IPROC glad_glUniform3i;
|
||||
PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D;
|
||||
PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D;
|
||||
PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex;
|
||||
PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
|
||||
PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
|
||||
PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
|
||||
PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex;
|
||||
PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv;
|
||||
PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
|
||||
PFNGLUNIFORM3FPROC glad_glUniform3f;
|
||||
PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv;
|
||||
PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
|
||||
PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv;
|
||||
PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender;
|
||||
PFNGLDRAWELEMENTSPROC glad_glDrawElements;
|
||||
PFNGLCOLORMASKIPROC glad_glColorMaski;
|
||||
PFNGLISENABLEDIPROC glad_glIsEnabledi;
|
||||
PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv;
|
||||
PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
|
||||
PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
|
||||
PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays;
|
||||
PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase;
|
||||
PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
|
||||
PFNGLUNIFORM1IVPROC glad_glUniform1iv;
|
||||
PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv;
|
||||
PFNGLUNIFORM4UIVPROC glad_glUniform4uiv;
|
||||
PFNGLREADBUFFERPROC glad_glReadBuffer;
|
||||
PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
|
||||
PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray;
|
||||
PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
|
||||
PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender;
|
||||
PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv;
|
||||
PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui;
|
||||
PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
|
||||
PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays;
|
||||
PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D;
|
||||
PFNGLGETSHADERIVPROC glad_glGetShaderiv;
|
||||
PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
|
||||
PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv;
|
||||
PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
|
||||
PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv;
|
||||
PFNGLPOINTPARAMETERIPROC glad_glPointParameteri;
|
||||
PFNGLBLENDCOLORPROC glad_glBlendColor;
|
||||
PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
|
||||
PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
|
||||
PFNGLDEPTHMASKPROC glad_glDepthMask;
|
||||
PFNGLPOINTPARAMETERFPROC glad_glPointParameterf;
|
||||
PFNGLDISABLEIPROC glad_glDisablei;
|
||||
PFNGLGETDOUBLEVPROC glad_glGetDoublev;
|
||||
PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv;
|
||||
PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv;
|
||||
PFNGLSHADERSOURCEPROC glad_glShaderSource;
|
||||
PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
|
||||
PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
|
||||
PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv;
|
||||
PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv;
|
||||
PFNGLDRAWARRAYSPROC glad_glDrawArrays;
|
||||
PFNGLUNIFORM1UIPROC glad_glUniform1ui;
|
||||
PFNGLISPROGRAMPROC glad_glIsProgram;
|
||||
PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv;
|
||||
PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation;
|
||||
PFNGLGETSYNCIVPROC glad_glGetSynciv;
|
||||
PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
|
||||
PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i;
|
||||
PFNGLUNIFORM4IPROC glad_glUniform4i;
|
||||
PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d;
|
||||
PFNGLCLEARPROC glad_glClear;
|
||||
PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
|
||||
PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName;
|
||||
PFNGLUNIFORM2FPROC glad_glUniform2f;
|
||||
PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample;
|
||||
PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
|
||||
PFNGLBEGINQUERYPROC glad_glBeginQuery;
|
||||
PFNGLUNIFORM2IVPROC glad_glUniform2iv;
|
||||
PFNGLBINDBUFFERPROC glad_glBindBuffer;
|
||||
PFNGLISENABLEDPROC glad_glIsEnabled;
|
||||
PFNGLSTENCILOPPROC glad_glStencilOp;
|
||||
PFNGLREADPIXELSPROC glad_glReadPixels;
|
||||
PFNGLCLEARDEPTHPROC glad_glClearDepth;
|
||||
PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv;
|
||||
PFNGLUNIFORM4FPROC glad_glUniform4f;
|
||||
PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
|
||||
PFNGLMAPBUFFERPROC glad_glMapBuffer;
|
||||
PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d;
|
||||
PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub;
|
||||
PFNGLUNIFORM3FVPROC glad_glUniform3fv;
|
||||
PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
|
||||
PFNGLBUFFERDATAPROC glad_glBufferData;
|
||||
PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv;
|
||||
PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
|
||||
PFNGLTEXIMAGE1DPROC glad_glTexImage1D;
|
||||
PFNGLDELETESYNCPROC glad_glDeleteSync;
|
||||
PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
|
||||
PFNGLGETERRORPROC glad_glGetError;
|
||||
PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
|
||||
PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
|
||||
PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
|
||||
PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements;
|
||||
PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
|
||||
PFNGLGETFLOATVPROC glad_glGetFloatv;
|
||||
PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D;
|
||||
PFNGLUNIFORM3IVPROC glad_glUniform3iv;
|
||||
PFNGLGETTEXIMAGEPROC glad_glGetTexImage;
|
||||
PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
|
||||
PFNGLUSEPROGRAMPROC glad_glUseProgram;
|
||||
PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv;
|
||||
PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv;
|
||||
PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i;
|
||||
PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
|
||||
PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
|
||||
PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
|
||||
PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv;
|
||||
PFNGLSTENCILFUNCPROC glad_glStencilFunc;
|
||||
PFNGLGETINTEGERVPROC glad_glGetIntegerv;
|
||||
PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
|
||||
PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
|
||||
PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
|
||||
PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
|
||||
PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv;
|
||||
PFNGLDRAWBUFFERPROC glad_glDrawBuffer;
|
||||
PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D;
|
||||
PFNGLUNIFORM1FVPROC glad_glUniform1fv;
|
||||
PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample;
|
||||
PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange;
|
||||
PFNGLISQUERYPROC glad_glIsQuery;
|
||||
PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv;
|
||||
PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
|
||||
PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
|
||||
PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv;
|
||||
PFNGLGETQUERYIVPROC glad_glGetQueryiv;
|
||||
PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
|
||||
PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
|
||||
PFNGLSTENCILMASKPROC glad_glStencilMask;
|
||||
PFNGLUNIFORM4UIPROC glad_glUniform4ui;
|
||||
PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv;
|
||||
PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
|
||||
PFNGLISTEXTUREPROC glad_glIsTexture;
|
||||
PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
|
||||
PFNGLISSHADERPROC glad_glIsShader;
|
||||
PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
|
||||
PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv;
|
||||
PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv;
|
||||
PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
|
||||
PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
|
||||
PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
|
||||
PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData;
|
||||
PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
|
||||
PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv;
|
||||
PFNGLENABLEPROC glad_glEnable;
|
||||
PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
|
||||
PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
|
||||
PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i;
|
||||
PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
|
||||
PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
|
||||
PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv;
|
||||
PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
|
||||
PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui;
|
||||
PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D;
|
||||
PFNGLFINISHPROC glad_glFinish;
|
||||
PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
|
||||
PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv;
|
||||
PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv;
|
||||
PFNGLDELETESHADERPROC glad_glDeleteShader;
|
||||
PFNGLBLENDFUNCPROC glad_glBlendFunc;
|
||||
PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
|
||||
PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
|
||||
PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv;
|
||||
PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
|
||||
PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui;
|
||||
PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange;
|
||||
PFNGLVIEWPORTPROC glad_glViewport;
|
||||
PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv;
|
||||
PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d;
|
||||
PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings;
|
||||
PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
|
||||
PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv;
|
||||
PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex;
|
||||
PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex;
|
||||
PFNGLUNIFORM2UIPROC glad_glUniform2ui;
|
||||
PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
|
||||
PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv;
|
||||
PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i;
|
||||
PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s;
|
||||
PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample;
|
||||
PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
|
||||
PFNGLDEPTHRANGEPROC glad_glDepthRange;
|
||||
PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
|
||||
PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv;
|
||||
PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
|
||||
PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi;
|
||||
PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
|
||||
PFNGLFRONTFACEPROC glad_glFrontFace;
|
||||
PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
|
||||
PFNGLSCISSORPROC glad_glScissor;
|
||||
PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex;
|
||||
PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
|
||||
PFNGLTEXBUFFERPROC glad_glTexBuffer;
|
||||
PFNGLPIXELSTOREIPROC glad_glPixelStorei;
|
||||
PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
|
||||
PFNGLPIXELSTOREFPROC glad_glPixelStoref;
|
||||
PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv;
|
||||
PFNGLUNIFORM3UIVPROC glad_glUniform3uiv;
|
||||
PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v;
|
||||
PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer;
|
||||
static void load_GL_VERSION_1_0(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_1_0) return;
|
||||
glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace");
|
||||
glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace");
|
||||
glad_glHint = (PFNGLHINTPROC)load("glHint");
|
||||
glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth");
|
||||
glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize");
|
||||
glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode");
|
||||
glad_glScissor = (PFNGLSCISSORPROC)load("glScissor");
|
||||
glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf");
|
||||
glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv");
|
||||
glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri");
|
||||
glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv");
|
||||
glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D");
|
||||
glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D");
|
||||
glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer");
|
||||
glad_glClear = (PFNGLCLEARPROC)load("glClear");
|
||||
glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor");
|
||||
glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil");
|
||||
glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth");
|
||||
glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask");
|
||||
glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask");
|
||||
glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask");
|
||||
glad_glDisable = (PFNGLDISABLEPROC)load("glDisable");
|
||||
glad_glEnable = (PFNGLENABLEPROC)load("glEnable");
|
||||
glad_glFinish = (PFNGLFINISHPROC)load("glFinish");
|
||||
glad_glFlush = (PFNGLFLUSHPROC)load("glFlush");
|
||||
glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc");
|
||||
glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp");
|
||||
glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc");
|
||||
glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp");
|
||||
glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc");
|
||||
glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref");
|
||||
glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei");
|
||||
glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer");
|
||||
glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels");
|
||||
glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv");
|
||||
glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev");
|
||||
glad_glGetError = (PFNGLGETERRORPROC)load("glGetError");
|
||||
glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv");
|
||||
glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv");
|
||||
glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
|
||||
glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage");
|
||||
glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv");
|
||||
glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv");
|
||||
glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv");
|
||||
glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv");
|
||||
glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled");
|
||||
glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange");
|
||||
glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport");
|
||||
}
|
||||
static void load_GL_VERSION_1_1(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_1_1) return;
|
||||
glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays");
|
||||
glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements");
|
||||
glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset");
|
||||
glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D");
|
||||
glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D");
|
||||
glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D");
|
||||
glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D");
|
||||
glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D");
|
||||
glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D");
|
||||
glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture");
|
||||
glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures");
|
||||
glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures");
|
||||
glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture");
|
||||
}
|
||||
static void load_GL_VERSION_1_2(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_1_2) return;
|
||||
glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements");
|
||||
glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D");
|
||||
glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D");
|
||||
glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D");
|
||||
}
|
||||
static void load_GL_VERSION_1_3(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_1_3) return;
|
||||
glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture");
|
||||
glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage");
|
||||
glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D");
|
||||
glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D");
|
||||
glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D");
|
||||
glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D");
|
||||
glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D");
|
||||
glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D");
|
||||
glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage");
|
||||
}
|
||||
static void load_GL_VERSION_1_4(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_1_4) return;
|
||||
glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate");
|
||||
glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays");
|
||||
glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements");
|
||||
glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf");
|
||||
glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv");
|
||||
glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri");
|
||||
glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv");
|
||||
glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor");
|
||||
glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation");
|
||||
}
|
||||
static void load_GL_VERSION_1_5(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_1_5) return;
|
||||
glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries");
|
||||
glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries");
|
||||
glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery");
|
||||
glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery");
|
||||
glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery");
|
||||
glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv");
|
||||
glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv");
|
||||
glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv");
|
||||
glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer");
|
||||
glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers");
|
||||
glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers");
|
||||
glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer");
|
||||
glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData");
|
||||
glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData");
|
||||
glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData");
|
||||
glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer");
|
||||
glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer");
|
||||
glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv");
|
||||
glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv");
|
||||
}
|
||||
static void load_GL_VERSION_2_0(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_2_0) return;
|
||||
glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate");
|
||||
glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers");
|
||||
glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate");
|
||||
glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate");
|
||||
glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate");
|
||||
glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader");
|
||||
glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation");
|
||||
glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader");
|
||||
glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram");
|
||||
glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader");
|
||||
glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram");
|
||||
glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader");
|
||||
glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader");
|
||||
glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray");
|
||||
glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray");
|
||||
glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib");
|
||||
glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform");
|
||||
glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders");
|
||||
glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation");
|
||||
glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv");
|
||||
glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog");
|
||||
glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv");
|
||||
glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog");
|
||||
glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource");
|
||||
glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation");
|
||||
glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv");
|
||||
glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv");
|
||||
glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv");
|
||||
glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv");
|
||||
glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv");
|
||||
glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv");
|
||||
glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram");
|
||||
glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader");
|
||||
glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram");
|
||||
glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource");
|
||||
glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram");
|
||||
glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f");
|
||||
glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f");
|
||||
glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f");
|
||||
glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f");
|
||||
glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i");
|
||||
glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i");
|
||||
glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i");
|
||||
glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i");
|
||||
glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv");
|
||||
glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv");
|
||||
glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv");
|
||||
glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv");
|
||||
glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv");
|
||||
glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv");
|
||||
glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv");
|
||||
glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv");
|
||||
glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv");
|
||||
glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv");
|
||||
glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv");
|
||||
glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram");
|
||||
glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d");
|
||||
glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv");
|
||||
glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f");
|
||||
glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv");
|
||||
glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s");
|
||||
glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv");
|
||||
glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d");
|
||||
glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv");
|
||||
glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f");
|
||||
glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv");
|
||||
glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s");
|
||||
glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv");
|
||||
glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d");
|
||||
glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv");
|
||||
glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f");
|
||||
glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv");
|
||||
glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s");
|
||||
glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv");
|
||||
glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv");
|
||||
glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv");
|
||||
glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv");
|
||||
glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub");
|
||||
glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv");
|
||||
glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv");
|
||||
glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv");
|
||||
glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv");
|
||||
glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d");
|
||||
glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv");
|
||||
glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f");
|
||||
glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv");
|
||||
glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv");
|
||||
glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s");
|
||||
glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv");
|
||||
glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv");
|
||||
glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv");
|
||||
glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv");
|
||||
glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer");
|
||||
}
|
||||
static void load_GL_VERSION_2_1(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_2_1) return;
|
||||
glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv");
|
||||
glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv");
|
||||
glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv");
|
||||
glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv");
|
||||
glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv");
|
||||
glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv");
|
||||
}
|
||||
static void load_GL_VERSION_3_0(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_3_0) return;
|
||||
glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski");
|
||||
glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v");
|
||||
glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v");
|
||||
glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei");
|
||||
glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei");
|
||||
glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi");
|
||||
glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback");
|
||||
glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback");
|
||||
glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange");
|
||||
glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase");
|
||||
glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings");
|
||||
glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying");
|
||||
glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor");
|
||||
glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender");
|
||||
glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender");
|
||||
glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer");
|
||||
glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv");
|
||||
glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv");
|
||||
glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i");
|
||||
glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i");
|
||||
glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i");
|
||||
glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i");
|
||||
glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui");
|
||||
glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui");
|
||||
glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui");
|
||||
glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui");
|
||||
glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv");
|
||||
glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv");
|
||||
glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv");
|
||||
glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv");
|
||||
glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv");
|
||||
glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv");
|
||||
glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv");
|
||||
glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv");
|
||||
glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv");
|
||||
glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv");
|
||||
glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv");
|
||||
glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv");
|
||||
glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv");
|
||||
glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation");
|
||||
glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation");
|
||||
glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui");
|
||||
glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui");
|
||||
glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui");
|
||||
glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui");
|
||||
glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv");
|
||||
glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv");
|
||||
glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv");
|
||||
glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv");
|
||||
glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv");
|
||||
glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv");
|
||||
glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv");
|
||||
glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv");
|
||||
glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv");
|
||||
glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv");
|
||||
glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv");
|
||||
glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi");
|
||||
glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi");
|
||||
glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer");
|
||||
glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer");
|
||||
glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers");
|
||||
glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers");
|
||||
glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage");
|
||||
glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv");
|
||||
glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer");
|
||||
glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer");
|
||||
glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers");
|
||||
glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers");
|
||||
glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus");
|
||||
glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D");
|
||||
glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D");
|
||||
glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D");
|
||||
glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer");
|
||||
glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv");
|
||||
glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap");
|
||||
glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer");
|
||||
glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample");
|
||||
glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer");
|
||||
glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange");
|
||||
glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange");
|
||||
glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray");
|
||||
glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays");
|
||||
glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays");
|
||||
glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray");
|
||||
}
|
||||
static void load_GL_VERSION_3_1(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_3_1) return;
|
||||
glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced");
|
||||
glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced");
|
||||
glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer");
|
||||
glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex");
|
||||
glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData");
|
||||
glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices");
|
||||
glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv");
|
||||
glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName");
|
||||
glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex");
|
||||
glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv");
|
||||
glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName");
|
||||
glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding");
|
||||
}
|
||||
static void load_GL_VERSION_3_2(GLADloadproc load) {
|
||||
if(!GLAD_GL_VERSION_3_2) return;
|
||||
glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex");
|
||||
glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex");
|
||||
glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex");
|
||||
glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex");
|
||||
glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex");
|
||||
glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync");
|
||||
glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync");
|
||||
glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync");
|
||||
glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync");
|
||||
glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync");
|
||||
glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v");
|
||||
glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv");
|
||||
glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v");
|
||||
glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v");
|
||||
glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture");
|
||||
glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample");
|
||||
glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample");
|
||||
glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv");
|
||||
glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski");
|
||||
}
|
||||
static void find_extensionsGL(void) {
|
||||
}
|
||||
|
||||
static void find_coreGL(void) {
|
||||
const char *v = (const char *)glGetString(GL_VERSION);
|
||||
int major = v[0] - '0';
|
||||
int minor = v[2] - '0';
|
||||
GLVersion.major = major; GLVersion.minor = minor;
|
||||
GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
|
||||
GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
|
||||
GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
|
||||
GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
|
||||
GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
|
||||
GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
|
||||
GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
|
||||
GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2;
|
||||
GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
|
||||
GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3;
|
||||
GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3;
|
||||
}
|
||||
|
||||
void gladLoadGLLoader(GLADloadproc load) {
|
||||
GLVersion.major = 0; GLVersion.minor = 0;
|
||||
glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
|
||||
if(glGetString == NULL) return;
|
||||
find_coreGL();
|
||||
load_GL_VERSION_1_0(load);
|
||||
load_GL_VERSION_1_1(load);
|
||||
load_GL_VERSION_1_2(load);
|
||||
load_GL_VERSION_1_3(load);
|
||||
load_GL_VERSION_1_4(load);
|
||||
load_GL_VERSION_1_5(load);
|
||||
load_GL_VERSION_2_0(load);
|
||||
load_GL_VERSION_2_1(load);
|
||||
load_GL_VERSION_3_0(load);
|
||||
load_GL_VERSION_3_1(load);
|
||||
load_GL_VERSION_3_2(load);
|
||||
|
||||
find_extensionsGL();
|
||||
|
||||
return;
|
||||
}
|
||||
|
1925
examples/common/glfw/deps/glad/glad.h
Normal file
1925
examples/common/glfw/deps/glad/glad.h
Normal file
File diff suppressed because it is too large
Load Diff
593
examples/common/glfw/deps/tinycthread.c
Normal file
593
examples/common/glfw/deps/tinycthread.c
Normal file
|
@ -0,0 +1,593 @@
|
|||
/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-
|
||||
Copyright (c) 2012 Marcus Geelnard
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/* 2013-01-06 Camilla Berglund <elmindreda@elmindreda.org>
|
||||
*
|
||||
* Added casts from time_t to DWORD to avoid warnings on VC++.
|
||||
*/
|
||||
|
||||
#include "tinycthread.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Platform specific includes */
|
||||
#if defined(_TTHREAD_POSIX_)
|
||||
#include <signal.h>
|
||||
#include <sched.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
#include <errno.h>
|
||||
#elif defined(_TTHREAD_WIN32_)
|
||||
#include <process.h>
|
||||
#include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
/* Standard, good-to-have defines */
|
||||
#ifndef NULL
|
||||
#define NULL (void*)0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
int mtx_init(mtx_t *mtx, int type)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
mtx->mAlreadyLocked = FALSE;
|
||||
mtx->mRecursive = type & mtx_recursive;
|
||||
InitializeCriticalSection(&mtx->mHandle);
|
||||
return thrd_success;
|
||||
#else
|
||||
int ret;
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
if (type & mtx_recursive)
|
||||
{
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
}
|
||||
ret = pthread_mutex_init(mtx, &attr);
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
return ret == 0 ? thrd_success : thrd_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
void mtx_destroy(mtx_t *mtx)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
DeleteCriticalSection(&mtx->mHandle);
|
||||
#else
|
||||
pthread_mutex_destroy(mtx);
|
||||
#endif
|
||||
}
|
||||
|
||||
int mtx_lock(mtx_t *mtx)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
EnterCriticalSection(&mtx->mHandle);
|
||||
if (!mtx->mRecursive)
|
||||
{
|
||||
while(mtx->mAlreadyLocked) Sleep(1000); /* Simulate deadlock... */
|
||||
mtx->mAlreadyLocked = TRUE;
|
||||
}
|
||||
return thrd_success;
|
||||
#else
|
||||
return pthread_mutex_lock(mtx) == 0 ? thrd_success : thrd_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
int mtx_timedlock(mtx_t *mtx, const struct timespec *ts)
|
||||
{
|
||||
/* FIXME! */
|
||||
(void)mtx;
|
||||
(void)ts;
|
||||
return thrd_error;
|
||||
}
|
||||
|
||||
int mtx_trylock(mtx_t *mtx)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
int ret = TryEnterCriticalSection(&mtx->mHandle) ? thrd_success : thrd_busy;
|
||||
if ((!mtx->mRecursive) && (ret == thrd_success) && mtx->mAlreadyLocked)
|
||||
{
|
||||
LeaveCriticalSection(&mtx->mHandle);
|
||||
ret = thrd_busy;
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;
|
||||
#endif
|
||||
}
|
||||
|
||||
int mtx_unlock(mtx_t *mtx)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
mtx->mAlreadyLocked = FALSE;
|
||||
LeaveCriticalSection(&mtx->mHandle);
|
||||
return thrd_success;
|
||||
#else
|
||||
return pthread_mutex_unlock(mtx) == 0 ? thrd_success : thrd_error;;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
#define _CONDITION_EVENT_ONE 0
|
||||
#define _CONDITION_EVENT_ALL 1
|
||||
#endif
|
||||
|
||||
int cnd_init(cnd_t *cond)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
cond->mWaitersCount = 0;
|
||||
|
||||
/* Init critical section */
|
||||
InitializeCriticalSection(&cond->mWaitersCountLock);
|
||||
|
||||
/* Init events */
|
||||
cond->mEvents[_CONDITION_EVENT_ONE] = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
if (cond->mEvents[_CONDITION_EVENT_ONE] == NULL)
|
||||
{
|
||||
cond->mEvents[_CONDITION_EVENT_ALL] = NULL;
|
||||
return thrd_error;
|
||||
}
|
||||
cond->mEvents[_CONDITION_EVENT_ALL] = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||
if (cond->mEvents[_CONDITION_EVENT_ALL] == NULL)
|
||||
{
|
||||
CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);
|
||||
cond->mEvents[_CONDITION_EVENT_ONE] = NULL;
|
||||
return thrd_error;
|
||||
}
|
||||
|
||||
return thrd_success;
|
||||
#else
|
||||
return pthread_cond_init(cond, NULL) == 0 ? thrd_success : thrd_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
void cnd_destroy(cnd_t *cond)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
if (cond->mEvents[_CONDITION_EVENT_ONE] != NULL)
|
||||
{
|
||||
CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);
|
||||
}
|
||||
if (cond->mEvents[_CONDITION_EVENT_ALL] != NULL)
|
||||
{
|
||||
CloseHandle(cond->mEvents[_CONDITION_EVENT_ALL]);
|
||||
}
|
||||
DeleteCriticalSection(&cond->mWaitersCountLock);
|
||||
#else
|
||||
pthread_cond_destroy(cond);
|
||||
#endif
|
||||
}
|
||||
|
||||
int cnd_signal(cnd_t *cond)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
int haveWaiters;
|
||||
|
||||
/* Are there any waiters? */
|
||||
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||
haveWaiters = (cond->mWaitersCount > 0);
|
||||
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||
|
||||
/* If we have any waiting threads, send them a signal */
|
||||
if(haveWaiters)
|
||||
{
|
||||
if (SetEvent(cond->mEvents[_CONDITION_EVENT_ONE]) == 0)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
}
|
||||
|
||||
return thrd_success;
|
||||
#else
|
||||
return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
int cnd_broadcast(cnd_t *cond)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
int haveWaiters;
|
||||
|
||||
/* Are there any waiters? */
|
||||
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||
haveWaiters = (cond->mWaitersCount > 0);
|
||||
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||
|
||||
/* If we have any waiting threads, send them a signal */
|
||||
if(haveWaiters)
|
||||
{
|
||||
if (SetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
}
|
||||
|
||||
return thrd_success;
|
||||
#else
|
||||
return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
static int _cnd_timedwait_win32(cnd_t *cond, mtx_t *mtx, DWORD timeout)
|
||||
{
|
||||
int result, lastWaiter;
|
||||
|
||||
/* Increment number of waiters */
|
||||
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||
++ cond->mWaitersCount;
|
||||
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||
|
||||
/* Release the mutex while waiting for the condition (will decrease
|
||||
the number of waiters when done)... */
|
||||
mtx_unlock(mtx);
|
||||
|
||||
/* Wait for either event to become signaled due to cnd_signal() or
|
||||
cnd_broadcast() being called */
|
||||
result = WaitForMultipleObjects(2, cond->mEvents, FALSE, timeout);
|
||||
if (result == WAIT_TIMEOUT)
|
||||
{
|
||||
return thrd_timeout;
|
||||
}
|
||||
else if (result == (int)WAIT_FAILED)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
|
||||
/* Check if we are the last waiter */
|
||||
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||
-- cond->mWaitersCount;
|
||||
lastWaiter = (result == (WAIT_OBJECT_0 + _CONDITION_EVENT_ALL)) &&
|
||||
(cond->mWaitersCount == 0);
|
||||
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||
|
||||
/* If we are the last waiter to be notified to stop waiting, reset the event */
|
||||
if (lastWaiter)
|
||||
{
|
||||
if (ResetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
}
|
||||
|
||||
/* Re-acquire the mutex */
|
||||
mtx_lock(mtx);
|
||||
|
||||
return thrd_success;
|
||||
}
|
||||
#endif
|
||||
|
||||
int cnd_wait(cnd_t *cond, mtx_t *mtx)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
return _cnd_timedwait_win32(cond, mtx, INFINITE);
|
||||
#else
|
||||
return pthread_cond_wait(cond, mtx) == 0 ? thrd_success : thrd_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
struct timespec now;
|
||||
if (clock_gettime(TIME_UTC, &now) == 0)
|
||||
{
|
||||
DWORD delta = (DWORD) ((ts->tv_sec - now.tv_sec) * 1000 +
|
||||
(ts->tv_nsec - now.tv_nsec + 500000) / 1000000);
|
||||
return _cnd_timedwait_win32(cond, mtx, delta);
|
||||
}
|
||||
else
|
||||
return thrd_error;
|
||||
#else
|
||||
int ret;
|
||||
ret = pthread_cond_timedwait(cond, mtx, ts);
|
||||
if (ret == ETIMEDOUT)
|
||||
{
|
||||
return thrd_timeout;
|
||||
}
|
||||
return ret == 0 ? thrd_success : thrd_error;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/** Information to pass to the new thread (what to run). */
|
||||
typedef struct {
|
||||
thrd_start_t mFunction; /**< Pointer to the function to be executed. */
|
||||
void * mArg; /**< Function argument for the thread function. */
|
||||
} _thread_start_info;
|
||||
|
||||
/* Thread wrapper function. */
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
static unsigned WINAPI _thrd_wrapper_function(void * aArg)
|
||||
#elif defined(_TTHREAD_POSIX_)
|
||||
static void * _thrd_wrapper_function(void * aArg)
|
||||
#endif
|
||||
{
|
||||
thrd_start_t fun;
|
||||
void *arg;
|
||||
int res;
|
||||
#if defined(_TTHREAD_POSIX_)
|
||||
void *pres;
|
||||
#endif
|
||||
|
||||
/* Get thread startup information */
|
||||
_thread_start_info *ti = (_thread_start_info *) aArg;
|
||||
fun = ti->mFunction;
|
||||
arg = ti->mArg;
|
||||
|
||||
/* The thread is responsible for freeing the startup information */
|
||||
free((void *)ti);
|
||||
|
||||
/* Call the actual client thread function */
|
||||
res = fun(arg);
|
||||
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
return res;
|
||||
#else
|
||||
pres = malloc(sizeof(int));
|
||||
if (pres != NULL)
|
||||
{
|
||||
*(int*)pres = res;
|
||||
}
|
||||
return pres;
|
||||
#endif
|
||||
}
|
||||
|
||||
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
|
||||
{
|
||||
/* Fill out the thread startup information (passed to the thread wrapper,
|
||||
which will eventually free it) */
|
||||
_thread_start_info* ti = (_thread_start_info*)malloc(sizeof(_thread_start_info));
|
||||
if (ti == NULL)
|
||||
{
|
||||
return thrd_nomem;
|
||||
}
|
||||
ti->mFunction = func;
|
||||
ti->mArg = arg;
|
||||
|
||||
/* Create the thread */
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
*thr = (HANDLE)_beginthreadex(NULL, 0, _thrd_wrapper_function, (void *)ti, 0, NULL);
|
||||
#elif defined(_TTHREAD_POSIX_)
|
||||
if(pthread_create(thr, NULL, _thrd_wrapper_function, (void *)ti) != 0)
|
||||
{
|
||||
*thr = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Did we fail to create the thread? */
|
||||
if(!*thr)
|
||||
{
|
||||
free(ti);
|
||||
return thrd_error;
|
||||
}
|
||||
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
thrd_t thrd_current(void)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
return GetCurrentThread();
|
||||
#else
|
||||
return pthread_self();
|
||||
#endif
|
||||
}
|
||||
|
||||
int thrd_detach(thrd_t thr)
|
||||
{
|
||||
/* FIXME! */
|
||||
(void)thr;
|
||||
return thrd_error;
|
||||
}
|
||||
|
||||
int thrd_equal(thrd_t thr0, thrd_t thr1)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
return thr0 == thr1;
|
||||
#else
|
||||
return pthread_equal(thr0, thr1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void thrd_exit(int res)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
ExitThread(res);
|
||||
#else
|
||||
void *pres = malloc(sizeof(int));
|
||||
if (pres != NULL)
|
||||
{
|
||||
*(int*)pres = res;
|
||||
}
|
||||
pthread_exit(pres);
|
||||
#endif
|
||||
}
|
||||
|
||||
int thrd_join(thrd_t thr, int *res)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
if (WaitForSingleObject(thr, INFINITE) == WAIT_FAILED)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
if (res != NULL)
|
||||
{
|
||||
DWORD dwRes;
|
||||
GetExitCodeThread(thr, &dwRes);
|
||||
*res = dwRes;
|
||||
}
|
||||
#elif defined(_TTHREAD_POSIX_)
|
||||
void *pres;
|
||||
int ires = 0;
|
||||
if (pthread_join(thr, &pres) != 0)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
if (pres != NULL)
|
||||
{
|
||||
ires = *(int*)pres;
|
||||
free(pres);
|
||||
}
|
||||
if (res != NULL)
|
||||
{
|
||||
*res = ires;
|
||||
}
|
||||
#endif
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining)
|
||||
{
|
||||
struct timespec now;
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
DWORD delta;
|
||||
#else
|
||||
long delta;
|
||||
#endif
|
||||
|
||||
/* Get the current time */
|
||||
if (clock_gettime(TIME_UTC, &now) != 0)
|
||||
return -2; // FIXME: Some specific error code?
|
||||
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
/* Delta in milliseconds */
|
||||
delta = (DWORD) ((time_point->tv_sec - now.tv_sec) * 1000 +
|
||||
(time_point->tv_nsec - now.tv_nsec + 500000) / 1000000);
|
||||
if (delta > 0)
|
||||
{
|
||||
Sleep(delta);
|
||||
}
|
||||
#else
|
||||
/* Delta in microseconds */
|
||||
delta = (time_point->tv_sec - now.tv_sec) * 1000000L +
|
||||
(time_point->tv_nsec - now.tv_nsec + 500L) / 1000L;
|
||||
|
||||
/* On some systems, the usleep argument must be < 1000000 */
|
||||
while (delta > 999999L)
|
||||
{
|
||||
usleep(999999);
|
||||
delta -= 999999L;
|
||||
}
|
||||
if (delta > 0L)
|
||||
{
|
||||
usleep((useconds_t)delta);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* We don't support waking up prematurely (yet) */
|
||||
if (remaining)
|
||||
{
|
||||
remaining->tv_sec = 0;
|
||||
remaining->tv_nsec = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void thrd_yield(void)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
Sleep(0);
|
||||
#else
|
||||
sched_yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
int tss_create(tss_t *key, tss_dtor_t dtor)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
/* FIXME: The destructor function is not supported yet... */
|
||||
if (dtor != NULL)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
*key = TlsAlloc();
|
||||
if (*key == TLS_OUT_OF_INDEXES)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
#else
|
||||
if (pthread_key_create(key, dtor) != 0)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
#endif
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
void tss_delete(tss_t key)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
TlsFree(key);
|
||||
#else
|
||||
pthread_key_delete(key);
|
||||
#endif
|
||||
}
|
||||
|
||||
void *tss_get(tss_t key)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
return TlsGetValue(key);
|
||||
#else
|
||||
return pthread_getspecific(key);
|
||||
#endif
|
||||
}
|
||||
|
||||
int tss_set(tss_t key, void *val)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
if (TlsSetValue(key, val) == 0)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
#else
|
||||
if (pthread_setspecific(key, val) != 0)
|
||||
{
|
||||
return thrd_error;
|
||||
}
|
||||
#endif
|
||||
return thrd_success;
|
||||
}
|
||||
|
||||
#if defined(_TTHREAD_EMULATE_CLOCK_GETTIME_)
|
||||
int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts)
|
||||
{
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
struct _timeb tb;
|
||||
_ftime(&tb);
|
||||
ts->tv_sec = (time_t)tb.time;
|
||||
ts->tv_nsec = 1000000L * (long)tb.millitm;
|
||||
#else
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
ts->tv_sec = (time_t)tv.tv_sec;
|
||||
ts->tv_nsec = 1000L * (long)tv.tv_usec;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif // _TTHREAD_EMULATE_CLOCK_GETTIME_
|
||||
|
440
examples/common/glfw/deps/tinycthread.h
Normal file
440
examples/common/glfw/deps/tinycthread.h
Normal file
|
@ -0,0 +1,440 @@
|
|||
/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-
|
||||
Copyright (c) 2012 Marcus Geelnard
|
||||
|
||||
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 _TINYCTHREAD_H_
|
||||
#define _TINYCTHREAD_H_
|
||||
|
||||
/**
|
||||
* @file
|
||||
* @mainpage TinyCThread API Reference
|
||||
*
|
||||
* @section intro_sec Introduction
|
||||
* TinyCThread is a minimal, portable implementation of basic threading
|
||||
* classes for C.
|
||||
*
|
||||
* They closely mimic the functionality and naming of the C11 standard, and
|
||||
* should be easily replaceable with the corresponding standard variants.
|
||||
*
|
||||
* @section port_sec Portability
|
||||
* The Win32 variant uses the native Win32 API for implementing the thread
|
||||
* classes, while for other systems, the POSIX threads API (pthread) is used.
|
||||
*
|
||||
* @section misc_sec Miscellaneous
|
||||
* The following special keywords are available: #_Thread_local.
|
||||
*
|
||||
* For more detailed information, browse the different sections of this
|
||||
* documentation. A good place to start is:
|
||||
* tinycthread.h.
|
||||
*/
|
||||
|
||||
/* Which platform are we on? */
|
||||
#if !defined(_TTHREAD_PLATFORM_DEFINED_)
|
||||
#if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)
|
||||
#define _TTHREAD_WIN32_
|
||||
#else
|
||||
#define _TTHREAD_POSIX_
|
||||
#endif
|
||||
#define _TTHREAD_PLATFORM_DEFINED_
|
||||
#endif
|
||||
|
||||
/* Activate some POSIX functionality (e.g. clock_gettime and recursive mutexes) */
|
||||
#if defined(_TTHREAD_POSIX_)
|
||||
#undef _FEATURES_H
|
||||
#if !defined(_GNU_SOURCE)
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#if !defined(_POSIX_C_SOURCE) || ((_POSIX_C_SOURCE - 0) < 199309L)
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 199309L
|
||||
#endif
|
||||
#if !defined(_XOPEN_SOURCE) || ((_XOPEN_SOURCE - 0) < 500)
|
||||
#undef _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 500
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Generic includes */
|
||||
#include <time.h>
|
||||
|
||||
/* Platform specific includes */
|
||||
#if defined(_TTHREAD_POSIX_)
|
||||
#include <pthread.h>
|
||||
#elif defined(_TTHREAD_WIN32_)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define __UNDEF_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef __UNDEF_LEAN_AND_MEAN
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#undef __UNDEF_LEAN_AND_MEAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Workaround for missing TIME_UTC: If time.h doesn't provide TIME_UTC,
|
||||
it's quite likely that libc does not support it either. Hence, fall back to
|
||||
the only other supported time specifier: CLOCK_REALTIME (and if that fails,
|
||||
we're probably emulating clock_gettime anyway, so anything goes). */
|
||||
#ifndef TIME_UTC
|
||||
#ifdef CLOCK_REALTIME
|
||||
#define TIME_UTC CLOCK_REALTIME
|
||||
#else
|
||||
#define TIME_UTC 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Workaround for missing clock_gettime (most Windows compilers, afaik) */
|
||||
#if defined(_TTHREAD_WIN32_) || defined(__APPLE_CC__)
|
||||
#define _TTHREAD_EMULATE_CLOCK_GETTIME_
|
||||
/* Emulate struct timespec */
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
struct _ttherad_timespec {
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
};
|
||||
#define timespec _ttherad_timespec
|
||||
#endif
|
||||
|
||||
/* Emulate clockid_t */
|
||||
typedef int _tthread_clockid_t;
|
||||
#define clockid_t _tthread_clockid_t
|
||||
|
||||
/* Emulate clock_gettime */
|
||||
int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts);
|
||||
#define clock_gettime _tthread_clock_gettime
|
||||
#define CLOCK_REALTIME 0
|
||||
#endif
|
||||
|
||||
|
||||
/** TinyCThread version (major number). */
|
||||
#define TINYCTHREAD_VERSION_MAJOR 1
|
||||
/** TinyCThread version (minor number). */
|
||||
#define TINYCTHREAD_VERSION_MINOR 1
|
||||
/** TinyCThread version (full version). */
|
||||
#define TINYCTHREAD_VERSION (TINYCTHREAD_VERSION_MAJOR * 100 + TINYCTHREAD_VERSION_MINOR)
|
||||
|
||||
/**
|
||||
* @def _Thread_local
|
||||
* Thread local storage keyword.
|
||||
* A variable that is declared with the @c _Thread_local keyword makes the
|
||||
* value of the variable local to each thread (known as thread-local storage,
|
||||
* or TLS). Example usage:
|
||||
* @code
|
||||
* // This variable is local to each thread.
|
||||
* _Thread_local int variable;
|
||||
* @endcode
|
||||
* @note The @c _Thread_local keyword is a macro that maps to the corresponding
|
||||
* compiler directive (e.g. @c __declspec(thread)).
|
||||
* @note This directive is currently not supported on Mac OS X (it will give
|
||||
* a compiler error), since compile-time TLS is not supported in the Mac OS X
|
||||
* executable format. Also, some older versions of MinGW (before GCC 4.x) do
|
||||
* not support this directive.
|
||||
* @hideinitializer
|
||||
*/
|
||||
|
||||
/* FIXME: Check for a PROPER value of __STDC_VERSION__ to know if we have C11 */
|
||||
#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201102L)) && !defined(_Thread_local)
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
|
||||
#define _Thread_local __thread
|
||||
#else
|
||||
#define _Thread_local __declspec(thread)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Macros */
|
||||
#define TSS_DTOR_ITERATIONS 0
|
||||
|
||||
/* Function return values */
|
||||
#define thrd_error 0 /**< The requested operation failed */
|
||||
#define thrd_success 1 /**< The requested operation succeeded */
|
||||
#define thrd_timeout 2 /**< The time specified in the call was reached without acquiring the requested resource */
|
||||
#define thrd_busy 3 /**< The requested operation failed because a tesource requested by a test and return function is already in use */
|
||||
#define thrd_nomem 4 /**< The requested operation failed because it was unable to allocate memory */
|
||||
|
||||
/* Mutex types */
|
||||
#define mtx_plain 1
|
||||
#define mtx_timed 2
|
||||
#define mtx_try 4
|
||||
#define mtx_recursive 8
|
||||
|
||||
/* Mutex */
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
typedef struct {
|
||||
CRITICAL_SECTION mHandle; /* Critical section handle */
|
||||
int mAlreadyLocked; /* TRUE if the mutex is already locked */
|
||||
int mRecursive; /* TRUE if the mutex is recursive */
|
||||
} mtx_t;
|
||||
#else
|
||||
typedef pthread_mutex_t mtx_t;
|
||||
#endif
|
||||
|
||||
/** Create a mutex object.
|
||||
* @param mtx A mutex object.
|
||||
* @param type Bit-mask that must have one of the following six values:
|
||||
* @li @c mtx_plain for a simple non-recursive mutex
|
||||
* @li @c mtx_timed for a non-recursive mutex that supports timeout
|
||||
* @li @c mtx_try for a non-recursive mutex that supports test and return
|
||||
* @li @c mtx_plain | @c mtx_recursive (same as @c mtx_plain, but recursive)
|
||||
* @li @c mtx_timed | @c mtx_recursive (same as @c mtx_timed, but recursive)
|
||||
* @li @c mtx_try | @c mtx_recursive (same as @c mtx_try, but recursive)
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int mtx_init(mtx_t *mtx, int type);
|
||||
|
||||
/** Release any resources used by the given mutex.
|
||||
* @param mtx A mutex object.
|
||||
*/
|
||||
void mtx_destroy(mtx_t *mtx);
|
||||
|
||||
/** Lock the given mutex.
|
||||
* Blocks until the given mutex can be locked. If the mutex is non-recursive, and
|
||||
* the calling thread already has a lock on the mutex, this call will block
|
||||
* forever.
|
||||
* @param mtx A mutex object.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int mtx_lock(mtx_t *mtx);
|
||||
|
||||
/** NOT YET IMPLEMENTED.
|
||||
*/
|
||||
int mtx_timedlock(mtx_t *mtx, const struct timespec *ts);
|
||||
|
||||
/** Try to lock the given mutex.
|
||||
* The specified mutex shall support either test and return or timeout. If the
|
||||
* mutex is already locked, the function returns without blocking.
|
||||
* @param mtx A mutex object.
|
||||
* @return @ref thrd_success on success, or @ref thrd_busy if the resource
|
||||
* requested is already in use, or @ref thrd_error if the request could not be
|
||||
* honored.
|
||||
*/
|
||||
int mtx_trylock(mtx_t *mtx);
|
||||
|
||||
/** Unlock the given mutex.
|
||||
* @param mtx A mutex object.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int mtx_unlock(mtx_t *mtx);
|
||||
|
||||
/* Condition variable */
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
typedef struct {
|
||||
HANDLE mEvents[2]; /* Signal and broadcast event HANDLEs. */
|
||||
unsigned int mWaitersCount; /* Count of the number of waiters. */
|
||||
CRITICAL_SECTION mWaitersCountLock; /* Serialize access to mWaitersCount. */
|
||||
} cnd_t;
|
||||
#else
|
||||
typedef pthread_cond_t cnd_t;
|
||||
#endif
|
||||
|
||||
/** Create a condition variable object.
|
||||
* @param cond A condition variable object.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int cnd_init(cnd_t *cond);
|
||||
|
||||
/** Release any resources used by the given condition variable.
|
||||
* @param cond A condition variable object.
|
||||
*/
|
||||
void cnd_destroy(cnd_t *cond);
|
||||
|
||||
/** Signal a condition variable.
|
||||
* Unblocks one of the threads that are blocked on the given condition variable
|
||||
* at the time of the call. If no threads are blocked on the condition variable
|
||||
* at the time of the call, the function does nothing and return success.
|
||||
* @param cond A condition variable object.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int cnd_signal(cnd_t *cond);
|
||||
|
||||
/** Broadcast a condition variable.
|
||||
* Unblocks all of the threads that are blocked on the given condition variable
|
||||
* at the time of the call. If no threads are blocked on the condition variable
|
||||
* at the time of the call, the function does nothing and return success.
|
||||
* @param cond A condition variable object.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int cnd_broadcast(cnd_t *cond);
|
||||
|
||||
/** Wait for a condition variable to become signaled.
|
||||
* The function atomically unlocks the given mutex and endeavors to block until
|
||||
* the given condition variable is signaled by a call to cnd_signal or to
|
||||
* cnd_broadcast. When the calling thread becomes unblocked it locks the mutex
|
||||
* before it returns.
|
||||
* @param cond A condition variable object.
|
||||
* @param mtx A mutex object.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int cnd_wait(cnd_t *cond, mtx_t *mtx);
|
||||
|
||||
/** Wait for a condition variable to become signaled.
|
||||
* The function atomically unlocks the given mutex and endeavors to block until
|
||||
* the given condition variable is signaled by a call to cnd_signal or to
|
||||
* cnd_broadcast, or until after the specified time. When the calling thread
|
||||
* becomes unblocked it locks the mutex before it returns.
|
||||
* @param cond A condition variable object.
|
||||
* @param mtx A mutex object.
|
||||
* @param xt A point in time at which the request will time out (absolute time).
|
||||
* @return @ref thrd_success upon success, or @ref thrd_timeout if the time
|
||||
* specified in the call was reached without acquiring the requested resource, or
|
||||
* @ref thrd_error if the request could not be honored.
|
||||
*/
|
||||
int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts);
|
||||
|
||||
/* Thread */
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
typedef HANDLE thrd_t;
|
||||
#else
|
||||
typedef pthread_t thrd_t;
|
||||
#endif
|
||||
|
||||
/** Thread start function.
|
||||
* Any thread that is started with the @ref thrd_create() function must be
|
||||
* started through a function of this type.
|
||||
* @param arg The thread argument (the @c arg argument of the corresponding
|
||||
* @ref thrd_create() call).
|
||||
* @return The thread return value, which can be obtained by another thread
|
||||
* by using the @ref thrd_join() function.
|
||||
*/
|
||||
typedef int (*thrd_start_t)(void *arg);
|
||||
|
||||
/** Create a new thread.
|
||||
* @param thr Identifier of the newly created thread.
|
||||
* @param func A function pointer to the function that will be executed in
|
||||
* the new thread.
|
||||
* @param arg An argument to the thread function.
|
||||
* @return @ref thrd_success on success, or @ref thrd_nomem if no memory could
|
||||
* be allocated for the thread requested, or @ref thrd_error if the request
|
||||
* could not be honored.
|
||||
* @note A thread’s identifier may be reused for a different thread once the
|
||||
* original thread has exited and either been detached or joined to another
|
||||
* thread.
|
||||
*/
|
||||
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg);
|
||||
|
||||
/** Identify the calling thread.
|
||||
* @return The identifier of the calling thread.
|
||||
*/
|
||||
thrd_t thrd_current(void);
|
||||
|
||||
/** NOT YET IMPLEMENTED.
|
||||
*/
|
||||
int thrd_detach(thrd_t thr);
|
||||
|
||||
/** Compare two thread identifiers.
|
||||
* The function determines if two thread identifiers refer to the same thread.
|
||||
* @return Zero if the two thread identifiers refer to different threads.
|
||||
* Otherwise a nonzero value is returned.
|
||||
*/
|
||||
int thrd_equal(thrd_t thr0, thrd_t thr1);
|
||||
|
||||
/** Terminate execution of the calling thread.
|
||||
* @param res Result code of the calling thread.
|
||||
*/
|
||||
void thrd_exit(int res);
|
||||
|
||||
/** Wait for a thread to terminate.
|
||||
* The function joins the given thread with the current thread by blocking
|
||||
* until the other thread has terminated.
|
||||
* @param thr The thread to join with.
|
||||
* @param res If this pointer is not NULL, the function will store the result
|
||||
* code of the given thread in the integer pointed to by @c res.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int thrd_join(thrd_t thr, int *res);
|
||||
|
||||
/** Put the calling thread to sleep.
|
||||
* Suspend execution of the calling thread.
|
||||
* @param time_point A point in time at which the thread will resume (absolute time).
|
||||
* @param remaining If non-NULL, this parameter will hold the remaining time until
|
||||
* time_point upon return. This will typically be zero, but if
|
||||
* the thread was woken up by a signal that is not ignored before
|
||||
* time_point was reached @c remaining will hold a positive
|
||||
* time.
|
||||
* @return 0 (zero) on successful sleep, or -1 if an interrupt occurred.
|
||||
*/
|
||||
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining);
|
||||
|
||||
/** Yield execution to another thread.
|
||||
* Permit other threads to run, even if the current thread would ordinarily
|
||||
* continue to run.
|
||||
*/
|
||||
void thrd_yield(void);
|
||||
|
||||
/* Thread local storage */
|
||||
#if defined(_TTHREAD_WIN32_)
|
||||
typedef DWORD tss_t;
|
||||
#else
|
||||
typedef pthread_key_t tss_t;
|
||||
#endif
|
||||
|
||||
/** Destructor function for a thread-specific storage.
|
||||
* @param val The value of the destructed thread-specific storage.
|
||||
*/
|
||||
typedef void (*tss_dtor_t)(void *val);
|
||||
|
||||
/** Create a thread-specific storage.
|
||||
* @param key The unique key identifier that will be set if the function is
|
||||
* successful.
|
||||
* @param dtor Destructor function. This can be NULL.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
* @note The destructor function is not supported under Windows. If @c dtor is
|
||||
* not NULL when calling this function under Windows, the function will fail
|
||||
* and return @ref thrd_error.
|
||||
*/
|
||||
int tss_create(tss_t *key, tss_dtor_t dtor);
|
||||
|
||||
/** Delete a thread-specific storage.
|
||||
* The function releases any resources used by the given thread-specific
|
||||
* storage.
|
||||
* @param key The key that shall be deleted.
|
||||
*/
|
||||
void tss_delete(tss_t key);
|
||||
|
||||
/** Get the value for a thread-specific storage.
|
||||
* @param key The thread-specific storage identifier.
|
||||
* @return The value for the current thread held in the given thread-specific
|
||||
* storage.
|
||||
*/
|
||||
void *tss_get(tss_t key);
|
||||
|
||||
/** Set the value for a thread-specific storage.
|
||||
* @param key The thread-specific storage identifier.
|
||||
* @param val The value of the thread-specific storage to set for the current
|
||||
* thread.
|
||||
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||
* not be honored.
|
||||
*/
|
||||
int tss_set(tss_t key, void *val);
|
||||
|
||||
|
||||
#endif /* _TINYTHREAD_H_ */
|
||||
|
5
examples/common/glfw/docs/CMakeLists.txt
Normal file
5
examples/common/glfw/docs/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
|
||||
add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE}
|
||||
WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs
|
||||
COMMENT "Generating HTML documentation" VERBATIM)
|
||||
|
1863
examples/common/glfw/docs/Doxyfile.in
Normal file
1863
examples/common/glfw/docs/Doxyfile.in
Normal file
File diff suppressed because it is too large
Load Diff
188
examples/common/glfw/docs/DoxygenLayout.xml
Normal file
188
examples/common/glfw/docs/DoxygenLayout.xml
Normal file
|
@ -0,0 +1,188 @@
|
|||
<doxygenlayout version="1.0">
|
||||
<!-- Generated by doxygen 1.8.3.1 -->
|
||||
<!-- Navigation index tabs for HTML output -->
|
||||
<navindex>
|
||||
<tab type="mainpage" visible="yes" title="Introduction"/>
|
||||
<tab type="pages" visible="yes" title="Guides" intro=""/>
|
||||
<tab type="modules" visible="yes" title="Reference" intro=""/>
|
||||
<tab type="namespaces" visible="yes" title="">
|
||||
<tab type="namespacelist" visible="yes" title="" intro=""/>
|
||||
<tab type="namespacemembers" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="classes" visible="no" title="">
|
||||
<tab type="classlist" visible="yes" title="" intro=""/>
|
||||
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
|
||||
<tab type="hierarchy" visible="yes" title="" intro=""/>
|
||||
<tab type="classmembers" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="files" visible="yes" title="Header Files">
|
||||
<tab type="filelist" visible="yes" title="" intro=""/>
|
||||
<tab type="globals" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="examples" visible="yes" title="" intro=""/>
|
||||
</navindex>
|
||||
|
||||
<!-- Layout definition for a class page -->
|
||||
<class>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<inheritancegraph visible="$CLASS_GRAPH"/>
|
||||
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
|
||||
<memberdecl>
|
||||
<nestedclasses visible="yes" title=""/>
|
||||
<publictypes title=""/>
|
||||
<publicslots title=""/>
|
||||
<signals title=""/>
|
||||
<publicmethods title=""/>
|
||||
<publicstaticmethods title=""/>
|
||||
<publicattributes title=""/>
|
||||
<publicstaticattributes title=""/>
|
||||
<protectedtypes title=""/>
|
||||
<protectedslots title=""/>
|
||||
<protectedmethods title=""/>
|
||||
<protectedstaticmethods title=""/>
|
||||
<protectedattributes title=""/>
|
||||
<protectedstaticattributes title=""/>
|
||||
<packagetypes title=""/>
|
||||
<packagemethods title=""/>
|
||||
<packagestaticmethods title=""/>
|
||||
<packageattributes title=""/>
|
||||
<packagestaticattributes title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
<privatetypes title=""/>
|
||||
<privateslots title=""/>
|
||||
<privatemethods title=""/>
|
||||
<privatestaticmethods title=""/>
|
||||
<privateattributes title=""/>
|
||||
<privatestaticattributes title=""/>
|
||||
<friends title=""/>
|
||||
<related title="" subtitle=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<constructors title=""/>
|
||||
<functions title=""/>
|
||||
<related title=""/>
|
||||
<variables title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
</memberdef>
|
||||
<allmemberslink visible="yes"/>
|
||||
<usedfiles visible="$SHOW_USED_FILES"/>
|
||||
<authorsection visible="yes"/>
|
||||
</class>
|
||||
|
||||
<!-- Layout definition for a namespace page -->
|
||||
<namespace>
|
||||
<briefdescription visible="yes"/>
|
||||
<memberdecl>
|
||||
<nestednamespaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</namespace>
|
||||
|
||||
<!-- Layout definition for a file page -->
|
||||
<file>
|
||||
<briefdescription visible="yes"/>
|
||||
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||
<includegraph visible="$INCLUDE_GRAPH"/>
|
||||
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
|
||||
<sourcelink visible="yes"/>
|
||||
<memberdecl>
|
||||
<classes visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
</memberdef>
|
||||
<authorsection/>
|
||||
</file>
|
||||
|
||||
<!-- Layout definition for a group page -->
|
||||
<group>
|
||||
<briefdescription visible="yes"/>
|
||||
<detaileddescription title="Description"/>
|
||||
<groupgraph visible="$GROUP_GRAPHS"/>
|
||||
<memberdecl>
|
||||
<nestedgroups visible="yes" title=""/>
|
||||
<dirs visible="yes" title=""/>
|
||||
<files visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
</memberdecl>
|
||||
<memberdef>
|
||||
<pagedocs/>
|
||||
<inlineclasses title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
<signals title=""/>
|
||||
<publicslots title=""/>
|
||||
<protectedslots title=""/>
|
||||
<privateslots title=""/>
|
||||
<events title=""/>
|
||||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
</memberdef>
|
||||
<authorsection visible="yes"/>
|
||||
</group>
|
||||
|
||||
<!-- Layout definition for a directory page -->
|
||||
<directory>
|
||||
<briefdescription visible="yes"/>
|
||||
<directorygraph visible="yes"/>
|
||||
<memberdecl>
|
||||
<dirs visible="yes"/>
|
||||
<files visible="yes"/>
|
||||
</memberdecl>
|
||||
<detaileddescription title=""/>
|
||||
</directory>
|
||||
</doxygenlayout>
|
303
examples/common/glfw/docs/build.dox
Normal file
303
examples/common/glfw/docs/build.dox
Normal file
|
@ -0,0 +1,303 @@
|
|||
/*!
|
||||
|
||||
@page build Building applications
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This is about compiling and linking applications that use GLFW. For information on
|
||||
how to write such applications, start with the [introductory tutorial](@ref quick).
|
||||
For information on how to compile the GLFW library itself, see the @ref compile
|
||||
guide.
|
||||
|
||||
This is not a tutorial on compilation or linking. It assumes basic
|
||||
understanding of how to compile and link a C program as well as how to use the
|
||||
specific compiler of your chosen development environment. The compilation
|
||||
and linking process should be explained in your C programming material and in
|
||||
the documentation for your development environment.
|
||||
|
||||
@section build_include Including the GLFW header file
|
||||
|
||||
In the source files of your application where you use OpenGL or GLFW, you should
|
||||
include the GLFW header file, i.e.:
|
||||
|
||||
@code
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
The GLFW header declares the GLFW API and by default also includes the OpenGL
|
||||
header of your development environment, which in turn defines all the constants,
|
||||
types and function prototypes of the OpenGL API.
|
||||
|
||||
The GLFW header also defines everything necessary for your OpenGL header to
|
||||
function. For example, under Windows you are normally required to include
|
||||
`windows.h` before the OpenGL header, which would pollute your code namespace
|
||||
with the entire Win32 API.
|
||||
|
||||
Instead, the GLFW header takes care of this for you, not by including
|
||||
`windows.h`, but by duplicating only the very few necessary parts of it. It
|
||||
does this only when needed, so if `windows.h` _is_ included, the GLFW header
|
||||
does not try to redefine those symbols. The reverse is not true, i.e.
|
||||
`windows.h` cannot cope if any of its symbols have already been defined.
|
||||
|
||||
In other words:
|
||||
|
||||
- Do _not_ include the OpenGL headers yourself, as GLFW does this for you
|
||||
- Do _not_ include `windows.h` or other platform-specific headers unless you
|
||||
plan on using those APIs directly
|
||||
- If you _do_ need to include such headers, do it _before_ including
|
||||
the GLFW header and it will handle this
|
||||
|
||||
If you are using an OpenGL extension loading library such as
|
||||
[glad](https://github.com/Dav1dde/glad), the extension loader header should
|
||||
either be included _before_ the GLFW one, or the `GLFW_INCLUDE_NONE` macro
|
||||
(described below) should be defined.
|
||||
|
||||
|
||||
@subsection build_macros GLFW header option macros
|
||||
|
||||
These macros may be defined before the inclusion of the GLFW header and affect
|
||||
its behavior.
|
||||
|
||||
`GLFW_DLL` is required on Windows when using the GLFW DLL, to tell the compiler
|
||||
that the GLFW functions are defined in a DLL.
|
||||
|
||||
The following macros control which OpenGL or OpenGL ES API header is included.
|
||||
|
||||
`GLFW_INCLUDE_GLCOREARB` makes the GLFW header include the modern
|
||||
`GL/glcorearb.h` header (`OpenGL/gl3.h` on OS X) instead of the regular OpenGL
|
||||
header.
|
||||
|
||||
`GLFW_INCLUDE_ES1` makes the GLFW header include the OpenGL ES 1.x `GLES/gl.h`
|
||||
header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_INCLUDE_ES2` makes the GLFW header include the OpenGL ES 2.0 `GLES2/gl2.h`
|
||||
header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_INCLUDE_ES3` makes the GLFW header include the OpenGL ES 3.0 `GLES3/gl3.h`
|
||||
header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_INCLUDE_ES31` makes the GLFW header include the OpenGL ES 3.1 `GLES3/gl31.h`
|
||||
header instead of the regular OpenGL header.
|
||||
|
||||
`GLFW_INCLUDE_NONE` makes the GLFW header not include any OpenGL or OpenGL ES API
|
||||
header. This is useful in combination with an extension loading library.
|
||||
|
||||
If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h`
|
||||
header (`OpenGL/gl.h` on OS X) is included.
|
||||
|
||||
`GLFW_INCLUDE_GLEXT` makes the GLFW header include the appropriate extension
|
||||
header for the OpenGL or OpenGL ES header selected above after and _in addition
|
||||
to_ that header.
|
||||
|
||||
`GLFW_INCLUDE_GLU` makes the header include the GLU header _in addition to_ the
|
||||
header selected above. This should only be used with the standard OpenGL header
|
||||
and only for legacy code. GLU has been deprecated and should not be used in new
|
||||
code.
|
||||
|
||||
@note GLFW does not provide any of the API headers mentioned above. They must
|
||||
be provided by your development environment or your OpenGL or OpenGL ES SDK.
|
||||
|
||||
|
||||
@section build_link Link with the right libraries
|
||||
|
||||
GLFW is essentially a wrapper of various platform-specific APIs and therefore
|
||||
needs to link against many different system libraries. If you are using GLFW as
|
||||
a shared library / dynamic library / DLL then it takes care of these links.
|
||||
However, if you are using GLFW as a static library then your executable will
|
||||
need to link against these libraries.
|
||||
|
||||
On Windows and OS X, the list of system libraries is static and can be
|
||||
hard-coded into your build environment. See the section for your development
|
||||
environment below. On Linux and other Unix-like operating systems, the list
|
||||
varies but can be retrieved in various ways as described below.
|
||||
|
||||
A good general introduction to linking is
|
||||
[Beginner's Guide to Linkers](http://www.lurklurk.org/linkers/linkers.html) by
|
||||
David Drysdale.
|
||||
|
||||
|
||||
@subsection build_link_win32 With MinGW or Visual C++ on Windows
|
||||
|
||||
The static version of the GLFW library is named `glfw3`. When using this
|
||||
version, it is also necessary to link with some libraries that GLFW uses.
|
||||
|
||||
When linking an application under Windows that uses the static version of GLFW,
|
||||
you must link with `opengl32`. On some versions of MinGW, you must also
|
||||
explicitly link with `gdi32`, while other versions of MinGW include it in the
|
||||
set of default libraries along with other dependencies like `user32` and
|
||||
`kernel32`. If you are using GLU, you must also link with `glu32`.
|
||||
|
||||
The link library for the GLFW DLL is named `glfw3dll`. When compiling an
|
||||
application that uses the DLL version of GLFW, you need to define the `GLFW_DLL`
|
||||
macro _before_ any inclusion of the GLFW header. This can be done either with
|
||||
a compiler switch or by defining it in your source code.
|
||||
|
||||
An application using the GLFW DLL does not need to link against any of its
|
||||
dependencies, but you still have to link against `opengl32` if your application
|
||||
uses OpenGL and `glu32` if it uses GLU.
|
||||
|
||||
|
||||
@subsection build_link_cmake_source With CMake and GLFW source
|
||||
|
||||
With just a few changes to your `CMakeLists.txt` you can have the GLFW source
|
||||
tree built along with your application.
|
||||
|
||||
Firstly, add the root directory of the GLFW source tree to your project. This
|
||||
will add the `glfw` target and the necessary cache variables to your project.
|
||||
|
||||
@code{.cmake}
|
||||
add_subdirectory(path/to/glfw)
|
||||
@endcode
|
||||
|
||||
To be able to include the GLFW header from your code, you need to tell the
|
||||
compiler where to find it.
|
||||
|
||||
@code{.cmake}
|
||||
include_directories(path/to/glfw/include)
|
||||
@endcode
|
||||
|
||||
Once GLFW has been added to the project, the `GLFW_LIBRARIES` cache variable
|
||||
contains all link-time dependencies of GLFW as it is currently configured. To
|
||||
link against GLFW, link against them and the `glfw` target.
|
||||
|
||||
@code{.cmake}
|
||||
target_link_libraries(myapp glfw ${GLFW_LIBRARIES})
|
||||
@endcode
|
||||
|
||||
Note that `GLFW_LIBRARIES` does not include GLU, as GLFW does not use it. If
|
||||
your application needs GLU, you can add it to the list of dependencies with the
|
||||
`OPENGL_glu_LIBRARY` cache variable, which is implicitly created when the GLFW
|
||||
CMake files look for OpenGL.
|
||||
|
||||
@code{.cmake}
|
||||
target_link_libraries(myapp glfw ${OPENGL_glu_LIBRARY} ${GLFW_LIBRARIES})
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection build_link_cmake_pkgconfig With CMake on Unix and installed GLFW binaries
|
||||
|
||||
CMake can import settings from pkg-config, which GLFW supports. When you
|
||||
installed GLFW, the pkg-config file `glfw3.pc` was installed along with it.
|
||||
|
||||
First you need to find the PkgConfig package. If this fails, you may need to
|
||||
install the pkg-config package for your distribution.
|
||||
|
||||
@code{.cmake}
|
||||
find_package(PkgConfig REQUIRED)
|
||||
@endcode
|
||||
|
||||
This creates the CMake commands to find pkg-config packages. Then you need to
|
||||
find the GLFW package.
|
||||
|
||||
@code{.cmake}
|
||||
pkg_search_module(GLFW REQUIRED glfw3)
|
||||
@endcode
|
||||
|
||||
This creates the CMake variables you need to use GLFW. To be able to include
|
||||
the GLFW header, you need to tell your compiler where it is.
|
||||
|
||||
@code{.cmake}
|
||||
include_directories(${GLFW_INCLUDE_DIRS})
|
||||
@endcode
|
||||
|
||||
You also need to link against the correct libraries. If you are using the
|
||||
shared library version of GLFW, use the `GLFW_LIBRARIES` variable.
|
||||
|
||||
@code{.cmake}
|
||||
target_link_libraries(simple ${GLFW_LIBRARIES})
|
||||
@endcode
|
||||
|
||||
If you are using the static library version of GLFW, use the
|
||||
`GLFW_STATIC_LIBRARIES` variable instead.
|
||||
|
||||
@code{.cmake}
|
||||
target_link_libraries(simple ${GLFW_STATIC_LIBRARIES})
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection build_link_pkgconfig With pkg-config on OS X or other Unix
|
||||
|
||||
GLFW supports [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config/),
|
||||
and the `glfw3.pc` pkf-config file is generated when the GLFW library is built
|
||||
and is installed along with it. A pkg-config file describes all necessary
|
||||
compile-time and link-time flags and dependencies needed to use a library. When
|
||||
they are updated or if they differ between systems, you will get the correct
|
||||
ones automatically.
|
||||
|
||||
A typical compile and link command-line when using the static version of the
|
||||
GLFW library may look like this:
|
||||
|
||||
@code{.sh}
|
||||
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3`
|
||||
@endcode
|
||||
|
||||
If you are using the shared version of the GLFW library, simply omit the
|
||||
`--static` flag.
|
||||
|
||||
@code{.sh}
|
||||
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3`
|
||||
@endcode
|
||||
|
||||
You can also use the `glfw3.pc` file without installing it first, by using the
|
||||
`PKG_CONFIG_PATH` environment variable.
|
||||
|
||||
@code{.sh}
|
||||
env PKG_CONFIG_PATH=path/to/glfw/src cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3`
|
||||
@endcode
|
||||
|
||||
The dependencies do not include GLU, as GLFW does not need it. On OS X, GLU is
|
||||
built into the OpenGL framework, so if you need GLU you don't need to do
|
||||
anything extra. If you need GLU and are using Linux or BSD, you should add the
|
||||
`glu` pkg-config module.
|
||||
|
||||
@code{.sh}
|
||||
cc `pkg-config --cflags glfw3 glu` -o myprog myprog.c `pkg-config --libs glfw3 glu`
|
||||
@endcode
|
||||
|
||||
If you are using the static version of the GLFW library, make sure you don't link statically against GLU.
|
||||
|
||||
@code{.sh}
|
||||
cc `pkg-config --cflags glfw3 glu` -o myprog myprog.c `pkg-config --static --libs glfw3` `pkg-config --libs glu`
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection build_link_xcode With Xcode on OS X
|
||||
|
||||
If you are using the dynamic library version of GLFW, simply add it to the
|
||||
project dependencies.
|
||||
|
||||
If you are using the static library version of GLFW, add it and the Cocoa,
|
||||
OpenGL, IOKit, CoreVideo and Carbon frameworks to the project as dependencies.
|
||||
They can all be found in `/System/Library/Frameworks`.
|
||||
|
||||
@note GLFW needs the Carbon framework only to access the current keyboard layout
|
||||
via the Text Input Source Services. This is one of the non-deprecated parts of
|
||||
the Carbon API and the only way to access this information on OS X.
|
||||
|
||||
|
||||
@subsection build_link_osx With command-line on OS X
|
||||
|
||||
It is recommended that you use [pkg-config](@ref build_link_pkgconfig) when
|
||||
building from the command line on OS X. That way you will get any new
|
||||
dependencies added automatically. If you still wish to build manually, you need
|
||||
to add the required frameworks and libraries to your command-line yourself using
|
||||
the `-l` and `-framework` switches.
|
||||
|
||||
If you are using the dynamic GLFW library, which is named `libglfw.3.dylib`, do:
|
||||
|
||||
@code{.sh}
|
||||
cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo
|
||||
@endcode
|
||||
|
||||
If you are using the static library, named `libglfw3.a`, substitute `-lglfw3`
|
||||
for `-lglfw`.
|
||||
|
||||
Note that you do not add the `.framework` extension to a framework when linking
|
||||
against it from the command-line.
|
||||
|
||||
The OpenGL framework contains both the OpenGL and GLU APIs, so there is nothing
|
||||
special to do when using GLU. Also note that even though your machine may have
|
||||
`libGL`-style OpenGL libraries, they are for use with the X Window System and
|
||||
will _not_ work with the OS X native version of GLFW.
|
||||
|
||||
*/
|
179
examples/common/glfw/docs/compat.dox
Normal file
179
examples/common/glfw/docs/compat.dox
Normal file
|
@ -0,0 +1,179 @@
|
|||
/*!
|
||||
|
||||
@page compat Standards conformance
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide describes the various API extensions used by this version of GLFW.
|
||||
It lists what are essentially implementation details, but which are nonetheless
|
||||
vital knowledge for developers intending to deploy their applications on a wide
|
||||
range of machines.
|
||||
|
||||
The information in this guide is not a part of GLFW API, but merely
|
||||
preconditions for some parts of the library to function on a given machine. Any
|
||||
part of this information may change in future versions of GLFW and that will not
|
||||
be considered a breaking API change.
|
||||
|
||||
|
||||
@section compat_x11 X11 extensions, protocols and IPC standards
|
||||
|
||||
As GLFW uses Xlib directly, without any intervening toolkit
|
||||
library, it has sole responsibility for interacting well with the many and
|
||||
varied window managers in use on Unix-like systems. In order for applications
|
||||
and window managers to work well together, a number of standards and
|
||||
conventions have been developed that regulate behavior outside the scope of the
|
||||
X11 API; most importantly the
|
||||
[Inter-Client Communication Conventions Manual](http://www.tronche.com/gui/x/icccm/)
|
||||
(ICCCM) and
|
||||
[Extended Window Manager Hints](http://standards.freedesktop.org/wm-spec/wm-spec-latest.html)
|
||||
(EWMH) standards.
|
||||
|
||||
GLFW uses the `_MOTIF_WM_HINTS` window property to support borderless windows.
|
||||
If the running window manager does not support this property, the
|
||||
`GLFW_DECORATED` hint will have no effect.
|
||||
|
||||
GLFW uses the ICCCM `WM_DELETE_WINDOW` protocol to intercept the user
|
||||
attempting to close the GLFW window. If the running window manager does not
|
||||
support this protocol, the close callback will never be called.
|
||||
|
||||
GLFW uses the EWMH `_NET_WM_PING` protocol, allowing the window manager notify
|
||||
the user when the application has stopped responding, i.e. when it has ceased to
|
||||
process events. If the running window manager does not support this protocol,
|
||||
the user will not be notified if the application locks up.
|
||||
|
||||
GLFW uses the EWMH `_NET_WM_STATE_FULLSCREEN` window state to tell the window
|
||||
manager to make the GLFW window full screen. If the running window manager does
|
||||
not support this state, full screen windows may not work properly. GLFW has
|
||||
a fallback code path in case this state is unavailable, but every window manager
|
||||
behaves slightly differently in this regard.
|
||||
|
||||
GLFW uses the EWMH `_NET_WM_BYPASS_COMPOSITOR` window property to tell a
|
||||
compositing window manager to un-redirect full screen GLFW windows. If the
|
||||
running window manager uses compositing but does not support this property then
|
||||
additional copying may be performed for each buffer swap of full screen windows.
|
||||
|
||||
GLFW uses the
|
||||
[clipboard manager protocol](http://www.freedesktop.org/wiki/ClipboardManager/)
|
||||
to push a clipboard string (i.e. selection) owned by a GLFW window about to be
|
||||
destroyed to the clipboard manager. If there is no running clipboard manager,
|
||||
the clipboard string will be unavailable once the window has been destroyed.
|
||||
|
||||
GLFW uses the
|
||||
[X drag-and-drop protocol](http://www.freedesktop.org/wiki/Specifications/XDND/)
|
||||
to provide file drop events. If the application originating the drag does not
|
||||
support this protocol, drag and drop will not work.
|
||||
|
||||
GLFW uses the XInput 2 extension to provide sub-pixel cursor motion events. If
|
||||
the running X server does not support this version of this extension, cursor
|
||||
motion will be snapped to the pixel grid.
|
||||
|
||||
GLFW uses the XRandR 1.3 extension to provide multi-monitor support. If the
|
||||
running X server does not support this version of this extension, multi-monitor
|
||||
support will not function and only a single, desktop-spanning monitor will be
|
||||
reported.
|
||||
|
||||
GLFW uses the XRandR 1.3 and Xf86vidmode extensions to provide gamma ramp
|
||||
support. If the running X server does not support either or both of these
|
||||
extensions, gamma ramp support will not function.
|
||||
|
||||
GLFW uses the Xkb extension and detectable auto-repeat to provide keyboard
|
||||
input. If the running X server does not support this extension, a non-Xkb
|
||||
fallback path is used.
|
||||
|
||||
|
||||
@section compat_glx GLX extensions
|
||||
|
||||
The GLX API is the default API used to create OpenGL contexts on Unix-like
|
||||
systems using the X Window System.
|
||||
|
||||
GLFW uses the GLX 1.3 `GLXFBConfig` functions to enumerate and select framebuffer pixel
|
||||
formats. If GLX 1.3 is not supported, @ref glfwInit will fail.
|
||||
|
||||
GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and
|
||||
`GLX_SGI_swap_control` extensions to provide vertical retrace synchronization
|
||||
(or _vsync_), in that order of preference. Where none of these extension are
|
||||
available, calling @ref glfwSwapInterval will have no effect.
|
||||
|
||||
GLFW uses the `GLX_ARB_multisample` extension to create contexts with
|
||||
multisampling anti-aliasing. Where this extension is unavailable, the
|
||||
`GLFW_SAMPLES` hint will have no effect.
|
||||
|
||||
GLFW uses the `GLX_ARB_create_context` extension when available, even when
|
||||
creating OpenGL contexts of version 2.1 and below. Where this extension is
|
||||
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
|
||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GL_TRUE` will cause @ref
|
||||
glfwCreateWindow to fail.
|
||||
|
||||
GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
|
||||
context profiles. Where this extension is unavailable, setting the
|
||||
`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE`, or setting
|
||||
`GLFW_CLIENT_API` to anything but `GLFW_OPENGL_API` will cause @ref
|
||||
glfwCreateWindow to fail.
|
||||
|
||||
GLFW uses the `GLX_ARB_context_flush_control` extension to provide control over
|
||||
whether a context is flushed when it is released (made non-current). Where this
|
||||
extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
|
||||
effect and the context will always be flushed when released.
|
||||
|
||||
@section compat_wgl WGL extensions
|
||||
|
||||
The WGL API is used to create OpenGL contexts on Microsoft Windows and other
|
||||
implementations of the Win32 API, such as Wine.
|
||||
|
||||
GLFW uses either the `WGL_EXT_extension_string` or the
|
||||
`WGL_ARB_extension_string` extension to check for the presence of all other WGL
|
||||
extensions listed below. If both are available, the EXT one is preferred. If
|
||||
neither is available, no other extensions are used and many GLFW features
|
||||
related to context creation will have no effect or cause errors when used.
|
||||
|
||||
GLFW uses the `WGL_EXT_swap_control` extension to provide vertical retrace
|
||||
synchronization (or _vsync_). Where this extension is unavailable, calling @ref
|
||||
glfwSwapInterval will have no effect.
|
||||
|
||||
GLFW uses the `WGL_ARB_pixel_format` and `WGL_ARB_multisample` extensions to
|
||||
create contexts with multisampling anti-aliasing. Where these extensions are
|
||||
unavailable, the `GLFW_SAMPLES` hint will have no effect.
|
||||
|
||||
GLFW uses the `WGL_ARB_create_context` extension when available, even when
|
||||
creating OpenGL contexts of version 2.1 and below. Where this extension is
|
||||
unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
|
||||
hints will only be partially supported, the `GLFW_OPENGL_DEBUG_CONTEXT` hint
|
||||
will have no effect, and setting the `GLFW_OPENGL_PROFILE` or
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` hints to `GL_TRUE` will cause @ref
|
||||
glfwCreateWindow to fail.
|
||||
|
||||
GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
|
||||
context profiles. Where this extension is unavailable, setting the
|
||||
`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE` will cause
|
||||
@ref glfwCreateWindow to fail.
|
||||
|
||||
GLFW uses the `WGL_ARB_context_flush_control` extension to provide control over
|
||||
whether a context is flushed when it is released (made non-current). Where this
|
||||
extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
|
||||
effect and the context will always be flushed when released.
|
||||
|
||||
@section compat_osx OpenGL 3.2 and later on OS X
|
||||
|
||||
Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then
|
||||
only forward-compatible, core profile contexts are supported. Support for
|
||||
OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible,
|
||||
core profile contexts. There is also still no mechanism for requesting debug
|
||||
contexts. Versions of Mac OS X earlier than 10.7 support at most OpenGL
|
||||
version 2.1.
|
||||
|
||||
Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||
`GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if
|
||||
given version 3.0 or 3.1, the `GLFW_OPENGL_FORWARD_COMPAT` hint must be set to
|
||||
`GL_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to
|
||||
`GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts and the
|
||||
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
|
||||
|
||||
Also, on Mac OS X 10.6 and below, the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||
`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1,
|
||||
setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to
|
||||
a non-default value will cause @ref glfwCreateWindow to fail and the
|
||||
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
|
||||
|
||||
*/
|
315
examples/common/glfw/docs/compile.dox
Normal file
315
examples/common/glfw/docs/compile.dox
Normal file
|
@ -0,0 +1,315 @@
|
|||
/*!
|
||||
|
||||
@page compile Compiling GLFW
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This is about compiling the GLFW library itself. For information on how to
|
||||
build applications that use GLFW, see the @ref build guide.
|
||||
|
||||
|
||||
@section compile_cmake Using CMake
|
||||
|
||||
GLFW uses [CMake](http://www.cmake.org/) to generate project files or makefiles
|
||||
for a particular development environment. If you are on a Unix-like system such
|
||||
as Linux or FreeBSD or have a package system like Fink, MacPorts, Cygwin or
|
||||
Homebrew, you can simply install its CMake package. If not, you can download
|
||||
installers for Windows and OS X from the [CMake website](http://www.cmake.org/).
|
||||
|
||||
@note CMake only generates project files or makefiles. It does not compile the
|
||||
actual GLFW library. To compile GLFW, first generate these files and then use
|
||||
them in your chosen development environment to compile the actual GLFW library.
|
||||
|
||||
|
||||
@subsection compile_deps Dependencies
|
||||
|
||||
Once you have installed CMake, make sure that all other dependencies are
|
||||
available. On some platforms, GLFW needs a few additional packages to be
|
||||
installed. See the section for your chosen platform and development environment
|
||||
below.
|
||||
|
||||
|
||||
@subsubsection compile_deps_msvc Dependencies for Visual C++ on Windows
|
||||
|
||||
The Microsoft Platform SDK that is installed along with Visual C++ already
|
||||
contains all the necessary headers, link libraries and tools except for CMake.
|
||||
Move on to @ref compile_generate.
|
||||
|
||||
|
||||
@subsubsection compile_deps_mingw Dependencies for MinGW or MinGW-w64 on Windows
|
||||
|
||||
Both the MinGW and the MinGW-w64 packages already contain all the necessary
|
||||
headers, link libraries and tools except for CMake. Move on to @ref
|
||||
compile_generate.
|
||||
|
||||
|
||||
@subsubsection compile_deps_mingw_cross Dependencies for MinGW or MinGW-w64 cross-compilation
|
||||
|
||||
Both Cygwin and many Linux distributions have MinGW or MinGW-w64 packages. For
|
||||
example, Cygwin has the `mingw64-i686-gcc` and `mingw64-x86_64-gcc` packages
|
||||
for 32- and 64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives
|
||||
like Ubuntu have the `mingw-w64` package for both.
|
||||
|
||||
GLFW has CMake toolchain files in the `CMake/` directory that allow for easy
|
||||
cross-compilation of Windows binaries. To use these files you need to add a
|
||||
special parameter when generating the project files or makefiles:
|
||||
|
||||
@code{.sh}
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file> .
|
||||
@endcode
|
||||
|
||||
The exact toolchain file to use depends on the prefix used by the MinGW or
|
||||
MinGW-w64 binaries on your system. You can usually see this in the /usr
|
||||
directory. For example, both the Debian/Ubuntu and Cygwin MinGW-w64 packages
|
||||
have `/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct
|
||||
invocation would be:
|
||||
|
||||
@code{.sh}
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake .
|
||||
@endcode
|
||||
|
||||
For more details see the article
|
||||
[CMake Cross Compiling](http://www.paraview.org/Wiki/CMake_Cross_Compiling) on
|
||||
the CMake wiki.
|
||||
|
||||
Once you have this set up, move on to @ref compile_generate.
|
||||
|
||||
|
||||
@subsubsection compile_deps_xcode Dependencies for Xcode on OS X
|
||||
|
||||
Xcode comes with all necessary tools except for CMake. The required headers
|
||||
and libraries are included in the core OS X frameworks. Xcode can be downloaded
|
||||
from the Mac App Store or from the ADC Member Center.
|
||||
|
||||
Once you have Xcode installed, move on to @ref compile_generate.
|
||||
|
||||
|
||||
@subsubsection compile_deps_x11 Dependencies for Linux and X11
|
||||
|
||||
To compile GLFW for X11, you need to have the X11 and OpenGL header packages
|
||||
installed, as well as the basic development tools like GCC and make. For
|
||||
example, on Ubuntu and other distributions based on Debian GNU/Linux, you need
|
||||
to install the `xorg-dev` and `libglu1-mesa-dev` packages. The former pulls in
|
||||
all X.org header packages and the latter pulls in the Mesa OpenGL and GLU
|
||||
packages. GLFW itself doesn't need or use GLU, but some of the examples do.
|
||||
Note that using header files and libraries from Mesa during compilation
|
||||
_will not_ tie your binaries to the Mesa implementation of OpenGL.
|
||||
|
||||
Once you have installed the necessary packages, move on to @ref
|
||||
compile_generate.
|
||||
|
||||
|
||||
@subsection compile_generate Generating build files with CMake
|
||||
|
||||
Once you have all necessary dependencies it is time to generate the project
|
||||
files or makefiles for your development environment. CMake needs to know two
|
||||
paths for this: the path to the _root_ directory of the GLFW source tree (i.e.
|
||||
_not_ the `src` subdirectory) and the target path for the generated files and
|
||||
compiled binaries. If these are the same, it is called an in-tree build,
|
||||
otherwise it is called an out-of-tree build.
|
||||
|
||||
One of several advantages of out-of-tree builds is that you can generate files
|
||||
and compile for different development environments using a single source tree.
|
||||
|
||||
@note This section is about generating the project files or makefiles necessary
|
||||
to compile the GLFW library, not about compiling the actual library.
|
||||
|
||||
|
||||
@subsubsection compile_generate_cli Generating files with the CMake command-line tool
|
||||
|
||||
To make an in-tree build, enter the _root_ directory of the GLFW source tree
|
||||
(i.e. _not_ the `src` subdirectory) and run CMake. The current directory is
|
||||
used as target path, while the path provided as an argument is used to find the
|
||||
source tree.
|
||||
|
||||
@code{.sh}
|
||||
cd <glfw-root-dir>
|
||||
cmake .
|
||||
@endcode
|
||||
|
||||
To make an out-of-tree build, make another directory, enter it and run CMake
|
||||
with the (relative or absolute) path to the root of the source tree as an
|
||||
argument.
|
||||
|
||||
@code{.sh}
|
||||
cd <glfw-root-dir>
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
@endcode
|
||||
|
||||
Once you have generated the project files or makefiles for your chosen
|
||||
development environment, move on to @ref compile_compile.
|
||||
|
||||
|
||||
@subsubsection compile_generate_gui Generating files with the CMake GUI
|
||||
|
||||
If you are using the GUI version, choose the root of the GLFW source tree as
|
||||
source location and the same directory or another, empty directory as the
|
||||
destination for binaries. Choose _Configure_, change any options you wish to,
|
||||
_Configure_ again to let the changes take effect and then _Generate_.
|
||||
|
||||
Once you have generated the project files or makefiles for your chosen
|
||||
development environment, move on to @ref compile_compile.
|
||||
|
||||
|
||||
@subsection compile_compile Compiling the library
|
||||
|
||||
You should now have all required dependencies and the project files or makefiles
|
||||
necessary to compile GLFW. Go ahead and compile the actual GLFW library with
|
||||
these files, as you would with any other project.
|
||||
|
||||
Once the GLFW library is compiled, you are ready to build your applications,
|
||||
linking it to the GLFW library. See the @ref build guide for more information.
|
||||
|
||||
|
||||
@subsection compile_options CMake options
|
||||
|
||||
The CMake files for GLFW provide a number of options, although not all are
|
||||
available on all supported platforms. Some of these are de facto standards
|
||||
among projects using CMake and so have no `GLFW_` prefix.
|
||||
|
||||
If you are using the GUI version of CMake, these are listed and can be changed
|
||||
from there. If you are using the command-line version, use the `ccmake` tool.
|
||||
Some package systems like Ubuntu and other distributions based on Debian
|
||||
GNU/Linux have this tool in a separate `cmake-curses-gui` package.
|
||||
|
||||
|
||||
@subsubsection compile_options_shared Shared CMake options
|
||||
|
||||
`BUILD_SHARED_LIBS` determines whether GLFW is built as a static
|
||||
library or as a DLL / shared library / dynamic library.
|
||||
|
||||
`LIB_SUFFIX` affects where the GLFW shared /dynamic library is installed. If it
|
||||
is empty, it is installed to `${CMAKE_INSTALL_PREFIX}/lib`. If it is set to
|
||||
`64`, it is installed to `${CMAKE_INSTALL_PREFIX}/lib64`.
|
||||
|
||||
`GLFW_CLIENT_LIBRARY` determines which client API library to use. If set to
|
||||
`opengl` the OpenGL library is used, if set to `glesv1` for the OpenGL ES 1.x
|
||||
library is used, or if set to `glesv2` the OpenGL ES 2.0 library is used. The
|
||||
selected library and its header files must be present on the system for this to
|
||||
work.
|
||||
|
||||
`GLFW_BUILD_EXAMPLES` determines whether the GLFW examples are built
|
||||
along with the library.
|
||||
|
||||
`GLFW_BUILD_TESTS` determines whether the GLFW test programs are
|
||||
built along with the library.
|
||||
|
||||
`GLFW_BUILD_DOCS` determines whether the GLFW documentation is built along with
|
||||
the library.
|
||||
|
||||
|
||||
@subsubsection compile_options_osx OS X specific CMake options
|
||||
|
||||
`GLFW_USE_CHDIR` determines whether `glfwInit` changes the current
|
||||
directory of bundled applications to the `Contents/Resources` directory.
|
||||
|
||||
`GLFW_USE_MENUBAR` determines whether the first call to
|
||||
`glfwCreateWindow` sets up a minimal menu bar.
|
||||
|
||||
`GLFW_USE_RETINA` determines whether windows will use the full resolution of
|
||||
Retina displays.
|
||||
|
||||
`GLFW_BUILD_UNIVERSAL` determines whether to build Universal Binaries.
|
||||
|
||||
|
||||
@subsubsection compile_options_win32 Windows specific CMake options
|
||||
|
||||
`USE_MSVC_RUNTIME_LIBRARY_DLL` determines whether to use the DLL version or the
|
||||
static library version of the Visual C++ runtime library. If set to `ON`, the
|
||||
DLL version of the Visual C++ library is used. It is recommended to set this to
|
||||
`ON`, as this keeps the executable smaller and benefits from security and bug
|
||||
fix updates of the Visual C++ runtime.
|
||||
|
||||
`GLFW_USE_DWM_SWAP_INTERVAL` determines whether the swap interval is set even
|
||||
when DWM compositing is enabled. If this is `ON`, the swap interval is set even
|
||||
if DWM is enabled. It is recommended to set this to `OFF`, as doing otherwise
|
||||
can lead to severe jitter.
|
||||
|
||||
`GLFW_USE_OPTIMUS_HPG` determines whether to export the `NvOptimusEnablement`
|
||||
symbol, which forces the use of the high-performance GPU on Nvidia Optimus
|
||||
systems. This symbol needs to be exported by the EXE to be detected by the
|
||||
driver, so the override will not work if GLFW is built as a DLL. See _Enabling
|
||||
High Performance Graphics Rendering on Optimus Systems_ for more details.
|
||||
|
||||
|
||||
@subsubsection compile_options_egl EGL specific CMake options
|
||||
|
||||
`GLFW_USE_EGL` determines whether to use EGL instead of the platform-specific
|
||||
context creation API. Note that EGL is not yet provided on all supported
|
||||
platforms.
|
||||
|
||||
|
||||
@section compile_manual Compiling GLFW manually
|
||||
|
||||
If you wish to compile GLFW without its CMake build environment then you will
|
||||
have to do at least some of the platform detection yourself. GLFW needs
|
||||
a number of configuration macros to be defined in order to know what it's being
|
||||
compiled for and has many optional, platform-specific ones for various features.
|
||||
|
||||
When building with CMake, the `glfw_config.h` configuration header is generated
|
||||
based on the current platform and CMake options. The GLFW CMake environment
|
||||
defines `_GLFW_USE_CONFIG_H`, which causes this header to be included by
|
||||
`internal.h`. Without this macro, GLFW will expect the necessary configuration
|
||||
macros to be defined on the command-line.
|
||||
|
||||
Three macros _must_ be defined when compiling GLFW: one selecting the window
|
||||
creation API, one selecting the context creation API and one client library.
|
||||
Exactly one of each kind must be defined for GLFW to compile and link.
|
||||
|
||||
The window creation API is used to create windows, handle input, monitors, gamma
|
||||
ramps and clipboard. The options are:
|
||||
|
||||
- `_GLFW_COCOA` to use the Cocoa frameworks
|
||||
- `_GLFW_WIN32` to use the Win32 API
|
||||
- `_GLFW_X11` to use the X Window System
|
||||
- `_GLFW_WAYLAND` to use the Wayland API (experimental and incomplete)
|
||||
- `_GLFW_MIR` to use the Mir API (experimental and incomplete)
|
||||
|
||||
The context creation API is used to enumerate pixel formats / framebuffer
|
||||
configurations and to create contexts. The options are:
|
||||
|
||||
- `_GLFW_NSGL` to use the Cocoa OpenGL framework
|
||||
- `_GLFW_WGL` to use the Win32 WGL API
|
||||
- `_GLFW_GLX` to use the X11 GLX API
|
||||
- `_GLFW_EGL` to use the EGL API
|
||||
|
||||
Wayland and Mir both require the EGL backend.
|
||||
|
||||
The client library is the one providing the OpenGL or OpenGL ES API, which is
|
||||
used by GLFW to probe the created context. This is not the same thing as the
|
||||
client API, as many desktop OpenGL client libraries now expose the OpenGL ES API
|
||||
through extensions. The options are:
|
||||
|
||||
- `_GLFW_USE_OPENGL` for the desktop OpenGL (opengl32.dll, libGL.so or
|
||||
OpenGL.framework)
|
||||
- `_GLFW_USE_GLESV1` for OpenGL ES 1.x (experimental)
|
||||
- `_GLFW_USE_GLESV2` for OpenGL ES 2.x (experimental)
|
||||
|
||||
Note that `_GLFW_USE_GLESV1` and `_GLFW_USE_GLESV2` may only be used with EGL,
|
||||
as the other context creation APIs do not interface with OpenGL ES client
|
||||
libraries.
|
||||
|
||||
If you are building GLFW as a shared library / dynamic library / DLL then you
|
||||
must also define `_GLFW_BUILD_DLL`. Otherwise, you may not define it.
|
||||
|
||||
If you are using the X11 window creation API then you _must_ also select an entry
|
||||
point retrieval mechanism.
|
||||
|
||||
- `_GLFW_HAS_GLXGETPROCADDRESS` to use `glXGetProcAddress` (recommended)
|
||||
- `_GLFW_HAS_GLXGETPROCADDRESSARB` to use `glXGetProcAddressARB` (legacy)
|
||||
- `_GLFW_HAS_GLXGETPROCADDRESSEXT` to use `glXGetProcAddressEXT` (legacy)
|
||||
- `_GLFW_HAS_DLOPEN` to do manual retrieval with `dlopen` (fallback)
|
||||
|
||||
If you are using the Cocoa window creation API, the following options are
|
||||
available:
|
||||
|
||||
- `_GLFW_USE_CHDIR` to `chdir` to the `Resources` subdirectory of the
|
||||
application bundle during @ref glfwInit (recommended)
|
||||
- `_GLFW_USE_MENUBAR` to create and populate the menu bar when the first window
|
||||
is created (recommended)
|
||||
- `_GLFW_USE_RETINA` to have windows use the full resolution of Retina displays
|
||||
(recommended)
|
||||
|
||||
*/
|
329
examples/common/glfw/docs/context.dox
Normal file
329
examples/common/glfw/docs/context.dox
Normal file
|
@ -0,0 +1,329 @@
|
|||
/*!
|
||||
|
||||
@page context Context guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the OpenGL and OpenGL ES context related functions of
|
||||
GLFW. There are also guides for the other areas of the GLFW API.
|
||||
|
||||
- @ref intro
|
||||
- @ref window
|
||||
- @ref monitor
|
||||
- @ref input
|
||||
|
||||
|
||||
@section context_object Context objects
|
||||
|
||||
A window object encapsulates both a top-level window and an OpenGL or OpenGL ES
|
||||
context. It is created with @ref glfwCreateWindow and destroyed with @ref
|
||||
glfwDestroyWindow or @ref glfwTerminate. See @ref window_creation for more
|
||||
information.
|
||||
|
||||
As the window and context are inseparably linked, the window object also serves
|
||||
as the context handle.
|
||||
|
||||
To test the creation of various kinds of contexts and see their properties, run
|
||||
the `glfwinfo` test program.
|
||||
|
||||
|
||||
@subsection context_hints Context creation hints
|
||||
|
||||
There are a number of hints, specified using @ref glfwWindowHint, related to
|
||||
what kind of context is created. See
|
||||
[context related hints](@ref window_hints_ctx) in the window guide.
|
||||
|
||||
|
||||
@subsection context_sharing Context object sharing
|
||||
|
||||
When creating a window and its OpenGL or OpenGL ES context with @ref
|
||||
glfwCreateWindow, you can specify another window whose context the new one
|
||||
should share its objects (textures, vertex and element buffers, etc.) with.
|
||||
|
||||
@code
|
||||
GLFWwindow* second_window = glfwCreateWindow(640, 480, "Second Window", NULL, first_window);
|
||||
@endcode
|
||||
|
||||
Object sharing is implemented by the operating system and graphics driver. On
|
||||
platforms where it is possible to choose which types of objects are shared, GLFW
|
||||
requests that all types are shared.
|
||||
|
||||
See the relevant chapter of the [OpenGL](https://www.opengl.org/registry/) or
|
||||
[OpenGL ES](http://www.khronos.org/opengles/) reference documents for more
|
||||
information. The name and number of this chapter unfortunately varies between
|
||||
versions and APIs, but has at times been named _Shared Objects and Multiple
|
||||
Contexts_.
|
||||
|
||||
GLFW comes with a simple object sharing test program called `sharing`.
|
||||
|
||||
|
||||
@subsection context_offscreen Offscreen contexts
|
||||
|
||||
GLFW doesn't support creating contexts without an associated window. However,
|
||||
contexts with hidden windows can be created with the
|
||||
[GLFW_VISIBLE](@ref window_hints_wnd) window hint.
|
||||
|
||||
@code
|
||||
glfwWindowHint(GLFW_VISIBLE, GL_FALSE);
|
||||
|
||||
GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
|
||||
@endcode
|
||||
|
||||
The window never needs to be shown and its context can be used as a plain
|
||||
offscreen context. Depending on the window manager, the size of a hidden
|
||||
window's framebuffer may not be usable or modifiable, so framebuffer
|
||||
objects are recommended for rendering with such contexts.
|
||||
|
||||
__OS X:__ The first time a window is created the menu bar is populated with
|
||||
common commands like Hide, Quit and About. This is not desirable for example
|
||||
when writing a command-line only application. The menu bar setup can be
|
||||
disabled with a [compile-time option](@ref compile_options_osx).
|
||||
|
||||
|
||||
@section context_current Current context
|
||||
|
||||
Before you can make OpenGL or OpenGL ES calls, you need to have a current
|
||||
context of the correct type. A context can only be current for a single thread
|
||||
at a time, and a thread can only have a single context current at a time.
|
||||
|
||||
The context of a window is made current with @ref glfwMakeContextCurrent.
|
||||
|
||||
@code
|
||||
glfwMakeContextCurrent(window);
|
||||
@endcode
|
||||
|
||||
The window of the current context is returned by @ref glfwGetCurrentContext.
|
||||
|
||||
@code
|
||||
GLFWwindow* window = glfwGetCurrentContext();
|
||||
@endcode
|
||||
|
||||
The following GLFW functions require a context to be current. Calling any these
|
||||
functions without a current context will generate a @ref GLFW_NO_CURRENT_CONTEXT
|
||||
error.
|
||||
|
||||
- @ref glfwSwapInterval
|
||||
- @ref glfwExtensionSupported
|
||||
- @ref glfwGetProcAddress
|
||||
|
||||
|
||||
@section context_swap Buffer swapping
|
||||
|
||||
Buffer swapping is part of the window and framebuffer, not the context. See
|
||||
@ref buffer_swap.
|
||||
|
||||
|
||||
@section context_glext OpenGL and OpenGL ES extensions
|
||||
|
||||
One of the benefits of OpenGL and OpenGL ES are their extensibility.
|
||||
Hardware vendors may include extensions in their implementations that extend the
|
||||
API before that functionality is included in a new version of the OpenGL or
|
||||
OpenGL ES specification, and some extensions are never included and remain
|
||||
as extensions until they become obsolete.
|
||||
|
||||
An extension is defined by:
|
||||
|
||||
- An extension name (e.g. `GL_ARB_debug_output`)
|
||||
- New OpenGL tokens (e.g. `GL_DEBUG_SEVERITY_HIGH_ARB`)
|
||||
- New OpenGL functions (e.g. `glGetDebugMessageLogARB`)
|
||||
|
||||
Note the `ARB` affix, which stands for Architecture Review Board and is used
|
||||
for official extensions. The extension above was created by the ARB, but there
|
||||
are many different affixes, like `NV` for Nvidia and `AMD` for, well, AMD. Any
|
||||
group may also use the generic `EXT` affix. Lists of extensions, together with
|
||||
their specifications, can be found at the
|
||||
[OpenGL Registry](http://www.opengl.org/registry/) and
|
||||
[OpenGL ES Registry](https://www.khronos.org/registry/gles/).
|
||||
|
||||
|
||||
@subsection context_glext_auto Loading extension with a loader library
|
||||
|
||||
An extension loader library is the easiest and best way to access both OpenGL and
|
||||
OpenGL ES extensions and modern versions of the core OpenGL or OpenGL ES APIs.
|
||||
They will take care of all the details of declaring and loading everything you
|
||||
need. One such library is [glad](https://github.com/Dav1dde/glad) and there are
|
||||
several others.
|
||||
|
||||
The following example will use glad but all extension loader libraries work
|
||||
similarly.
|
||||
|
||||
First you need to generate the source files using the glad Python script. This
|
||||
example generates a loader for any version of OpenGL, which is the default for
|
||||
both GLFW and glad, but loaders for OpenGL ES, as well as loaders for specific
|
||||
API versions and extension sets can be generated. The generated files are
|
||||
written to the `output` directory.
|
||||
|
||||
@code{.sh}
|
||||
python main.py --generator c --no-loader --out-path output
|
||||
@endcode
|
||||
|
||||
The `--no-loader` option is added because GLFW already provides a function for
|
||||
loading OpenGL and OpenGL ES function pointers and glad can call this instead of
|
||||
having to implement its own. There are several other command-line options as
|
||||
well. See the glad documentation for details.
|
||||
|
||||
Add the generated `output/src/glad.c`, `output/include/glad/glad.h` and
|
||||
`output/include/KHR/khrplatform.h` files to your build. Then you need to
|
||||
include the glad header file, which will replace the OpenGL header of your
|
||||
development environment. By including the glad header before the GLFW header,
|
||||
it suppresses the development environment's OpenGL or OpenGL ES header.
|
||||
|
||||
@code
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
Finally you need to initialize glad once you have a suitable current context.
|
||||
|
||||
@code
|
||||
window = glfwCreateWindow(640, 480, "My Window", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||
@endcode
|
||||
|
||||
Once glad has been loaded, you have access to all OpenGL core and extension
|
||||
functions supported by both the context you created and the glad loader you
|
||||
generated and you are ready to start rendering.
|
||||
|
||||
You can specify a minimum required OpenGL or OpenGL ES version with
|
||||
[context hints](@ref window_hints_ctx). If your needs are more complex, you can
|
||||
check the actual OpenGL or OpenGL ES version with
|
||||
[context attributes](@ref window_attribs_ctx), or you can check whether
|
||||
a specific version is supported by the current context with the
|
||||
`GLAD_GL_VERSION_x_x` booleans.
|
||||
|
||||
@code
|
||||
if (GLAD_GL_VERSION_3_2)
|
||||
{
|
||||
// Call OpenGL 3.2+ specific code
|
||||
}
|
||||
@endcode
|
||||
|
||||
To check whether a specific extension is supported, use the `GLAD_GL_xxx`
|
||||
booleans.
|
||||
|
||||
@code
|
||||
if (GLAD_GL_ARB_debug_output)
|
||||
{
|
||||
// Use GL_ARB_debug_output
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection context_glext_manual Loading extensions manually
|
||||
|
||||
__Do not use this technique__ unless it is absolutely necessary. An
|
||||
[extension loader library](@ref context_glext_auto) will save you a ton of
|
||||
tedious, repetitive, error prone work.
|
||||
|
||||
To use a certain extension, you must first check whether the context supports
|
||||
that extension and then, if it introduces new functions, retrieve the pointers
|
||||
to those functions. GLFW provides @ref glfwExtensionSupported and @ref
|
||||
glfwGetProcAddress for manual loading of extensions and new API functions.
|
||||
|
||||
This section will demonstrate manual loading of OpenGL extensions. The loading
|
||||
of OpenGL ES extensions is identical except for the name of the extension header.
|
||||
|
||||
|
||||
@subsubsection context_glext_header The glext.h header
|
||||
|
||||
The `glext.h` extension header is a continually updated file that defines the
|
||||
interfaces for all OpenGL extensions. The latest version of this can always be
|
||||
found at the [OpenGL Registry](http://www.opengl.org/registry/). There are also
|
||||
extension headers for the various versions of OpenGL ES at the
|
||||
[OpenGL ES Registry](https://www.khronos.org/registry/gles/). It it strongly
|
||||
recommended that you use your own copy of the extension header, as the one
|
||||
included in your development environment may be several years out of date and
|
||||
may not include the extensions you wish to use.
|
||||
|
||||
The header defines function pointer types for all functions of all extensions it
|
||||
supports. These have names like `PFNGLGETDEBUGMESSAGELOGARBPROC` (for
|
||||
`glGetDebugMessageLogARB`), i.e. the name is made uppercase and `PFN` (pointer
|
||||
to function) and `PROC` (procedure) are added to the ends.
|
||||
|
||||
To include the extension header, define [GLFW_INCLUDE_GLEXT](@ref build_macros)
|
||||
before including the GLFW header.
|
||||
|
||||
@code
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
|
||||
@subsubsection context_glext_string Checking for extensions
|
||||
|
||||
A given machine may not actually support the extension (it may have older
|
||||
drivers or a graphics card that lacks the necessary hardware features), so it
|
||||
is necessary to check at run-time whether the context supports the extension.
|
||||
This is done with @ref glfwExtensionSupported.
|
||||
|
||||
@code
|
||||
if (glfwExtensionSupported("GL_ARB_debug_output"))
|
||||
{
|
||||
// The extension is supported by the current context
|
||||
}
|
||||
@endcode
|
||||
|
||||
The argument is a null terminated ASCII string with the extension name. If the
|
||||
extension is supported, @ref glfwExtensionSupported returns `GL_TRUE`, otherwise
|
||||
it returns `GL_FALSE`.
|
||||
|
||||
|
||||
@subsubsection context_glext_proc Fetching function pointers
|
||||
|
||||
Many extensions, though not all, require the use of new OpenGL functions.
|
||||
These functions often do not have entry points in the client API libraries of
|
||||
your operating system, making it necessary to fetch them at run time. You can
|
||||
retrieve pointers to these functions with @ref glfwGetProcAddress.
|
||||
|
||||
@code
|
||||
PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog = glfwGetProcAddress("glGetDebugMessageLogARB");
|
||||
@endcode
|
||||
|
||||
In general, you should avoid giving the function pointer variables the (exact)
|
||||
same name as the function, as this may confuse your linker. Instead, you can
|
||||
use a different prefix, like above, or some other naming scheme.
|
||||
|
||||
Now that all the pieces have been introduced, here is what they might look like
|
||||
when used together.
|
||||
|
||||
@code
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#define glGetDebugMessageLogARB pfnGetDebugMessageLog
|
||||
PFNGLGETDEBUGMESSAGELOGARBPROC pfnGetDebugMessageLog;
|
||||
|
||||
// Flag indicating whether the extension is supported
|
||||
int has_ARB_debug_output = 0;
|
||||
|
||||
void load_extensions(void)
|
||||
{
|
||||
if (glfwExtensionSupported("GL_ARB_debug_output"))
|
||||
{
|
||||
pfnGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGARBPROC) glfwGetProcAddress("glGetDebugMessageLogARB");
|
||||
if (pfnGetDebugMessageLog)
|
||||
{
|
||||
// Both the extension name and the function pointer are present
|
||||
has_ARB_debug_output = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void some_function(void)
|
||||
{
|
||||
if (has_ARB_debug_output)
|
||||
{
|
||||
// Now the extension function can be called as usual
|
||||
glGetDebugMessageLogARB(...);
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
*/
|
1
examples/common/glfw/docs/extra.css
Normal file
1
examples/common/glfw/docs/extra.css
Normal file
File diff suppressed because one or more lines are too long
370
examples/common/glfw/docs/extra.less
Normal file
370
examples/common/glfw/docs/extra.less
Normal file
|
@ -0,0 +1,370 @@
|
|||
// NOTE: Please use this file to perform modifications on default style sheets.
|
||||
//
|
||||
// You need to install a few Ruby gems to generate extra.css from this file:
|
||||
// gem install less therubyracer
|
||||
//
|
||||
// Run this command to regenerate extra.css after you're finished with changes:
|
||||
// lessc --compress extra.less > extra.css
|
||||
//
|
||||
// Alternatively you can use online services to regenerate extra.css.
|
||||
|
||||
|
||||
// Default text color for page contents
|
||||
@default-text-color: hsl(0,0%,30%);
|
||||
|
||||
// Page header, footer, table rows, inline codes and definition lists
|
||||
@header-footer-background-color: hsl(0,0%,95%);
|
||||
|
||||
// Page header, footer links and navigation bar background
|
||||
@header-footer-link-color: hsl(0,0%,40%);
|
||||
|
||||
// Doxygen navigation bar links
|
||||
@navbar-link-color: @header-footer-background-color;
|
||||
|
||||
// Page content background color
|
||||
@content-background-color: hsl(0,0%,100%);
|
||||
|
||||
// Bold, italic, h1, h2, ... and table of contents
|
||||
@heading-color: hsl(0,0%,10%);
|
||||
|
||||
// Function, enum and macro definition separator
|
||||
@def-separator-color: @header-footer-background-color;
|
||||
|
||||
// Base color hue
|
||||
@base-hue: 24;
|
||||
|
||||
// Default color used for links
|
||||
@default-link-color: hsl(@base-hue,100%,50%);
|
||||
|
||||
// Doxygen navigation bar active tab
|
||||
@tab-text-color: hsl(0,0%,100%);
|
||||
@tab-background-color1: @default-link-color;
|
||||
@tab-background-color2: lighten(spin(@tab-background-color1, 10), 10%);
|
||||
|
||||
// Table borders
|
||||
@default-border-color: @default-link-color;
|
||||
|
||||
// Table header
|
||||
@table-text-color: @tab-text-color;
|
||||
@table-background-color1: @tab-background-color1;
|
||||
@table-background-color2: @tab-background-color2;
|
||||
|
||||
// Table of contents, data structure index and prototypes
|
||||
@toc-background-color1: hsl(0,0%,90%);
|
||||
@toc-background-color2: lighten(@toc-background-color1, 5%);
|
||||
|
||||
// Function prototype parameters color
|
||||
@prototype-param-color: darken(@default-link-color, 25%);
|
||||
|
||||
// Message box color: note, pre, post and invariant
|
||||
@box-note-color: hsl(103,80%,85%);
|
||||
|
||||
// Message box color: warning and attention
|
||||
@box-warning-color: hsl(34,80%,85%);
|
||||
|
||||
// Message box color: deprecated and bug
|
||||
@box-bug-color: hsl(333,80%,85%);
|
||||
|
||||
// Message box color: todo and test
|
||||
@box-todo-color: hsl(200,80%,85%);
|
||||
|
||||
// Message box helper function
|
||||
.message-box(@base-color) {
|
||||
background:linear-gradient(to bottom,lighten(@base-color, 5%) 0%,@base-color 100%);
|
||||
box-shadow:inset 0 0 32px darken(@base-color, 5%);
|
||||
color:darken(@base-color, 67%);
|
||||
border:2px solid desaturate(darken(@base-color, 10%), 20%);
|
||||
}
|
||||
|
||||
|
||||
#navrow1,#navrow2,#navrow3,#navrow4,.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code {
|
||||
background:none;
|
||||
}
|
||||
|
||||
#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,hr,.memSeparator {
|
||||
border:none;
|
||||
}
|
||||
|
||||
.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a,.reflist dt a.el,.levels span,.directory .levels span {
|
||||
text-shadow:none;
|
||||
}
|
||||
|
||||
.memdoc,dl.reflist dd {
|
||||
box-shadow:none;
|
||||
}
|
||||
|
||||
div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code {
|
||||
padding:0;
|
||||
}
|
||||
|
||||
#nav-path,.directory .levels,span.lineno {
|
||||
display:none;
|
||||
}
|
||||
|
||||
html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code {
|
||||
background:@header-footer-background-color;
|
||||
}
|
||||
|
||||
body {
|
||||
color:@default-text-color;
|
||||
}
|
||||
|
||||
h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em {
|
||||
color:@heading-color;
|
||||
border-bottom:none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
padding-top:0.5em;
|
||||
font-size:180%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
padding-top:0.5em;
|
||||
margin-bottom:0;
|
||||
font-size:140%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
padding-top:0.5em;
|
||||
margin-bottom:0;
|
||||
font-size:110%;
|
||||
}
|
||||
|
||||
.glfwheader {
|
||||
font-size:16px;
|
||||
height:64px;
|
||||
max-width:920px;
|
||||
min-width:800px;
|
||||
padding:0 32px;
|
||||
margin:0 auto;
|
||||
}
|
||||
|
||||
#glfwhome {
|
||||
line-height:64px;
|
||||
padding-right:48px;
|
||||
color:@header-footer-link-color;
|
||||
font-size:2.5em;
|
||||
background:url("http://www.glfw.org/css/arrow.png") no-repeat right;
|
||||
}
|
||||
|
||||
.glfwnavbar {
|
||||
list-style-type:none;
|
||||
margin:0 auto;
|
||||
float:right;
|
||||
}
|
||||
|
||||
#glfwhome,.glfwnavbar li {
|
||||
float:left;
|
||||
}
|
||||
|
||||
.glfwnavbar a,.glfwnavbar a:visited {
|
||||
line-height:64px;
|
||||
margin-left:2em;
|
||||
display:block;
|
||||
color:@header-footer-link-color;
|
||||
}
|
||||
|
||||
#glfwhome,.glfwnavbar a,.glfwnavbar a:visited {
|
||||
transition:.35s ease;
|
||||
}
|
||||
|
||||
#titlearea,.footer {
|
||||
color:@header-footer-link-color;
|
||||
}
|
||||
|
||||
address.footer {
|
||||
text-align:center;
|
||||
padding:2em;
|
||||
margin-top:3em;
|
||||
}
|
||||
|
||||
#top {
|
||||
background:@header-footer-link-color;
|
||||
}
|
||||
|
||||
#navrow1,#navrow2,#navrow3,#navrow4 {
|
||||
max-width:920px;
|
||||
min-width:800px;
|
||||
margin:0 auto;
|
||||
font-size:13px;
|
||||
}
|
||||
|
||||
.tablist {
|
||||
height:36px;
|
||||
display:block;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
.tablist a,.tablist a:visited,.tablist a:hover,.tablist li,.tablist li.current a {
|
||||
color:@navbar-link-color;
|
||||
}
|
||||
|
||||
.tablist li.current a {
|
||||
background:linear-gradient(to bottom,@tab-background-color2 0%,@tab-background-color1 100%);
|
||||
box-shadow:inset 0 0 32px @tab-background-color1;
|
||||
text-shadow:0 -1px 1px darken(@tab-background-color1, 15%);
|
||||
color:@tab-text-color;
|
||||
}
|
||||
|
||||
.contents {
|
||||
min-height:590px;
|
||||
}
|
||||
|
||||
div.contents,div.header {
|
||||
max-width:920px;
|
||||
margin:0 auto;
|
||||
padding:0 32px;
|
||||
background:@content-background-color none;
|
||||
}
|
||||
|
||||
table.doxtable th,dl.reflist dt {
|
||||
background:linear-gradient(to bottom,@table-background-color2 0%,@table-background-color1 100%);
|
||||
box-shadow:inset 0 0 32px @table-background-color1;
|
||||
text-shadow:0 -1px 1px darken(@table-background-color1, 15%);
|
||||
color:@table-text-color;
|
||||
}
|
||||
|
||||
dl.reflist dt a.el {
|
||||
color:@default-link-color;
|
||||
padding:.2em;
|
||||
border-radius:4px;
|
||||
background-color:lighten(@default-link-color, 40%);
|
||||
}
|
||||
|
||||
div.toc {
|
||||
float:none;
|
||||
width:auto;
|
||||
}
|
||||
|
||||
div.toc h3 {
|
||||
font-size:1.17em;
|
||||
}
|
||||
|
||||
div.toc ul {
|
||||
padding-left:1.5em;
|
||||
}
|
||||
|
||||
div.toc li {
|
||||
font-size:1em;
|
||||
padding-left:0;
|
||||
list-style-type:disc;
|
||||
}
|
||||
|
||||
div.toc,.memproto,div.qindex,div.ah {
|
||||
background:linear-gradient(to bottom,@toc-background-color2 0%,@toc-background-color1 100%);
|
||||
box-shadow:inset 0 0 32px @toc-background-color1;
|
||||
text-shadow:0 1px 1px lighten(@toc-background-color2, 10%);
|
||||
color:@heading-color;
|
||||
border:2px solid @toc-background-color1;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
.paramname {
|
||||
color:@prototype-param-color;
|
||||
}
|
||||
|
||||
dl.reflist dt {
|
||||
border:2px solid @default-border-color;
|
||||
border-top-left-radius:4px;
|
||||
border-top-right-radius:4px;
|
||||
border-bottom:none;
|
||||
}
|
||||
|
||||
dl.reflist dd {
|
||||
border:2px solid @default-border-color;
|
||||
border-bottom-right-radius:4px;
|
||||
border-bottom-left-radius:4px;
|
||||
border-top:none;
|
||||
}
|
||||
|
||||
table.doxtable {
|
||||
border-collapse:inherit;
|
||||
border-spacing:0;
|
||||
border:2px solid @default-border-color;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,.tablist a:hover,span.lineno a:hover {
|
||||
color:@default-link-color;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
div.directory {
|
||||
border-collapse:inherit;
|
||||
border-spacing:0;
|
||||
border:2px solid @default-border-color;
|
||||
border-radius:4px;
|
||||
}
|
||||
|
||||
hr,.memSeparator {
|
||||
height:2px;
|
||||
background:linear-gradient(to right,@def-separator-color 0%,darken(@def-separator-color, 10%) 50%,@def-separator-color 100%);
|
||||
}
|
||||
|
||||
dl.note,dl.pre,dl.post,dl.invariant {
|
||||
.message-box(@box-note-color);
|
||||
}
|
||||
|
||||
dl.warning,dl.attention {
|
||||
.message-box(@box-warning-color);
|
||||
}
|
||||
|
||||
dl.deprecated,dl.bug {
|
||||
.message-box(@box-bug-color);
|
||||
}
|
||||
|
||||
dl.todo,dl.test {
|
||||
.message-box(@box-todo-color);
|
||||
}
|
||||
|
||||
dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test {
|
||||
border-radius:4px;
|
||||
padding:1em;
|
||||
text-shadow:0 1px 1px hsl(0,0%,100%);
|
||||
margin:1em 0;
|
||||
}
|
||||
|
||||
.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited {
|
||||
color:inherit;
|
||||
}
|
||||
|
||||
div.line {
|
||||
line-height:inherit;
|
||||
}
|
||||
|
||||
div.fragment,pre.fragment {
|
||||
background:hsl(0,0%,95%);
|
||||
border-radius:4px;
|
||||
border:none;
|
||||
padding:1em;
|
||||
overflow:auto;
|
||||
border-left:4px solid hsl(0,0%,80%);
|
||||
margin:1em 0;
|
||||
}
|
||||
|
||||
.lineno a,.lineno a:visited,.line,pre.fragment {
|
||||
color:@default-text-color;
|
||||
}
|
||||
|
||||
span.preprocessor,span.comment {
|
||||
color:hsl(193,100%,30%);
|
||||
}
|
||||
|
||||
a.code,a.code:visited {
|
||||
color:hsl(18,100%,45%);
|
||||
}
|
||||
|
||||
span.keyword,span.keywordtype,span.keywordflow {
|
||||
color:darken(@default-text-color, 5%);
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
span.stringliteral {
|
||||
color:hsl(261,100%,30%);
|
||||
}
|
||||
|
||||
code {
|
||||
padding:.1em;
|
||||
border-radius:4px;
|
||||
}
|
7
examples/common/glfw/docs/footer.html
Normal file
7
examples/common/glfw/docs/footer.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<address class="footer">
|
||||
<p>
|
||||
Last update on $date for $projectname $projectnumber
|
||||
</p>
|
||||
</address>
|
||||
</body>
|
||||
</html>
|
34
examples/common/glfw/docs/header.html
Normal file
34
examples/common/glfw/docs/header.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||
$treeview
|
||||
$search
|
||||
$mathjax
|
||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||
$extrastylesheet
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
<!--BEGIN TITLEAREA-->
|
||||
<div id="titlearea">
|
||||
<div class="glfwheader">
|
||||
<a href="http://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||
<ul class="glfwnavbar">
|
||||
<li><a href="http://www.glfw.org/documentation.html">Documentation</a></li>
|
||||
<li><a href="http://www.glfw.org/download.html">Download</a></li>
|
||||
<li><a href="http://www.glfw.org/media.html">Media</a></li>
|
||||
<li><a href="http://www.glfw.org/community.html">Community</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--END TITLEAREA-->
|
||||
<!-- end header part -->
|
588
examples/common/glfw/docs/input.dox
Normal file
588
examples/common/glfw/docs/input.dox
Normal file
|
@ -0,0 +1,588 @@
|
|||
/*!
|
||||
|
||||
@page input Input guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the input related functions of GLFW. There are also
|
||||
guides for the other areas of GLFW.
|
||||
|
||||
- @ref intro
|
||||
- @ref window
|
||||
- @ref context
|
||||
- @ref monitor
|
||||
|
||||
GLFW provides many kinds of input. While some can only be polled, like time, or
|
||||
only received via callbacks, like scrolling, there are those that provide both
|
||||
callbacks and polling. Where a callback is provided, that is the recommended
|
||||
way to receive that kind of input. The more you can use callbacks the less time
|
||||
your users' machines will need to spend polling.
|
||||
|
||||
All input callbacks receive a window handle. By using the
|
||||
[window user pointer](@ref window_userptr), you can access non-global structures
|
||||
or objects from your callbacks.
|
||||
|
||||
To get a better feel for how the various events callbacks behave, run the
|
||||
`events` test program. It register every callback supported by GLFW and prints
|
||||
out all arguments provided for every event, along with time and sequence
|
||||
information.
|
||||
|
||||
|
||||
@section events Event processing
|
||||
|
||||
GLFW needs to communicate regularly with the window system both in order to
|
||||
receive events and to show that the application hasn't locked up. Event
|
||||
processing must be done regularly while you have visible windows and is normally
|
||||
done each frame after [buffer swapping](@ref buffer_swap).
|
||||
|
||||
There are two functions for processing pending events. @ref glfwPollEvents,
|
||||
processes only those events that have already been received and then returns
|
||||
immediately.
|
||||
|
||||
@code
|
||||
glfwPollEvents();
|
||||
@endcode
|
||||
|
||||
This is the best choice when rendering continually, like most games do.
|
||||
|
||||
If you only need to update the contents of the window when you receive new
|
||||
input, @ref glfwWaitEvents is a better choice.
|
||||
|
||||
@code
|
||||
glfwWaitEvents();
|
||||
@endcode
|
||||
|
||||
It puts the thread to sleep until at least one event has been received and then
|
||||
processes all received events. This saves a great deal of CPU cycles and is
|
||||
useful for, for example, editing tools. There must be at least one GLFW window
|
||||
for this function to sleep.
|
||||
|
||||
If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from
|
||||
another thread by posting an empty event to the event queue with @ref
|
||||
glfwPostEmptyEvent.
|
||||
|
||||
@code
|
||||
glfwPostEmptyEvent();
|
||||
@endcode
|
||||
|
||||
Do not assume that callbacks will _only_ be called through either of the above
|
||||
functions. While it is necessary to process events in the event queue, some
|
||||
window systems will send some events directly to the application, which in turn
|
||||
causes callbacks to be called outside of regular event processing.
|
||||
|
||||
|
||||
@section input_keyboard Keyboard input
|
||||
|
||||
GLFW divides keyboard input into two categories; key events and character
|
||||
events. Key events relate to actual physical keyboard keys, whereas character
|
||||
events relate to the Unicode code points generated by pressing some of them.
|
||||
|
||||
Keys and characters do not map 1:1. A single key press may produce several
|
||||
characters, and a single character may require several keys to produce. This
|
||||
may not be the case on your machine, but your users are likely not all using the
|
||||
same keyboard layout, input method or even operating system as you.
|
||||
|
||||
|
||||
@subsection input_key Key input
|
||||
|
||||
If you wish to be notified when a physical key is pressed or released or when it
|
||||
repeats, set a key callback.
|
||||
|
||||
@code
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the [keyboard key](@ref keys), platform-specific
|
||||
scancode, key action and [modifier bits](@ref mods).
|
||||
|
||||
@code
|
||||
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_E && action == GLFW_PRESS)
|
||||
activate_airship();
|
||||
}
|
||||
@endcode
|
||||
|
||||
The action is one of `GLFW_PRESS`, `GLFW_REPEAT` or `GLFW_RELEASE`. The key
|
||||
will be `GLFW_KEY_UNKNOWN` if GLFW lacks a key token for it. These keys still
|
||||
have unique, if platform-specific scancodes.
|
||||
|
||||
The scancode is unique for every key but is platform-specific, so a scancode
|
||||
will map to different keys on different platforms.
|
||||
|
||||
The key will be `GLFW_KEY_UNKNOWN` for special keys like _E-mail_ or _Play_ that
|
||||
don't have a key token. Those keys will still have unique, if platform-specific
|
||||
scancodes.
|
||||
|
||||
Key states for [named keys](@ref keys) are also saved in per-window state arrays
|
||||
that can be polled with @ref glfwGetKey.
|
||||
|
||||
@code
|
||||
int state = glfwGetKey(window, GLFW_KEY_E);
|
||||
if (state == GLFW_PRESS)
|
||||
activate_airship();
|
||||
@endcode
|
||||
|
||||
The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
This function only returns cached key event state. It does not poll the
|
||||
system for the current state of the key.
|
||||
|
||||
Whenever you poll state, you risk missing the state change you are looking for.
|
||||
If a pressed key is released again before you poll its state, you will have
|
||||
missed the key press. The recommended solution for this is to use a
|
||||
key callback, but there is also the `GLFW_STICKY_KEYS` input mode.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_STICKY_KEYS, 1);
|
||||
@endcode
|
||||
|
||||
When sticky keys mode is enabled, the pollable state of a key will remain
|
||||
`GLFW_PRESS` until the state of that key is polled with @ref glfwGetKey. Once
|
||||
it has been polled, if a key release event had been processed in the meantime,
|
||||
the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`.
|
||||
|
||||
The `GLFW_KEY_LAST` constant holds the highest value of any
|
||||
[named key](@ref keys).
|
||||
|
||||
|
||||
@subsection input_char Text input
|
||||
|
||||
GLFW supports text input in the form of a stream of
|
||||
[Unicode code points](https://en.wikipedia.org/wiki/Unicode), as produced by the
|
||||
operating system text input system. Unlike key input, text input obeys keyboard
|
||||
layouts and modifier keys and supports composing characters using
|
||||
[dead keys](https://en.wikipedia.org/wiki/Dead_key). Once received, you can
|
||||
encode the code points into
|
||||
[UTF-8](https://en.wikipedia.org/wiki/UTF-8) or any other encoding you prefer.
|
||||
|
||||
Because an `unsigned int` is 32 bits long on all platforms supported by GLFW,
|
||||
you can treat the code point argument as native endian
|
||||
[UTF-32](https://en.wikipedia.org/wiki/UTF-32).
|
||||
|
||||
There are two callbacks for receiving Unicode code points. If you wish to
|
||||
offer regular text input, set a character callback.
|
||||
|
||||
@code
|
||||
glfwSetCharCallback(window, character_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives Unicode code points for key events that would
|
||||
have led to regular text input and generally behaves as a standard text field on
|
||||
that platform.
|
||||
|
||||
@code
|
||||
void character_callback(GLFWwindow* window, unsigned int codepoint)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
If you wish to receive even those Unicode code points generated with modifier
|
||||
key combinations that a plain text field would ignore, or just want to know
|
||||
exactly what modifier keys were used, set a character with modifiers callback.
|
||||
|
||||
@code
|
||||
glfwSetCharModsCallback(window, charmods_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives Unicode code points and
|
||||
[modifier bits](@ref mods).
|
||||
|
||||
@code
|
||||
void charmods_callback(GLFWwindow* window, unsigned int codepoint, int mods)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@section input_mouse Mouse input
|
||||
|
||||
Mouse input comes in many forms, including cursor motion, button presses and
|
||||
scrolling offsets. The cursor appearance can also be changed, either to
|
||||
a custom image or a standard cursor shape from the system theme.
|
||||
|
||||
|
||||
@subsection cursor_pos Cursor position
|
||||
|
||||
If you wish to be notified when the cursor moves over the window, set a cursor
|
||||
position callback.
|
||||
|
||||
@code
|
||||
glfwSetCursorPosCallback(window, cursor_pos_callback);
|
||||
@endcode
|
||||
|
||||
The callback functions receives the cursor position. On platforms that provide
|
||||
it, the full sub-pixel cursor position is passed on.
|
||||
|
||||
@code
|
||||
static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
The cursor position is also saved per-window and can be polled with @ref
|
||||
glfwGetCursorPos.
|
||||
|
||||
@code
|
||||
double xpos, ypos;
|
||||
glfwGetCursorPos(window, &xpos, &ypos);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection cursor_mode Cursor modes
|
||||
|
||||
The `GLFW_CURSOR` input mode provides several cursor modes for special forms of
|
||||
mouse motion input. By default, the cursor mode is `GLFW_CURSOR_NORMAL`,
|
||||
meaning the regular arrow cursor (or another cursor set with @ref glfwSetCursor)
|
||||
is used and cursor motion is not limited.
|
||||
|
||||
If you wish to implement mouse motion based camera controls or other input
|
||||
schemes that require unlimited mouse movement, set the cursor mode to
|
||||
`GLFW_CURSOR_DISABLED`.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||
@endcode
|
||||
|
||||
This will hide the cursor and lock it to the specified window. GLFW will then
|
||||
take care of all the details of cursor re-centering and offset calculation and
|
||||
providing the application with a virtual cursor position. This virtual position
|
||||
is provided normally via both the cursor position callback and through polling.
|
||||
|
||||
@note You should not implement your own version of this functionality using
|
||||
other features of GLFW. It is not supported and will not work as robustly as
|
||||
`GLFW_CURSOR_DISABLED`.
|
||||
|
||||
If you just wish the cursor to become hidden when it is over a window, set
|
||||
the cursor mode to `GLFW_CURSOR_HIDDEN`.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||
@endcode
|
||||
|
||||
This mode puts no limit on the motion of the cursor.
|
||||
|
||||
To exit out of either of these special modes, restore the `GLFW_CURSOR_NORMAL`
|
||||
cursor mode.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection cursor_object Cursor objects
|
||||
|
||||
GLFW supports creating both custom and system theme cursor images, encapsulated
|
||||
as @ref GLFWcursor objects. They are created with @ref glfwCreateCursor or @ref
|
||||
glfwCreateStandardCursor and destroyed with @ref glfwDestroyCursor, or @ref
|
||||
glfwTerminate, if any remain.
|
||||
|
||||
|
||||
@subsubsection cursor_custom Custom cursor creation
|
||||
|
||||
A custom cursor is created with @ref glfwCreateCursor, which returns a handle to
|
||||
the created cursor object. For example, this creates a 16x16 white square
|
||||
cursor with the hot-spot in the upper-left corner:
|
||||
|
||||
@code
|
||||
unsigned char pixels[16 * 16 * 4];
|
||||
memset(pixels, 0xff, sizeof(pixels));
|
||||
|
||||
GLFWimage image;
|
||||
image.width = 16;
|
||||
image.height = 16;
|
||||
image.pixels = pixels;
|
||||
|
||||
GLFWcursor* cursor = glfwCreateCursor(&image, 0, 0);
|
||||
@endcode
|
||||
|
||||
If cursor creation fails, `NULL` will be returned, so it is necessary to check
|
||||
the return value.
|
||||
|
||||
The image data is 32-bit RGBA, i.e. eight bits per channel. The pixels are
|
||||
arranged canonically as sequential rows, starting from the top-left corner.
|
||||
|
||||
|
||||
@subsubsection cursor_standard Standard cursor creation
|
||||
|
||||
A cursor with a [standard shape](@ref shapes) from the current system cursor
|
||||
theme can be can be created with @ref glfwCreateStandardCursor.
|
||||
|
||||
@code
|
||||
GLFWcursor* cursor = glfwCreateStandardCursor(GLFW_HRESIZE_CURSOR);
|
||||
@endcode
|
||||
|
||||
These cursor objects behave in the exact same way as those created with @ref
|
||||
glfwCreateCursor except that the system cursor theme provides the actual image.
|
||||
|
||||
|
||||
@subsubsection cursor_destruction Cursor destruction
|
||||
|
||||
When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor.
|
||||
|
||||
@code
|
||||
glfwDestroyCursor(cursor);
|
||||
@endcode
|
||||
|
||||
Cursor destruction always succeeds. All cursors remaining when @ref
|
||||
glfwTerminate is called are destroyed as well.
|
||||
|
||||
|
||||
@subsubsection cursor_set Cursor setting
|
||||
|
||||
A cursor can be set as current for a window with @ref glfwSetCursor.
|
||||
|
||||
@code
|
||||
glfwSetCursor(window, cursor);
|
||||
@endcode
|
||||
|
||||
Once set, the cursor image will be used as long as the system cursor is over the
|
||||
client area of the window and the [cursor mode](@ref cursor_mode) is set
|
||||
to `GLFW_CURSOR_NORMAL`.
|
||||
|
||||
A single cursor may be set for any number of windows.
|
||||
|
||||
To remove a cursor from a window, set the cursor of that window to `NULL`.
|
||||
|
||||
@code
|
||||
glfwSetCursor(window, NULL);
|
||||
@endcode
|
||||
|
||||
When a cursor is destroyed, it is removed from any window where it is set. This
|
||||
does not affect the cursor modes of those windows.
|
||||
|
||||
|
||||
@subsection cursor_enter Cursor enter/leave events
|
||||
|
||||
If you wish to be notified when the cursor enters or leaves the client area of
|
||||
a window, set a cursor enter/leave callback.
|
||||
|
||||
@code
|
||||
glfwSetCursorEnterCallback(window, cursor_enter_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the new classification of the cursor.
|
||||
|
||||
@code
|
||||
void cursor_enter_callback(GLFWwindow* window, int entered)
|
||||
{
|
||||
if (entered)
|
||||
{
|
||||
// The cursor entered the client area of the window
|
||||
}
|
||||
else
|
||||
{
|
||||
// The cursor left the client area of the window
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection input_mouse_button Mouse button input
|
||||
|
||||
If you wish to be notified when a mouse button is pressed or released, set
|
||||
a mouse button callback.
|
||||
|
||||
@code
|
||||
glfwSetMouseButtonCallback(window, mouse_button_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the [mouse button](@ref buttons), button action
|
||||
and [modifier bits](@ref mods).
|
||||
|
||||
@code
|
||||
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS)
|
||||
popup_menu();
|
||||
}
|
||||
@endcode
|
||||
|
||||
The action is one of `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
Mouse button states for [named buttons](@ref buttons) are also saved in
|
||||
per-window state arrays that can be polled with @ref glfwGetMouseButton.
|
||||
|
||||
@code
|
||||
int state = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT);
|
||||
if (state == GLFW_PRESS)
|
||||
upgrade_cow();
|
||||
@endcode
|
||||
|
||||
The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
This function only returns cached mouse button event state. It does not poll
|
||||
the system for the current state of the mouse button.
|
||||
|
||||
Whenever you poll state, you risk missing the state change you are looking for.
|
||||
If a pressed mouse button is released again before you poll its state, you will have
|
||||
missed the button press. The recommended solution for this is to use a
|
||||
mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS`
|
||||
input mode.
|
||||
|
||||
@code
|
||||
glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, 1);
|
||||
@endcode
|
||||
|
||||
When sticky mouse buttons mode is enabled, the pollable state of a mouse button
|
||||
will remain `GLFW_PRESS` until the state of that button is polled with @ref
|
||||
glfwGetMouseButton. Once it has been polled, if a mouse button release event
|
||||
had been processed in the meantime, the state will reset to `GLFW_RELEASE`,
|
||||
otherwise it will remain `GLFW_PRESS`.
|
||||
|
||||
The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any
|
||||
[named button](@ref buttons).
|
||||
|
||||
|
||||
@subsection scrolling Scroll input
|
||||
|
||||
If you wish to be notified when the user scrolls, whether with a mouse wheel or
|
||||
touchpad gesture, set a scroll callback.
|
||||
|
||||
@code
|
||||
glfwSetScrollCallback(window, scroll_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives two-dimensional scroll offsets.
|
||||
|
||||
@code
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
A simple mouse wheel, being vertical, provides offsets along the Y-axis.
|
||||
|
||||
|
||||
@section joystick Joystick input
|
||||
|
||||
The joystick functions expose connected joysticks and controllers, with both
|
||||
referred to as joysticks. It supports up to sixteen joysticks, ranging from
|
||||
`GLFW_JOYSTICK_1`, `GLFW_JOYSTICK_2` up to `GLFW_JOYSTICK_LAST`. You can test
|
||||
whether a [joystick](@ref joysticks) is present with @ref glfwJoystickPresent.
|
||||
|
||||
@code
|
||||
int present = glfwJoystickPresent(GLFW_JOYSTICK_1);
|
||||
@endcode
|
||||
|
||||
When GLFW is initialized, detected joysticks are added to to the beginning of
|
||||
the array, starting with `GLFW_JOYSTICK_1`. Once a joystick is detected, it
|
||||
keeps its assigned index until it is disconnected, so as joysticks are connected
|
||||
and disconnected, they will become spread out.
|
||||
|
||||
Joystick state is updated as needed when a joystick function is called and does
|
||||
not require a window to be created or @ref glfwPollEvents or @ref glfwWaitEvents
|
||||
to be called.
|
||||
|
||||
|
||||
@subsection joystick_axis Joystick axis states
|
||||
|
||||
The positions of all axes of a joystick are returned by @ref
|
||||
glfwGetJoystickAxes. See the reference documentation for the lifetime of the
|
||||
returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_1, &count);
|
||||
@endcode
|
||||
|
||||
Each element in the returned array is a value between -1.0 and 1.0.
|
||||
|
||||
|
||||
@subsection joystick_button Joystick button states
|
||||
|
||||
The states of all buttons of a joystick are returned by @ref
|
||||
glfwGetJoystickButtons. See the reference documentation for the lifetime of the
|
||||
returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
const unsigned char* axes = glfwGetJoystickButtons(GLFW_JOYSTICK_1, &count);
|
||||
@endcode
|
||||
|
||||
Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`.
|
||||
|
||||
|
||||
@subsection joystick_name Joystick name
|
||||
|
||||
The human-readable, UTF-8 encoded name of a joystick is returned by @ref
|
||||
glfwGetJoystickName. See the reference documentation for the lifetime of the
|
||||
returned string.
|
||||
|
||||
@code
|
||||
const char* name = glfwGetJoystickName(GLFW_JOYSTICK_1);
|
||||
@endcode
|
||||
|
||||
Joystick names are not guaranteed to be unique. Two joysticks of the same model
|
||||
and make may have the same name. Only the [joystick token](@ref joysticks) is
|
||||
guaranteed to be unique, and only until that joystick is disconnected.
|
||||
|
||||
|
||||
@section time Time input
|
||||
|
||||
GLFW provides high-resolution time input, in seconds, with @ref glfwGetTime.
|
||||
|
||||
@code
|
||||
double seconds = glfwGetTime();
|
||||
@endcode
|
||||
|
||||
It returns the number of seconds since the timer was started when the library
|
||||
was initialized with @ref glfwInit. The platform-specific time sources used
|
||||
usually have micro- or nanosecond resolution.
|
||||
|
||||
You can modify the reference time with @ref glfwSetTime.
|
||||
|
||||
@code
|
||||
glfwSetTime(4.0);
|
||||
@endcode
|
||||
|
||||
This sets the timer to the specified time, in seconds.
|
||||
|
||||
|
||||
@section clipboard Clipboard input and output
|
||||
|
||||
If the system clipboard contains a UTF-8 encoded string or if it can be
|
||||
converted to one, you can retrieve it with @ref glfwGetClipboardString. See the
|
||||
reference documentation for the lifetime of the returned string.
|
||||
|
||||
@code
|
||||
const char* clipboard = glfwGetClipboardString(window);
|
||||
@endcode
|
||||
|
||||
The contents of the system clipboard can be set to a UTF-8 encoded string with
|
||||
@ref glfwSetClipboardString.
|
||||
|
||||
@code
|
||||
glfwSetClipboardString(window, "A string with words in it");
|
||||
@endcode
|
||||
|
||||
The clipboard functions take a window handle argument because some window
|
||||
systems require a window to communicate with the system clipboard. Any valid
|
||||
window may be used.
|
||||
|
||||
|
||||
@section path_drop Path drop input
|
||||
|
||||
If you wish to receive the paths of files and/or directories dropped on
|
||||
a window, set a file drop callback.
|
||||
|
||||
@code
|
||||
glfwSetDropCallback(window, drop_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives an array of paths encoded as UTF-8.
|
||||
|
||||
@code
|
||||
void drop_callback(GLFWwindow* window, int count, const char** paths)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < count; i++)
|
||||
handle_dropped_file(paths[i]);
|
||||
}
|
||||
@endcode
|
||||
|
||||
The path array and its strings are only valid until the file drop callback
|
||||
returns, as they may have been generated specifically for that event. You need
|
||||
to make a deep copy of the array if you want to keep the paths.
|
||||
|
||||
*/
|
116
examples/common/glfw/docs/internal.dox
Normal file
116
examples/common/glfw/docs/internal.dox
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*!
|
||||
|
||||
@page internals Internal structure
|
||||
|
||||
@tableofcontents
|
||||
|
||||
There are several interfaces inside GLFW. Each interface has its own area of
|
||||
responsibility and its own naming conventions.
|
||||
|
||||
|
||||
@section internals_public Public interface
|
||||
|
||||
The most well-known is the public interface, described in the glfw3.h header
|
||||
file. This is implemented in source files shared by all platforms and these
|
||||
files contain no platform-specific code. This code usually ends up calling the
|
||||
platform and internal interfaces to do the actual work.
|
||||
|
||||
The public interface uses the OpenGL naming conventions except with GLFW and
|
||||
glfw instead of GL and gl. For struct members, where OpenGL sets no precedent,
|
||||
it use headless camel case.
|
||||
|
||||
Examples: @ref glfwCreateWindow, @ref GLFWwindow, @ref GLFWvidmode.redBits,
|
||||
`GLFW_RED_BITS`
|
||||
|
||||
|
||||
@section internals_native Native interface
|
||||
|
||||
The [native interface](@ref native) is a small set of publicly available
|
||||
but platform-specific functions, described in the glfw3native.h header file and
|
||||
used to gain access to the underlying window, context and (on some platforms)
|
||||
display handles used by the platform interface.
|
||||
|
||||
The function names of the native interface are similar to those of the public
|
||||
interface, but embeds the name of the interface that the returned handle is
|
||||
from.
|
||||
|
||||
Examples: @ref glfwGetX11Window, @ref glfwGetWGLContext
|
||||
|
||||
|
||||
@section internals_internal Internal interface
|
||||
|
||||
The internal interface consists of utility functions used by all other
|
||||
interfaces. It is shared code implemented in the same shared source files as
|
||||
the public and event interfaces. The internal interface is described in the
|
||||
internal.h header file.
|
||||
|
||||
The internal interface is in charge of GLFW's global data, which it stores in
|
||||
a `_GLFWlibrary` struct named `_glfw`.
|
||||
|
||||
The internal interface uses the same style as the public interface, except all
|
||||
global names have a leading underscore.
|
||||
|
||||
Examples: @ref _glfwIsValidContextConfig, @ref _GLFWwindow, `_glfw.currentRamp`
|
||||
|
||||
|
||||
@section internals_platform Platform interface
|
||||
|
||||
The platform interface implements all platform-specific operations as a service
|
||||
to the public interface. This includes event processing. The platform
|
||||
interface is never directly called by application code and never directly calls
|
||||
application-provided callbacks. It is also prohibited from modifying the
|
||||
platform-independent part of the internal structs. Instead, it calls the event
|
||||
interface when events interesting to GLFW are received.
|
||||
|
||||
The platform interface mirrors those parts of the public interface that needs to
|
||||
perform platform-specific operations on some or all platforms. The are also
|
||||
named the same except that the glfw function prefix is replaced by
|
||||
_glfwPlatform.
|
||||
|
||||
Examples: @ref _glfwPlatformCreateWindow
|
||||
|
||||
The platform interface also defines structs that contain platform-specific
|
||||
global and per-object state. Their names mirror those of the internal
|
||||
interface, except that an interface-specific suffix is added.
|
||||
|
||||
Examples: `_GLFWwindowX11`, `_GLFWcontextWGL`
|
||||
|
||||
These structs are incorporated as members into the internal interface structs
|
||||
using special macros that name them after the specific interface used. This
|
||||
prevents shared code from accidentally using these members.
|
||||
|
||||
Examples: `window.win32.handle`, `_glfw.x11.display`
|
||||
|
||||
|
||||
@section internals_event Event interface
|
||||
|
||||
The event interface is implemented in the same shared source files as the public
|
||||
interface and is responsible for delivering the events it receives to the
|
||||
application, either via callbacks, via window state changes or both.
|
||||
|
||||
The function names of the event interface use a `_glfwInput` prefix and the
|
||||
ObjectEvent pattern.
|
||||
|
||||
Examples: @ref _glfwInputWindowFocus, @ref _glfwInputCursorMotion
|
||||
|
||||
|
||||
@section internals_static Static functions
|
||||
|
||||
Static functions may be used by any interface and have no prefixes or suffixes.
|
||||
These use headless camel case.
|
||||
|
||||
Examples: `clearScrollOffsets`
|
||||
|
||||
|
||||
@section internals_config Configuration macros
|
||||
|
||||
GLFW uses a number of configuration macros to select at compile time which
|
||||
interfaces and code paths to use. They are defined in the glfw_config.h header file,
|
||||
which is generated from the `glfw_config.h.in` file by CMake.
|
||||
|
||||
Configuration macros the same style as tokens in the public interface, except
|
||||
with a leading underscore.
|
||||
|
||||
Examples: `_GLFW_HAS_GLXGETPROCADDRESS`
|
||||
|
||||
*/
|
347
examples/common/glfw/docs/intro.dox
Normal file
347
examples/common/glfw/docs/intro.dox
Normal file
|
@ -0,0 +1,347 @@
|
|||
/*!
|
||||
|
||||
@page intro Introduction to the API
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the basic concepts of GLFW and describes initialization,
|
||||
error handling and API guarantees and limitations. For a broad but shallow
|
||||
tutorial, see @ref quick instead. There are also guides for the other areas of
|
||||
GLFW.
|
||||
|
||||
- @ref window
|
||||
- @ref context
|
||||
- @ref monitor
|
||||
- @ref input
|
||||
|
||||
|
||||
@section intro_init Initialization and termination
|
||||
|
||||
Before most GLFW functions may be called, the library must be initialized.
|
||||
This initialization checks what features are available on the machine,
|
||||
enumerates monitors and joysticks, initializes the timer and performs any
|
||||
required platform-specific initialization.
|
||||
|
||||
Only the following functions may be called before the library has been
|
||||
successfully initialized, and only from the main thread.
|
||||
|
||||
- @ref glfwGetVersion
|
||||
- @ref glfwGetVersionString
|
||||
- @ref glfwSetErrorCallback
|
||||
- @ref glfwInit
|
||||
- @ref glfwTerminate
|
||||
|
||||
Calling any other function before that time will cause a @ref
|
||||
GLFW_NOT_INITIALIZED error.
|
||||
|
||||
|
||||
@subsection intro_init_init Initializing GLFW
|
||||
|
||||
The library is initialized with @ref glfwInit, which returns `GL_FALSE` if an
|
||||
error occurred.
|
||||
|
||||
@code
|
||||
if (!glfwInit())
|
||||
{
|
||||
// Handle initialization failure
|
||||
}
|
||||
@endcode
|
||||
|
||||
If any part of initialization fails, all remaining bits are terminated as if
|
||||
@ref glfwTerminate was called. The library only needs to be initialized once
|
||||
and additional calls to an already initialized library will simply return
|
||||
`GL_TRUE` immediately.
|
||||
|
||||
Once the library has been successfully initialized, it should be terminated
|
||||
before the application exits.
|
||||
|
||||
|
||||
@subsection intro_init_terminate Terminating GLFW
|
||||
|
||||
Before your application exits, you should terminate the GLFW library if it has
|
||||
been initialized. This is done with @ref glfwTerminate.
|
||||
|
||||
@code
|
||||
glfwTerminate();
|
||||
@endcode
|
||||
|
||||
This will destroy any remaining window, monitor and cursor objects, restore any
|
||||
modified gamma ramps, re-enable the screensaver if it had been disabled and free
|
||||
any resources allocated by GLFW.
|
||||
|
||||
Once the library is terminated, it is as if it had never been initialized and
|
||||
you will need to initialize it again before being able to use GLFW. If the
|
||||
library was not initialized or had already been terminated, it return
|
||||
immediately.
|
||||
|
||||
|
||||
@section error_handling Error handling
|
||||
|
||||
Some GLFW functions have return values that indicate an error, but this is often
|
||||
not very helpful when trying to figure out _why_ the error occurred. Some
|
||||
functions also return otherwise valid values on error. Finally, far from all
|
||||
GLFW functions have return values.
|
||||
|
||||
This is where the error callback comes in. This callback is called whenever an
|
||||
error occurs. It is set with @ref glfwSetErrorCallback, a function that may be
|
||||
called regardless of whether GLFW is initialized.
|
||||
|
||||
@code
|
||||
glfwSetErrorCallback(error_callback);
|
||||
@endcode
|
||||
|
||||
The error callback receives a human-readable description of the error and (when
|
||||
possible) its cause. The description encoded as UTF-8. The callback is also
|
||||
provided with an [error code](@ref errors).
|
||||
|
||||
@code
|
||||
void error_callback(int error, const char* description)
|
||||
{
|
||||
puts(description);
|
||||
}
|
||||
@endcode
|
||||
|
||||
The error code indicates the general category of the error. Some error codes,
|
||||
such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like
|
||||
@ref GLFW_PLATFORM_ERROR are used for many different errors.
|
||||
|
||||
The description string is only valid until the error callback returns, as it may
|
||||
have been generated specifically for that error. This lets GLFW provide much
|
||||
more specific error descriptions but means you must make a copy if you want to
|
||||
keep the description string.
|
||||
|
||||
|
||||
@section coordinate_systems Coordinate systems
|
||||
|
||||
GLFW has two primary coordinate systems: the _virtual screen_ and the window
|
||||
_client area_ or _content area_. Both use the same unit: _virtual screen
|
||||
coordinates_, or just _screen coordinates_, which don't necessarily correspond
|
||||
to pixels.
|
||||
|
||||
<img src="spaces.svg" width="90%" />
|
||||
|
||||
Both the virtual screen and the client area coordinate systems have the X-axis
|
||||
pointing to the right and the Y-axis pointing down.
|
||||
|
||||
Window and monitor positions are specified as the position of the upper-left
|
||||
corners of their content areas relative to the virtual screen, while cursor
|
||||
positions are specified relative to a window's client area.
|
||||
|
||||
Because the origin of the window's client area coordinate system is also the
|
||||
point from which the window position is specified, you can translate client area
|
||||
coordinates to the virtual screen by adding the window position. The window
|
||||
frame, when present, extends out from the client area but does not affect the
|
||||
window position.
|
||||
|
||||
Almost all positions and sizes in GLFW are measured in screen coordinates
|
||||
relative to one of the two origins above. This includes cursor positions,
|
||||
window positions and sizes, window frame sizes, monitor positions and video mode
|
||||
resolutions.
|
||||
|
||||
Two exceptions are the [monitor physical size](@ref monitor_size), which is
|
||||
measured in millimetres, and [framebuffer size](@ref window_fbsize), which is
|
||||
measured in pixels.
|
||||
|
||||
Pixels and screen coordinates may map 1:1 on your machine, but they won't on
|
||||
every other machine, for example on a Mac with a Retina display. The ratio
|
||||
between screen coordinates and pixels may also change at run-time depending on
|
||||
which monitor the window is currently considered to be on.
|
||||
|
||||
|
||||
@section guarantees_limitations Guarantees and limitations
|
||||
|
||||
This section describes the conditions under which GLFW can be expected to
|
||||
function, barring bugs in the operating system or drivers. Use of GLFW outside
|
||||
of these limits may work on some platforms, or on some machines, or some of the
|
||||
time, or on some versions of GLFW, but it may break at any time and this will
|
||||
not be considered a bug.
|
||||
|
||||
|
||||
@subsection lifetime Pointer lifetimes
|
||||
|
||||
GLFW will never free any pointer you provide to it and you must never free any
|
||||
pointer it provides to you.
|
||||
|
||||
Many GLFW functions return pointers to dynamically allocated structures, strings
|
||||
or arrays, and some callbacks are provided with strings or arrays. These are
|
||||
always managed by GLFW and should never be freed by the application. The
|
||||
lifetime of these pointers is documented for each GLFW function and callback.
|
||||
If you need to keep this data, you must copy it before its lifetime expires.
|
||||
|
||||
Many GLFW functions accept pointers to structures or strings allocated by the
|
||||
application. These are never freed by GLFW and are always the responsibility of
|
||||
the application. If GLFW needs to keep the data in these structures or strings,
|
||||
it is copied before the function returns.
|
||||
|
||||
Pointer lifetimes are guaranteed not to be shortened in future minor or patch
|
||||
releases.
|
||||
|
||||
|
||||
@subsection reentrancy Reentrancy
|
||||
|
||||
GLFW event processing and object creation and destruction are not reentrant.
|
||||
This means that the following functions may not be called from any callback
|
||||
function:
|
||||
|
||||
- @ref glfwCreateWindow
|
||||
- @ref glfwDestroyWindow
|
||||
- @ref glfwCreateCursor
|
||||
- @ref glfwCreateStandardCursor
|
||||
- @ref glfwDestroyCursor
|
||||
- @ref glfwPollEvents
|
||||
- @ref glfwWaitEvents
|
||||
- @ref glfwTerminate
|
||||
|
||||
These functions may be made reentrant in future minor or patch releases, but
|
||||
functions not on this list will not be made non-reentrant.
|
||||
|
||||
|
||||
@subsection thread_safety Thread safety
|
||||
|
||||
Most GLFW functions may only be called from the main thread, but some may be
|
||||
called from any thread. However, no GLFW function may be called from any other
|
||||
thread until GLFW has been successfully initialized on the main thread,
|
||||
including functions that may called before initialization.
|
||||
|
||||
The reference documentation for every GLFW function states whether it is limited
|
||||
to the main thread.
|
||||
|
||||
The following categories of functions are and will remain limited to the main
|
||||
thread due to the limitations of one or several platforms:
|
||||
|
||||
- Initialization and termination
|
||||
- Event processing
|
||||
- Creation and destruction of window, context and cursor objects
|
||||
|
||||
Because event processing must be performed on the main thread, all callbacks
|
||||
except for the error callback will only be called on that thread. The error
|
||||
callback may be called on any thread, as any GLFW function may generate errors.
|
||||
|
||||
The posting of empty events may be done from any thread. The window user
|
||||
pointer and close flag may also be accessed and modified from any thread, but
|
||||
this is not synchronized by GLFW. The following window related functions may
|
||||
be called from any thread:
|
||||
|
||||
- @ref glfwPostEmptyEvent
|
||||
- @ref glfwGetWindowUserPointer
|
||||
- @ref glfwSetWindowUserPointer
|
||||
- @ref glfwWindowShouldClose
|
||||
- @ref glfwSetWindowShouldClose
|
||||
|
||||
Rendering may be done on any thread. The following context related functions
|
||||
may be called from any thread:
|
||||
|
||||
- @ref glfwMakeContextCurrent
|
||||
- @ref glfwGetCurrentContext
|
||||
- @ref glfwSwapBuffers
|
||||
- @ref glfwSwapInterval
|
||||
- @ref glfwExtensionSupported
|
||||
- @ref glfwGetProcAddress
|
||||
|
||||
The timer may be accessed from any thread, but this is not synchronized by GLFW.
|
||||
The following timer related functions may be called from any thread:
|
||||
|
||||
- @ref glfwGetTime
|
||||
|
||||
Library version information may be queried from any thread. The following
|
||||
version related functions may be called from any thread:
|
||||
|
||||
- @ref glfwGetVersion
|
||||
- @ref glfwGetVersionString
|
||||
|
||||
GLFW uses no synchronization objects internally except for thread-local storage
|
||||
to keep track of the current context for each thread. Synchronization is left
|
||||
to the application.
|
||||
|
||||
Functions that may currently be called from any thread will always remain so,
|
||||
but functions that are currently limited to the main may be updated to allow
|
||||
calls from any thread in future releases.
|
||||
|
||||
|
||||
@subsection compatibility Version compatibility
|
||||
|
||||
GLFW guarantees binary backward compatibility with earlier minor versions of the
|
||||
API. This means that you can drop in a newer version of the GLFW DLL / shared
|
||||
library / dynamic library and existing applications will continue to run.
|
||||
|
||||
Once a function or constant has been added, the signature of that function or
|
||||
value of that constant will remain unchanged until the next major version of
|
||||
GLFW. No compatibility of any kind is guaranteed between major versions.
|
||||
|
||||
Undocumented behavior, i.e. behavior that is not described in the documentation,
|
||||
may change at any time until it is documented.
|
||||
|
||||
If the reference documentation and the implementation differ, the reference
|
||||
documentation is correct and the implementation will be fixed in the next
|
||||
release.
|
||||
|
||||
|
||||
@subsection event_order Event order
|
||||
|
||||
The order of arrival of related events is not guaranteed to be consistent
|
||||
across platforms. The exception is synthetic key and mouse button release
|
||||
events, which are always delivered after the window defocus event.
|
||||
|
||||
|
||||
@section intro_version Version management
|
||||
|
||||
GLFW provides mechanisms for identifying what version of GLFW your application
|
||||
was compiled against as well as what version it is currently running against.
|
||||
If you are loading GLFW dynamically (not just linking dynamically), you can use
|
||||
this to verify that the library binary is compatible with your application.
|
||||
|
||||
|
||||
@subsection intro_version_compile Compile-time version
|
||||
|
||||
The compile-time version of GLFW is provided by the GLFW header with the
|
||||
`GLFW_VERSION_MAJOR`, `GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` macros.
|
||||
|
||||
@code
|
||||
printf("Compiled against GLFW %i.%i.%i\n",
|
||||
GLFW_VERSION_MAJOR,
|
||||
GLFW_VERSION_MINOR,
|
||||
GLFW_VERSION_REVISION);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection intro_version_runtime Run-time version
|
||||
|
||||
The run-time version can be retrieved with @ref glfwGetVersion, a function that
|
||||
may be called regardless of whether GLFW is initialized.
|
||||
|
||||
@code
|
||||
int major, minor, revision;
|
||||
glfwGetVersion(&major, &minor, &revision);
|
||||
|
||||
printf("Running against GLFW %i.%i.%i\n", major, minor, revision);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection intro_version_string Version string
|
||||
|
||||
GLFW 3 also provides a compile-time generated version string that describes the
|
||||
version, platform, compiler and any platform-specific compile-time options.
|
||||
This is primarily intended for submitting bug reports, to allow developers to
|
||||
see which code paths are enabled in a binary.
|
||||
|
||||
The version string is returned by @ref glfwGetVersionString, a function that may
|
||||
be called regardless of whether GLFW is initialized.
|
||||
|
||||
__Do not use the version string__ to parse the GLFW library version. The @ref
|
||||
glfwGetVersion function already provides the version of the running library
|
||||
binary.
|
||||
|
||||
The format of the string is as follows:
|
||||
- The version of GLFW
|
||||
- The name of the window system API
|
||||
- The name of the context creation API
|
||||
- Any additional options or APIs
|
||||
|
||||
For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL
|
||||
back ends, the version string may look something like this:
|
||||
|
||||
@code
|
||||
3.0.0 Win32 WGL MinGW
|
||||
@endcode
|
||||
|
||||
*/
|
47
examples/common/glfw/docs/main.dox
Normal file
47
examples/common/glfw/docs/main.dox
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*!
|
||||
|
||||
@mainpage notitle
|
||||
|
||||
@section main_intro Introduction
|
||||
|
||||
__GLFW__ is a free, Open Source, multi-platform library for creating windows
|
||||
with OpenGL or OpenGL ES contexts and receiving many kinds of input. It is easy
|
||||
to integrate into existing applications and does not lay claim to the main loop.
|
||||
|
||||
See @ref news_31 for release highlights or the
|
||||
[version history](http://www.glfw.org/changelog.html) for details.
|
||||
|
||||
@ref quick is a guide for those new to GLFW. It takes you through how to write
|
||||
a small but complete program. For people coming from GLFW 2, the @ref moving
|
||||
guide explains what has changed and how to update existing code to use the new
|
||||
API.
|
||||
|
||||
There are guides for each of the various areas of the API.
|
||||
|
||||
- @ref intro – initialization, error handling and high-level design
|
||||
- @ref window – creating and working with windows and framebuffers
|
||||
- @ref context – working with OpenGL and OpenGL ES contexts
|
||||
- @ref monitor – enumerating and working with monitors and video modes
|
||||
- @ref input – receiving events, polling and processing input
|
||||
|
||||
Once you have written a program, see the @ref compile and @ref build guides.
|
||||
|
||||
The [reference documentation](modules.html) provides more detailed information
|
||||
about specific functions.
|
||||
|
||||
There is a section on @ref guarantees_limitations for pointer lifetimes,
|
||||
reentrancy, thread safety, event order and backward and forward compatibility.
|
||||
|
||||
The @ref rift fills in the gaps for how to use LibOVR with GLFW.
|
||||
|
||||
The [FAQ](http://www.glfw.org/faq.html) answers many common questions about the
|
||||
design, implementation and use of GLFW.
|
||||
|
||||
Finally, the @ref compat guide explains what APIs, standards and protocols GLFW
|
||||
uses and what happens when they are not present on a given machine.
|
||||
|
||||
This documentation was generated with Doxygen. The sources for it are available
|
||||
in both the [source distribution](http://www.glfw.org/download.html) and
|
||||
[GitHub repository](https://github.com/glfw/glfw).
|
||||
|
||||
*/
|
204
examples/common/glfw/docs/monitor.dox
Normal file
204
examples/common/glfw/docs/monitor.dox
Normal file
|
@ -0,0 +1,204 @@
|
|||
/*!
|
||||
|
||||
@page monitor Monitor guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the monitor related functions of GLFW. There are also
|
||||
guides for the other areas of GLFW.
|
||||
|
||||
- @ref intro
|
||||
- @ref window
|
||||
- @ref context
|
||||
- @ref input
|
||||
|
||||
|
||||
@section monitor_object Monitor objects
|
||||
|
||||
A monitor object represents a currently connected monitor and is represented as
|
||||
a pointer to the [opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type
|
||||
@ref GLFWmonitor. Monitor objects cannot be created or destroyed by the
|
||||
application and retain their addresses until the monitors they represent are
|
||||
disconnected or until the library is [terminated](@ref intro_init_terminate).
|
||||
|
||||
Each monitor has a current video mode, a list of supported video modes,
|
||||
a virtual position, a human-readable name, an estimated physical size and
|
||||
a gamma ramp. One of the monitors is the primary monitor.
|
||||
|
||||
The virtual position of a monitor is in
|
||||
[screen coordinates](@ref coordinate_systems) and, together with the current
|
||||
video mode, describes the viewports that the connected monitors provide into the
|
||||
virtual desktop that spans them.
|
||||
|
||||
To see how GLFW views your monitor setup and its available video modes, run the
|
||||
`modes` test program.
|
||||
|
||||
|
||||
@subsection monitor_monitors Retrieving monitors
|
||||
|
||||
The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is the user's
|
||||
preferred monitor and is usually the one with global UI elements like task bar
|
||||
or menu bar.
|
||||
|
||||
@code
|
||||
GLFWmonitor* primary = glfwGetPrimaryMonitor();
|
||||
@endcode
|
||||
|
||||
You can retrieve all currently connected monitors with @ref glfwGetMonitors.
|
||||
See the reference documentation for the lifetime of the returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
GLFWmonitor** monitors = glfwGetMonitors(&count);
|
||||
@endcode
|
||||
|
||||
The primary monitor is always the first monitor in the returned array, but other
|
||||
monitors may be moved to a different index when a monitor is connected or
|
||||
disconnected.
|
||||
|
||||
|
||||
@subsection monitor_event Monitor configuration changes
|
||||
|
||||
If you wish to be notified when a monitor is connected or disconnected, set
|
||||
a monitor callback.
|
||||
|
||||
@code
|
||||
glfwSetMonitorCallback(monitor_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the handle for the monitor that has been
|
||||
connected or disconnected and a monitor action.
|
||||
|
||||
@code
|
||||
void monitor_callback(GLFWmonitor* monitor, int event)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
The action is one of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
|
||||
|
||||
|
||||
@section monitor_properties Monitor properties
|
||||
|
||||
Each monitor has a current video mode, a list of supported video modes,
|
||||
a virtual position, a human-readable name, an estimated physical size and
|
||||
a gamma ramp.
|
||||
|
||||
|
||||
@subsection monitor_modes Video modes
|
||||
|
||||
GLFW generally does a good job selecting a suitable video mode when you create
|
||||
a full screen window, but it is sometimes useful to know exactly which video
|
||||
modes are supported.
|
||||
|
||||
Video modes are represented as @ref GLFWvidmode structures. You can get an
|
||||
array of the video modes supported by a monitor with @ref glfwGetVideoModes.
|
||||
See the reference documentation for the lifetime of the returned array.
|
||||
|
||||
@code
|
||||
int count;
|
||||
GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
|
||||
@endcode
|
||||
|
||||
To get the current video mode of a monitor call @ref glfwGetVideoMode. See the
|
||||
reference documentation for the lifetime of the returned pointer.
|
||||
|
||||
@code
|
||||
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
|
||||
@endcode
|
||||
|
||||
The resolution of a video mode is specified in
|
||||
[screen coordinates](@ref coordinate_systems), not pixels.
|
||||
|
||||
|
||||
@subsection monitor_size Physical size
|
||||
|
||||
The physical size of a monitor in millimetres, or an estimation of it, can be
|
||||
retrieved with @ref glfwGetMonitorPhysicalSize. This has no relation to its
|
||||
current _resolution_, i.e. the width and height of its current
|
||||
[video mode](@ref monitor_modes).
|
||||
|
||||
@code
|
||||
int widthMM, heightMM;
|
||||
glfwGetMonitorPhysicalSize(monitor, &widthMM, &heightMM);
|
||||
@endcode
|
||||
|
||||
This can, for example, be used together with the current video mode to calculate
|
||||
the DPI of a monitor.
|
||||
|
||||
@code
|
||||
const double dpi = mode->width / (widthMM / 25.4);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection monitor_pos Virtual position
|
||||
|
||||
The position of the monitor on the virtual desktop, in
|
||||
[screen coordinates](@ref coordinate_systems), can be retrieved with @ref
|
||||
glfwGetMonitorPos.
|
||||
|
||||
@code
|
||||
int xpos, ypos;
|
||||
glfwGetMonitorPos(monitor, &xpos, &ypos);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection monitor_name Human-readable name
|
||||
|
||||
The human-readable, UTF-8 encoded name of a monitor is returned by @ref
|
||||
glfwGetMonitorName. See the reference documentation for the lifetime of the
|
||||
returned string.
|
||||
|
||||
@code
|
||||
const char* name = glfwGetMonitorName(monitor);
|
||||
@endcode
|
||||
|
||||
Monitor names are not guaranteed to be unique. Two monitors of the same model
|
||||
and make may have the same name. Only the monitor handle is guaranteed to be
|
||||
unique, and only until that monitor is disconnected.
|
||||
|
||||
|
||||
@subsection monitor_gamma Gamma ramp
|
||||
|
||||
The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts
|
||||
a monitor handle and a pointer to a @ref GLFWgammaramp structure.
|
||||
|
||||
@code
|
||||
GLFWgammaramp ramp;
|
||||
unsigned short red[256], green[256], blue[256];
|
||||
|
||||
ramp.size = 256;
|
||||
ramp.red = red;
|
||||
ramp.green = green;
|
||||
ramp.blue = blue;
|
||||
|
||||
for (i = 0; i < ramp.size; i++)
|
||||
{
|
||||
// Fill out gamma ramp arrays as desired
|
||||
}
|
||||
|
||||
glfwSetGammaRamp(monitor, &ramp);
|
||||
@endcode
|
||||
|
||||
The gamma ramp data is copied before the function returns, so there is no need
|
||||
to keep it around once the ramp has been set.
|
||||
|
||||
@note It is recommended to use gamma ramps of size 256, as that is the size
|
||||
supported by all graphics cards on all platforms.
|
||||
|
||||
The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. See
|
||||
the reference documentation for the lifetime of the returned structure.
|
||||
|
||||
@code
|
||||
const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
|
||||
@endcode
|
||||
|
||||
If you wish to set a regular gamma ramp, you can have GLFW calculate it for you
|
||||
from the desired exponent with @ref glfwSetGamma, which in turn calls @ref
|
||||
glfwSetGammaRamp with the resulting ramp.
|
||||
|
||||
@code
|
||||
glfwSetGamma(monitor, 1.0);
|
||||
@endcode
|
||||
|
||||
*/
|
494
examples/common/glfw/docs/moving.dox
Normal file
494
examples/common/glfw/docs/moving.dox
Normal file
|
@ -0,0 +1,494 @@
|
|||
/*!
|
||||
|
||||
@page moving Moving from GLFW 2 to 3
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This is a transition guide for moving from GLFW 2 to 3. It describes what has
|
||||
changed or been removed, but does _not_ include
|
||||
[new features](@ref news) unless they are required when moving an existing code
|
||||
base onto the new API. For example, the new multi-monitor functions are
|
||||
required to create full screen windows with GLFW 3.
|
||||
|
||||
|
||||
@section moving_removed Changed and removed features
|
||||
|
||||
@subsection moving_renamed_files Renamed library and header file
|
||||
|
||||
The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to
|
||||
avoid collisions with the headers of other major versions. Similarly, the GLFW
|
||||
3 library is named `glfw3,` except when it's installed as a shared library on
|
||||
Unix-like systems, where it uses the
|
||||
[soname](https://en.wikipedia.org/wiki/soname) `libglfw.so.3`.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
#include <GL/glfw.h>
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_threads Removal of threading functions
|
||||
|
||||
The threading functions have been removed, including the per-thread sleep
|
||||
function. They were fairly primitive, under-used, poorly integrated and took
|
||||
time away from the focus of GLFW (i.e. context, input and window). There are
|
||||
better threading libraries available and native threading support is available
|
||||
in both [C++11](http://en.cppreference.com/w/cpp/thread) and
|
||||
[C11](http://en.cppreference.com/w/c/thread), both of which are gaining
|
||||
traction.
|
||||
|
||||
If you wish to use the C++11 or C11 facilities but your compiler doesn't yet
|
||||
support them, see the
|
||||
[TinyThread++](https://gitorious.org/tinythread/tinythreadpp) and
|
||||
[TinyCThread](https://github.com/tinycthread/tinycthread) projects created by
|
||||
the original author of GLFW. These libraries implement a usable subset of the
|
||||
threading APIs in C++11 and C11, and in fact some GLFW 3 test programs use
|
||||
TinyCThread.
|
||||
|
||||
However, GLFW 3 has better support for _use from multiple threads_ than GLFW
|
||||
2 had. Contexts can be made current on any thread, although only a single
|
||||
thread at a time, and the documentation explicitly states which functions may be
|
||||
used from any thread and which may only be used from the main thread.
|
||||
|
||||
@par Removed functions
|
||||
`glfwSleep`, `glfwCreateThread`, `glfwDestroyThread`, `glfwWaitThread`,
|
||||
`glfwGetThreadID`, `glfwCreateMutex`, `glfwDestroyMutex`, `glfwLockMutex`,
|
||||
`glfwUnlockMutex`, `glfwCreateCond`, `glfwDestroyCond`, `glfwWaitCond`,
|
||||
`glfwSignalCond`, `glfwBroadcastCond` and `glfwGetNumberOfProcessors`.
|
||||
|
||||
|
||||
@subsection moving_image Removal of image and texture loading
|
||||
|
||||
The image and texture loading functions have been removed. They only supported
|
||||
the Targa image format, making them mostly useful for beginner level examples.
|
||||
To become of sufficiently high quality to warrant keeping them in GLFW 3, they
|
||||
would need not only to support other formats, but also modern extensions to
|
||||
OpenGL texturing. This would either add a number of external
|
||||
dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions
|
||||
of these libraries.
|
||||
|
||||
As there already are libraries doing this, it is unnecessary both to duplicate
|
||||
the work and to tie the duplicate to GLFW. The resulting library would also be
|
||||
platform-independent, as both OpenGL and stdio are available wherever GLFW is.
|
||||
|
||||
@par Removed functions
|
||||
`glfwReadImage`, `glfwReadMemoryImage`, `glfwFreeImage`, `glfwLoadTexture2D`,
|
||||
`glfwLoadMemoryTexture2D` and `glfwLoadTextureImage2D`.
|
||||
|
||||
|
||||
@subsection moving_stdcall Removal of GLFWCALL macro
|
||||
|
||||
The `GLFWCALL` macro, which made callback functions use
|
||||
[__stdcall](http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx) on Windows,
|
||||
has been removed. GLFW is written in C, not Pascal. Removing this macro means
|
||||
there's one less thing for application programmers to remember, i.e. the
|
||||
requirement to mark all callback functions with `GLFWCALL`. It also simplifies
|
||||
the creation of DLLs and DLL link libraries, as there's no need to explicitly
|
||||
disable `@n` entry point suffixes.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
void GLFWCALL callback_function(...);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void callback_function(...);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_window_handles Window handle parameters
|
||||
|
||||
Because GLFW 3 supports multiple windows, window handle parameters have been
|
||||
added to all window-related GLFW functions and callbacks. The handle of
|
||||
a newly created window is returned by @ref glfwCreateWindow (formerly
|
||||
`glfwOpenWindow`). Window handles are pointers to the
|
||||
[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWwindow.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
glfwSetWindowTitle("New Window Title");
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
glfwSetWindowTitle(window, "New Window Title");
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_monitor Explicit monitor selection
|
||||
|
||||
GLFW 3 provides support for multiple monitors. To request a full screen mode window,
|
||||
instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the
|
||||
window to use. The @ref glfwGetPrimaryMonitor function returns the monitor that
|
||||
GLFW 2 would have selected, but there are many other
|
||||
[monitor functions](@ref monitor). Monitor handles are pointers to the
|
||||
[opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type @ref GLFWmonitor.
|
||||
|
||||
@par Old basic full screen
|
||||
@code
|
||||
glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);
|
||||
@endcode
|
||||
|
||||
@par New basic full screen
|
||||
@code
|
||||
window = glfwCreateWindow(640, 480, "My Window", glfwGetPrimaryMonitor(), NULL);
|
||||
@endcode
|
||||
|
||||
@note The framebuffer bit depth parameters of `glfwOpenWindow` have been turned
|
||||
into [window hints](@ref window_hints), but as they have been given
|
||||
[sane defaults](@ref window_hints_values) you rarely need to set these hints.
|
||||
|
||||
|
||||
@subsection moving_autopoll Removal of automatic event polling
|
||||
|
||||
GLFW 3 does not automatically poll for events in @ref glfwSwapBuffers, meaning
|
||||
you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. Unlike
|
||||
buffer swap, which acts on a single window, the event processing functions act
|
||||
on all windows at once.
|
||||
|
||||
@par Old basic main loop
|
||||
@code
|
||||
while (...)
|
||||
{
|
||||
// Process input
|
||||
// Render output
|
||||
glfwSwapBuffers();
|
||||
}
|
||||
@endcode
|
||||
|
||||
@par New basic main loop
|
||||
@code
|
||||
while (...)
|
||||
{
|
||||
// Process input
|
||||
// Render output
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_context Explicit context management
|
||||
|
||||
Each GLFW 3 window has its own OpenGL context and only you, the application
|
||||
programmer, can know which context should be current on which thread at any
|
||||
given time. Therefore, GLFW 3 leaves that decision to you.
|
||||
|
||||
This means that you need to call @ref glfwMakeContextCurrent after creating
|
||||
a window before you can call any OpenGL functions.
|
||||
|
||||
|
||||
@subsection moving_hidpi Separation of window and framebuffer sizes
|
||||
|
||||
Window positions and sizes now use screen coordinates, which may not be the same
|
||||
as pixels on machines with high-DPI monitors. This is important as OpenGL uses
|
||||
pixels, not screen coordinates. For example, the rectangle specified with
|
||||
`glViewport` needs to use pixels. Therefore, framebuffer size functions have
|
||||
been added. You can retrieve the size of the framebuffer of a window with @ref
|
||||
glfwGetFramebufferSize function. A framebuffer size callback has also been
|
||||
added, which can be set with @ref glfwSetFramebufferSizeCallback.
|
||||
|
||||
@par Old basic viewport setup
|
||||
@code
|
||||
glfwGetWindowSize(&width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
@endcode
|
||||
|
||||
@par New basic viewport setup
|
||||
@code
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_window_close Window closing changes
|
||||
|
||||
The `GLFW_OPENED` window parameter has been removed. As long as the window has
|
||||
not been destroyed, whether through @ref glfwDestroyWindow or @ref
|
||||
glfwTerminate, the window is "open".
|
||||
|
||||
A user attempting to close a window is now just an event like any other. Unlike
|
||||
GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless
|
||||
you choose them to be. Each window now has a close flag that is set to
|
||||
`GL_TRUE` when the user attempts to close that window. By default, nothing else
|
||||
happens and the window stays visible. It is then up to you to either destroy
|
||||
the window, take some other action or simply ignore the request.
|
||||
|
||||
You can query the close flag at any time with @ref glfwWindowShouldClose and set
|
||||
it at any time with @ref glfwSetWindowShouldClose.
|
||||
|
||||
@par Old basic main loop
|
||||
@code
|
||||
while (glfwGetWindowParam(GLFW_OPENED))
|
||||
{
|
||||
...
|
||||
}
|
||||
@endcode
|
||||
|
||||
@par New basic main loop
|
||||
@code
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
...
|
||||
}
|
||||
@endcode
|
||||
|
||||
The close callback no longer returns a value. Instead, it is called after the
|
||||
close flag has been set so it can override its value, if it chooses to, before
|
||||
event processing completes. You may however not call @ref glfwDestroyWindow
|
||||
from the close callback (or any other window related callback).
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
int GLFWCALL window_close_callback(void);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void window_close_callback(GLFWwindow* window);
|
||||
@endcode
|
||||
|
||||
@note GLFW never clears the close flag to `GL_FALSE`, meaning you can use it
|
||||
for other reasons to close the window as well, for example the user choosing
|
||||
Quit from an in-game menu.
|
||||
|
||||
|
||||
@subsection moving_hints Persistent window hints
|
||||
|
||||
The `glfwOpenWindowHint` function has been renamed to @ref glfwWindowHint.
|
||||
|
||||
Window hints are no longer reset to their default values on window creation, but
|
||||
instead retain their values until modified by @ref glfwWindowHint or @ref
|
||||
glfwDefaultWindowHints, or until the library is terminated and re-initialized.
|
||||
|
||||
|
||||
@subsection moving_video_modes Video mode enumeration
|
||||
|
||||
Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function
|
||||
now returns all available modes for a specific monitor instead of requiring you
|
||||
to guess how large an array you need. The `glfwGetDesktopMode` function, which
|
||||
had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which
|
||||
returns the current mode of a monitor.
|
||||
|
||||
|
||||
@subsection moving_char_up Removal of character actions
|
||||
|
||||
The action parameter of the [character callback](@ref GLFWcharfun) has been
|
||||
removed. This was an artefact of the origin of GLFW, i.e. being developed in
|
||||
English by a Swede. However, many keyboard layouts require more than one key to
|
||||
produce characters with diacritical marks. Even the Swedish keyboard layout
|
||||
requires this for uncommon cases like ü.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
void GLFWCALL character_callback(int character, int action);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void character_callback(GLFWwindow* window, int character);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection moving_cursorpos Cursor position changes
|
||||
|
||||
The `glfwGetMousePos` function has been renamed to @ref glfwGetCursorPos,
|
||||
`glfwSetMousePos` to @ref glfwSetCursorPos and `glfwSetMousePosCallback` to @ref
|
||||
glfwSetCursorPosCallback.
|
||||
|
||||
The cursor position is now `double` instead of `int`, both for the direct
|
||||
functions and for the callback. Some platforms can provide sub-pixel cursor
|
||||
movement and this data is now passed on to the application where available. On
|
||||
platforms where this is not provided, the decimal part is zero.
|
||||
|
||||
GLFW 3 only allows you to position the cursor within a window using @ref
|
||||
glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active.
|
||||
Unless the window is active, the function fails silently.
|
||||
|
||||
|
||||
@subsection moving_wheel Wheel position replaced by scroll offsets
|
||||
|
||||
The `glfwGetMouseWheel` function has been removed. Scrolling is the input of
|
||||
offsets and has no absolute position. The mouse wheel callback has been
|
||||
replaced by a [scroll callback](@ref GLFWscrollfun) that receives
|
||||
two-dimensional floating point scroll offsets. This allows you to receive
|
||||
precise scroll data from for example modern touchpads.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
void GLFWCALL mouse_wheel_callback(int position);
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);
|
||||
@endcode
|
||||
|
||||
@par Removed functions
|
||||
`glfwGetMouseWheel`
|
||||
|
||||
|
||||
@subsection moving_repeat Key repeat action
|
||||
|
||||
The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled
|
||||
for both keys and characters. A new key action, `GLFW_REPEAT`, has been added
|
||||
to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press
|
||||
from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or
|
||||
`GLFW_RELEASE`.
|
||||
|
||||
|
||||
@subsection moving_keys Physical key input
|
||||
|
||||
GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to
|
||||
the values generated by the current keyboard layout. The tokens are named
|
||||
according to the values they would have using the standard US layout, but this
|
||||
is only a convenience, as most programmers are assumed to know that layout.
|
||||
This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and
|
||||
is the same key in the same place regardless of what keyboard layouts the users
|
||||
of your program has.
|
||||
|
||||
The key input facility was never meant for text input, although using it that
|
||||
way worked slightly better in GLFW 2. If you were using it to input text, you
|
||||
should be using the character callback instead, on both GLFW 2 and 3. This will
|
||||
give you the characters being input, as opposed to the keys being pressed.
|
||||
|
||||
GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of
|
||||
having to remember whether to check for `'a'` or `'A'`, you now check for
|
||||
`GLFW_KEY_A`.
|
||||
|
||||
|
||||
@subsection moving_joystick Joystick function changes
|
||||
|
||||
The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes.
|
||||
|
||||
The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and
|
||||
`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent
|
||||
function as well as axis and button counts returned by the @ref
|
||||
glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions.
|
||||
|
||||
|
||||
@subsection moving_mbcs Win32 MBCS support
|
||||
|
||||
The Win32 port of GLFW 3 will not compile in
|
||||
[MBCS mode](http://msdn.microsoft.com/en-us/library/5z097dxa.aspx).
|
||||
However, because the use of the Unicode version of the Win32 API doesn't affect
|
||||
the process as a whole, but only those windows created using it, it's perfectly
|
||||
possible to call MBCS functions from other parts of the same application.
|
||||
Therefore, even if an application using GLFW has MBCS mode code, there's no need
|
||||
for GLFW itself to support it.
|
||||
|
||||
|
||||
@subsection moving_windows Support for versions of Windows older than XP
|
||||
|
||||
All explicit support for version of Windows older than XP has been removed.
|
||||
There is no code that actively prevents GLFW 3 from running on these earlier
|
||||
versions, but it uses Win32 functions that those versions lack.
|
||||
|
||||
Windows XP was released in 2001, and by now (January 2015) it has not only
|
||||
replaced almost all earlier versions of Windows, but is itself rapidly being
|
||||
replaced by Windows 7 and 8. The MSDN library doesn't even provide
|
||||
documentation for version older than Windows 2000, making it difficult to
|
||||
maintain compatibility with these versions even if it was deemed worth the
|
||||
effort.
|
||||
|
||||
The Win32 API has also not stood still, and GLFW 3 uses many functions only
|
||||
present on Windows XP or later. Even supporting an OS as new as XP (new
|
||||
from the perspective of GLFW 2, which still supports Windows 95) requires
|
||||
runtime checking for a number of functions that are present only on modern
|
||||
version of Windows.
|
||||
|
||||
|
||||
@subsection moving_syskeys Capture of system-wide hotkeys
|
||||
|
||||
The ability to disable and capture system-wide hotkeys like Alt+Tab has been
|
||||
removed. Modern applications, whether they're games, scientific visualisations
|
||||
or something else, are nowadays expected to be good desktop citizens and allow
|
||||
these hotkeys to function even when running in full screen mode.
|
||||
|
||||
|
||||
@subsection moving_terminate Automatic termination
|
||||
|
||||
GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization,
|
||||
because `exit` calls registered functions from the calling thread and while it
|
||||
is permitted to call `exit` from any thread, @ref glfwTerminate may only be
|
||||
called from the main thread.
|
||||
|
||||
To release all resources allocated by GLFW, you should call @ref glfwTerminate
|
||||
yourself, from the main thread, before the program terminates. Note that this
|
||||
destroys all windows not already destroyed with @ref glfwDestroyWindow,
|
||||
invalidating any window handles you may still have.
|
||||
|
||||
|
||||
@subsection moving_glu GLU header inclusion
|
||||
|
||||
GLFW 3 does not by default include the GLU header and GLU itself has been
|
||||
deprecated by [Khronos](https://en.wikipedia.org/wiki/Khronos_Group). __New
|
||||
projects should avoid using GLU__, but if you need to compile legacy code that
|
||||
has been moved to GLFW 3, you can request that the GLFW header includes it by
|
||||
defining `GLFW_INCLUDE_GLU` before the inclusion of the GLFW header.
|
||||
|
||||
@par Old syntax
|
||||
@code
|
||||
#include <GL/glfw.h>
|
||||
@endcode
|
||||
|
||||
@par New syntax
|
||||
@code
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
|
||||
@section moving_tables Name change tables
|
||||
|
||||
|
||||
@subsection moving_renamed_functions Renamed functions
|
||||
|
||||
| GLFW 2 | GLFW 3 | Notes |
|
||||
| --------------------------- | ----------------------------- | ----- |
|
||||
| `glfwOpenWindow` | @ref glfwCreateWindow | All channel bit depths are now hints
|
||||
| `glfwCloseWindow` | @ref glfwDestroyWindow | |
|
||||
| `glfwOpenWindowHint` | @ref glfwWindowHint | Now accepts all `GLFW_*_BITS` tokens |
|
||||
| `glfwEnable` | @ref glfwSetInputMode | |
|
||||
| `glfwDisable` | @ref glfwSetInputMode | |
|
||||
| `glfwGetMousePos` | @ref glfwGetCursorPos | |
|
||||
| `glfwSetMousePos` | @ref glfwSetCursorPos | |
|
||||
| `glfwSetMousePosCallback` | @ref glfwSetCursorPosCallback | |
|
||||
| `glfwSetMouseWheelCallback` | @ref glfwSetScrollCallback | Accepts two-dimensional scroll offsets as doubles |
|
||||
| `glfwGetJoystickPos` | @ref glfwGetJoystickAxes | |
|
||||
| `glfwGetWindowParam` | @ref glfwGetWindowAttrib | |
|
||||
| `glfwGetGLVersion` | @ref glfwGetWindowAttrib | Use `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and `GLFW_CONTEXT_REVISION` |
|
||||
| `glfwGetDesktopMode` | @ref glfwGetVideoMode | Returns the current mode of a monitor |
|
||||
| `glfwGetJoystickParam` | @ref glfwJoystickPresent | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons |
|
||||
|
||||
@subsection moving_renamed_tokens Renamed tokens
|
||||
|
||||
| GLFW 2 | GLFW 3 | Notes |
|
||||
| --------------------------- | ---------------------------- | ----- |
|
||||
| `GLFW_OPENGL_VERSION_MAJOR` | `GLFW_CONTEXT_VERSION_MAJOR` | Renamed as it applies to OpenGL ES as well |
|
||||
| `GLFW_OPENGL_VERSION_MINOR` | `GLFW_CONTEXT_VERSION_MINOR` | Renamed as it applies to OpenGL ES as well |
|
||||
| `GLFW_FSAA_SAMPLES` | `GLFW_SAMPLES` | Renamed to match the OpenGL API |
|
||||
| `GLFW_ACTIVE` | `GLFW_FOCUSED` | Renamed to match the window focus callback |
|
||||
| `GLFW_WINDOW_NO_RESIZE` | `GLFW_RESIZABLE` | The default has been inverted |
|
||||
| `GLFW_MOUSE_CURSOR` | `GLFW_CURSOR` | Used with @ref glfwSetInputMode |
|
||||
| `GLFW_KEY_ESC` | `GLFW_KEY_ESCAPE` | |
|
||||
| `GLFW_KEY_DEL` | `GLFW_KEY_DELETE` | |
|
||||
| `GLFW_KEY_PAGEUP` | `GLFW_KEY_PAGE_UP` | |
|
||||
| `GLFW_KEY_PAGEDOWN` | `GLFW_KEY_PAGE_DOWN` | |
|
||||
| `GLFW_KEY_KP_NUM_LOCK` | `GLFW_KEY_NUM_LOCK` | |
|
||||
| `GLFW_KEY_LCTRL` | `GLFW_KEY_LEFT_CONTROL` | |
|
||||
| `GLFW_KEY_LSHIFT` | `GLFW_KEY_LEFT_SHIFT` | |
|
||||
| `GLFW_KEY_LALT` | `GLFW_KEY_LEFT_ALT` | |
|
||||
| `GLFW_KEY_LSUPER` | `GLFW_KEY_LEFT_SUPER` | |
|
||||
| `GLFW_KEY_RCTRL` | `GLFW_KEY_RIGHT_CONTROL` | |
|
||||
| `GLFW_KEY_RSHIFT` | `GLFW_KEY_RIGHT_SHIFT` | |
|
||||
| `GLFW_KEY_RALT` | `GLFW_KEY_RIGHT_ALT` | |
|
||||
| `GLFW_KEY_RSUPER` | `GLFW_KEY_RIGHT_SUPER` | |
|
||||
|
||||
*/
|
292
examples/common/glfw/docs/news.dox
Normal file
292
examples/common/glfw/docs/news.dox
Normal file
|
@ -0,0 +1,292 @@
|
|||
/*!
|
||||
|
||||
@page news New features
|
||||
|
||||
@section news_31 New features in 3.1
|
||||
|
||||
These are the release highlights. For a full list of changes see the
|
||||
[version history](http://www.glfw.org/changelog.html).
|
||||
|
||||
|
||||
@subsection news_31_cursor Custom mouse cursor images
|
||||
|
||||
GLFW now supports creating and setting both custom cursor images and standard
|
||||
cursor shapes. They are created with @ref glfwCreateCursor or @ref
|
||||
glfwCreateStandardCursor, set with @ref glfwSetCursor and destroyed with @ref
|
||||
glfwDestroyCursor.
|
||||
|
||||
@see @ref cursor_object
|
||||
|
||||
|
||||
@subsection news_31_drop Path drop event
|
||||
|
||||
GLFW now provides a callback for receiving the paths of files and directories
|
||||
dropped onto GLFW windows. The callback is set with @ref glfwSetDropCallback.
|
||||
|
||||
@see @ref path_drop
|
||||
|
||||
|
||||
@subsection news_31_emptyevent Main thread wake-up
|
||||
|
||||
GLFW now provides the @ref glfwPostEmptyEvent function for posting an empty
|
||||
event from another thread to the main thread event queue, causing @ref
|
||||
glfwWaitEvents to return.
|
||||
|
||||
@see @ref events
|
||||
|
||||
|
||||
@subsection news_31_framesize Window frame size query
|
||||
|
||||
GLFW now supports querying the size, on each side, of the frame around the
|
||||
client area of a window, with @ref glfwGetWindowFrameSize.
|
||||
|
||||
@see [Window size](@ref window_size)
|
||||
|
||||
|
||||
@subsection news_31_autoiconify Simultaneous multi-monitor rendering
|
||||
|
||||
GLFW now supports disabling auto-iconification of full screen windows with
|
||||
the [GLFW_AUTO_ICONIFY](@ref window_hints_wnd) window hint. This is intended
|
||||
for people building multi-monitor installations, where you need windows to stay
|
||||
in full screen despite losing input focus.
|
||||
|
||||
|
||||
@subsection news_31_floating Floating windows
|
||||
|
||||
GLFW now supports floating windows, also called topmost or always on top, for
|
||||
easier debugging with the [GLFW_FLOATING](@ref window_hints_wnd) window hint.
|
||||
|
||||
|
||||
@subsection news_31_focused Initially unfocused windows
|
||||
|
||||
GLFW now supports preventing a windowed mode window from gaining input focus on
|
||||
creation, with the [GLFW_FOCUSED](@ref window_hints_wnd) window hint.
|
||||
|
||||
|
||||
@subsection news_31_direct Direct access for window attributes and cursor position
|
||||
|
||||
GLFW now queries the window input focus, visibility and iconification attributes
|
||||
and the cursor position directly instead of returning cached data.
|
||||
|
||||
|
||||
@subsection news_31_libovr Better interoperability with Oculus Rift
|
||||
|
||||
GLFW now provides native access functions for the OS level handles corresponding
|
||||
to monitor objects, as well as a [brief guide](@ref rift). It is also regularly
|
||||
tested for compatibility with the latest version of LibOVR (0.4.4 on release).
|
||||
|
||||
|
||||
@subsection news_31_charmods Character with modifiers callback
|
||||
|
||||
GLFW now provides a callback for character events with modifier key bits. The
|
||||
callback is set with @ref glfwSetCharModsCallback. Unlike the regular character
|
||||
callback, this will report character events that will not result in a character
|
||||
being input, for example if the Control key is held down.
|
||||
|
||||
@see @ref input_char
|
||||
|
||||
|
||||
@subsection news_31_single Single buffered framebuffers
|
||||
|
||||
GLFW now supports the creation of single buffered windows, with the
|
||||
[GLFW_DOUBLEBUFFER](@ref window_hints_fb) window hint.
|
||||
|
||||
|
||||
@subsection news_31_glext Macro for including extension header
|
||||
|
||||
GLFW now includes the extension header appropriate for the chosen OpenGL or
|
||||
OpenGL ES header when [GLFW_INCLUDE_GLEXT](@ref build_macros) is defined. GLFW
|
||||
does not provide these headers. They must be provided by your development
|
||||
environment or your OpenGL or OpenGL ES SDK.
|
||||
|
||||
|
||||
@subsection news_31_release Context release behaviors
|
||||
|
||||
GLFW now supports controlling whether the pipeline is flushed when a context is
|
||||
made non-current, with the
|
||||
[GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref window_hints_ctx) window hint, provided the
|
||||
machine supports the `GL_KHR_context_flush_control` extension.
|
||||
|
||||
|
||||
@subsection news_31_wayland (Experimental) Wayland support
|
||||
|
||||
GLFW now has an _experimental_ Wayland display protocol backend that can be
|
||||
selected on Linux with a CMake option.
|
||||
|
||||
|
||||
@subsection news_31_mir (Experimental) Mir support
|
||||
|
||||
GLFW now has an _experimental_ Mir display server backend that can be selected
|
||||
on Linux with a CMake option.
|
||||
|
||||
|
||||
@section news_30 New features in 3.0
|
||||
|
||||
These are the release highlights. For a full list of changes see the
|
||||
[version history](http://www.glfw.org/changelog.html).
|
||||
|
||||
|
||||
@subsection news_30_cmake CMake build system
|
||||
|
||||
GLFW now uses the CMake build system instead of the various makefiles and
|
||||
project files used by earlier versions. CMake is available for all platforms
|
||||
supported by GLFW, is present in most package systems and can generate
|
||||
makefiles and/or project files for most popular development environments.
|
||||
|
||||
For more information on how to use CMake, see the
|
||||
[CMake manual](http://cmake.org/cmake/help/documentation.html).
|
||||
|
||||
|
||||
@subsection news_30_multiwnd Multi-window support
|
||||
|
||||
GLFW now supports the creation of multiple windows, each with their own OpenGL
|
||||
or OpenGL ES context, and all window functions now take a window handle. Event
|
||||
callbacks are now per-window and are provided with the handle of the window that
|
||||
received the event. The @ref glfwMakeContextCurrent function has been added to
|
||||
select which context is current on a given thread.
|
||||
|
||||
|
||||
@subsection news_30_multimon Multi-monitor support
|
||||
|
||||
GLFW now explicitly supports multiple monitors. They can be enumerated with
|
||||
@ref glfwGetMonitors, queried with @ref glfwGetVideoModes, @ref
|
||||
glfwGetMonitorPos, @ref glfwGetMonitorName and @ref glfwGetMonitorPhysicalSize,
|
||||
and specified at window creation to make the newly created window full screen on
|
||||
that specific monitor.
|
||||
|
||||
|
||||
@subsection news_30_unicode Unicode support
|
||||
|
||||
All string arguments to GLFW functions and all strings returned by GLFW now use
|
||||
the UTF-8 encoding. This includes the window title, error string, clipboard
|
||||
text, monitor and joystick names as well as the extension function arguments (as
|
||||
ASCII is a subset of UTF-8).
|
||||
|
||||
|
||||
@subsection news_30_clipboard Clipboard text I/O
|
||||
|
||||
GLFW now supports reading and writing plain text to and from the system
|
||||
clipboard, with the @ref glfwGetClipboardString and @ref glfwSetClipboardString
|
||||
functions.
|
||||
|
||||
|
||||
@subsection news_30_gamma Gamma ramp support
|
||||
|
||||
GLFW now supports setting and reading back the gamma ramp of monitors, with the
|
||||
@ref glfwGetGammaRamp and @ref glfwSetGammaRamp functions. There is also @ref
|
||||
glfwSetGamma, which generates a ramp from a gamma value and then sets it.
|
||||
|
||||
|
||||
@subsection news_30_gles OpenGL ES support
|
||||
|
||||
GLFW now supports the creation of OpenGL ES contexts, by setting the
|
||||
`GLFW_CLIENT_API` window hint to `GLFW_OPENGL_ES_API`, where creation of such
|
||||
contexts are supported. Note that GLFW _does not implement_ OpenGL ES, so your
|
||||
driver must provide support in a way usable by GLFW. Modern Nvidia and Intel
|
||||
drivers support creation of OpenGL ES context using the GLX and WGL APIs, while
|
||||
AMD provides an EGL implementation instead.
|
||||
|
||||
|
||||
@subsection news_30_egl (Experimental) EGL support
|
||||
|
||||
GLFW now has an experimental EGL context creation back end that can be selected
|
||||
through CMake options.
|
||||
|
||||
|
||||
@subsection news_30_hidpi High-DPI support
|
||||
|
||||
GLFW now supports high-DPI monitors on both Windows and OS X, giving windows full
|
||||
resolution framebuffers where other UI elements are scaled up. To achieve this,
|
||||
@ref glfwGetFramebufferSize and @ref glfwSetFramebufferSizeCallback have been
|
||||
added. These work with pixels, while the rest of the GLFW API works with screen
|
||||
coordinates. This is important as OpenGL uses pixels, not screen coordinates.
|
||||
|
||||
|
||||
@subsection news_30_error Error callback
|
||||
|
||||
GLFW now has an error callback, which can provide your application with much
|
||||
more detailed diagnostics than was previously possible. The callback is passed
|
||||
an error code and a description string.
|
||||
|
||||
|
||||
@subsection news_30_wndptr Per-window user pointer
|
||||
|
||||
Each window now has a user-defined pointer, retrieved with @ref
|
||||
glfwGetWindowUserPointer and set with @ref glfwSetWindowUserPointer, to make it
|
||||
easier to integrate GLFW into C++ code.
|
||||
|
||||
|
||||
@subsection news_30_iconifyfun Window iconification callback
|
||||
|
||||
Each window now has a callback for iconification and restoration events,
|
||||
which is set with @ref glfwSetWindowIconifyCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndposfun Window position callback
|
||||
|
||||
Each window now has a callback for position events, which is set with @ref
|
||||
glfwSetWindowPosCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndpos Window position query
|
||||
|
||||
The position of a window can now be retrieved using @ref glfwGetWindowPos.
|
||||
|
||||
|
||||
@subsection news_30_focusfun Window focus callback
|
||||
|
||||
Each windows now has a callback for focus events, which is set with @ref
|
||||
glfwSetWindowFocusCallback.
|
||||
|
||||
|
||||
@subsection news_30_enterleave Cursor enter/leave callback
|
||||
|
||||
Each window now has a callback for when the mouse cursor enters or leaves its
|
||||
client area, which is set with @ref glfwSetCursorEnterCallback.
|
||||
|
||||
|
||||
@subsection news_30_wndtitle Initial window title
|
||||
|
||||
The title of a window is now specified at creation time, as one of the arguments
|
||||
to @ref glfwCreateWindow.
|
||||
|
||||
|
||||
@subsection news_30_hidden Hidden windows
|
||||
|
||||
Windows can now be hidden with @ref glfwHideWindow, shown using @ref
|
||||
glfwShowWindow and created initially hidden with the `GLFW_VISIBLE` window hint.
|
||||
This allows for off-screen rendering in a way compatible with most drivers, as
|
||||
well as moving a window to a specific position before showing it.
|
||||
|
||||
|
||||
@subsection news_30_undecorated Undecorated windows
|
||||
|
||||
Windowed mode windows can now be created without decorations, i.e. things like
|
||||
a frame, a title bar, with the `GLFW_DECORATED` window hint. This allows for
|
||||
the creation of things like splash screens.
|
||||
|
||||
|
||||
@subsection news_30_keymods Modifier key bit masks
|
||||
|
||||
[Modifier key bit mask](@ref mods) parameters have been added to the
|
||||
[mouse button](@ref GLFWmousebuttonfun) and [key](@ref GLFWkeyfun) callbacks.
|
||||
|
||||
|
||||
@subsection news_30_scancode Platform-specific scancodes
|
||||
|
||||
A scancode parameter has been added to the [key callback](@ref GLFWkeyfun). Keys
|
||||
that don't have a [key token](@ref keys) still get passed on with the key
|
||||
parameter set to `GLFW_KEY_UNKNOWN`. These scancodes will vary between machines
|
||||
and are intended to be used for key bindings.
|
||||
|
||||
|
||||
@subsection news_30_jsname Joystick names
|
||||
|
||||
The name of a joystick can now be retrieved using @ref glfwGetJoystickName.
|
||||
|
||||
|
||||
@subsection news_30_doxygen Doxygen documentation
|
||||
|
||||
You are reading it.
|
||||
|
||||
*/
|
328
examples/common/glfw/docs/quick.dox
Normal file
328
examples/common/glfw/docs/quick.dox
Normal file
|
@ -0,0 +1,328 @@
|
|||
/*!
|
||||
|
||||
@page quick Getting started
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide takes you through writing a simple application using GLFW 3. The
|
||||
application will create a window and OpenGL context, render a rotating triangle
|
||||
and exit when the user closes the window or presses Escape. This guide will
|
||||
introduce a few of the most commonly used functions, but there are many more.
|
||||
|
||||
This guide assumes no experience with earlier versions of GLFW. If you
|
||||
have used GLFW 2 in the past, read the @ref moving guide, as some functions
|
||||
behave differently in GLFW 3.
|
||||
|
||||
|
||||
@section quick_steps Step by step
|
||||
|
||||
@subsection quick_include Including the GLFW header
|
||||
|
||||
In the source files of your application where you use OpenGL or GLFW, you need
|
||||
to include the GLFW 3 header file.
|
||||
|
||||
@code
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
This defines all the constants, types and function prototypes of the GLFW API.
|
||||
It also includes the OpenGL header, and defines all the constants and types
|
||||
necessary for it to work on your platform.
|
||||
|
||||
For example, under Windows you are normally required to include `windows.h`
|
||||
before including `GL/gl.h`. This would make your source file tied to Windows
|
||||
and pollute your code's namespace with the whole Win32 API.
|
||||
|
||||
Instead, the GLFW header takes care of this for you, not by including
|
||||
`windows.h`, but rather by itself duplicating only the necessary parts of it.
|
||||
It does this only where needed, so if `windows.h` _is_ included, the GLFW header
|
||||
does not try to redefine those symbols.
|
||||
|
||||
In other words:
|
||||
|
||||
- Do _not_ include the OpenGL headers yourself, as GLFW does this for you
|
||||
- Do _not_ include `windows.h` or other platform-specific headers unless
|
||||
you plan on using those APIs directly
|
||||
- If you _do_ need to include such headers, do it _before_ including the
|
||||
GLFW one and it will detect this
|
||||
|
||||
Starting with version 3.0, the GLU header `glu.h` is no longer included by
|
||||
default. If you wish to include it, define `GLFW_INCLUDE_GLU` before the
|
||||
inclusion of the GLFW header.
|
||||
|
||||
@code
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GLFW/glfw3.h>
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection quick_init_term Initializing and terminating GLFW
|
||||
|
||||
Before you can use most GLFW functions, the library must be initialized. On
|
||||
successful initialization, `GL_TRUE` is returned. If an error occurred,
|
||||
`GL_FALSE` is returned.
|
||||
|
||||
@code
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
@endcode
|
||||
|
||||
When you are done using GLFW, typically just before the application exits, you
|
||||
need to terminate GLFW.
|
||||
|
||||
@code
|
||||
glfwTerminate();
|
||||
@endcode
|
||||
|
||||
This destroys any remaining windows and releases any other resources allocated by
|
||||
GLFW. After this call, you must initialize GLFW again before using any GLFW
|
||||
functions that require it.
|
||||
|
||||
|
||||
@subsection quick_capture_error Setting an error callback
|
||||
|
||||
Most events are reported through callbacks, whether it's a key being pressed,
|
||||
a GLFW window being moved, or an error occurring. Callbacks are simply
|
||||
C functions (or C++ static methods) that are called by GLFW with arguments
|
||||
describing the event.
|
||||
|
||||
In case a GLFW function fails, an error is reported to the GLFW error callback.
|
||||
You can receive these reports with an error callback. This function must have
|
||||
the signature below. This simple error callback just prints the error
|
||||
description to `stderr`.
|
||||
|
||||
@code
|
||||
void error_callback(int error, const char* description)
|
||||
{
|
||||
fputs(description, stderr);
|
||||
}
|
||||
@endcode
|
||||
|
||||
Callback functions must be set, so GLFW knows to call them. The function to set
|
||||
the error callback is one of the few GLFW functions that may be called before
|
||||
initialization, which lets you be notified of errors both during and after
|
||||
initialization.
|
||||
|
||||
@code
|
||||
glfwSetErrorCallback(error_callback);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection quick_create_window Creating a window and context
|
||||
|
||||
The window and its OpenGL context are created with a single call, which returns
|
||||
a handle to the created combined window and context object. For example, this
|
||||
creates a 640 by 480 windowed mode window with an OpenGL context:
|
||||
|
||||
@code
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
|
||||
@endcode
|
||||
|
||||
If window or context creation fails, `NULL` will be returned, so it is necessary
|
||||
to check the return value.
|
||||
|
||||
@code
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@endcode
|
||||
|
||||
The window handle is passed to all window related functions and is provided to
|
||||
along to all window related callbacks, so they can tell which window received
|
||||
the event.
|
||||
|
||||
When a window is no longer needed, destroy it.
|
||||
|
||||
@code
|
||||
glfwDestroyWindow(window);
|
||||
@endcode
|
||||
|
||||
Once this function is called, no more events will be delivered for that window
|
||||
and its handle becomes invalid.
|
||||
|
||||
|
||||
@subsection quick_context_current Making the OpenGL context current
|
||||
|
||||
Before you can use the OpenGL API, you must have a current OpenGL context.
|
||||
|
||||
@code
|
||||
glfwMakeContextCurrent(window);
|
||||
@endcode
|
||||
|
||||
The context will remain current until you make another context current or until
|
||||
the window owning the current context is destroyed.
|
||||
|
||||
|
||||
@subsection quick_window_close Checking the window close flag
|
||||
|
||||
Each window has a flag indicating whether the window should be closed.
|
||||
|
||||
When the user attempts to close the window, either by pressing the close widget
|
||||
in the title bar or using a key combination like Alt+F4, this flag is set to 1.
|
||||
Note that __the window isn't actually closed__, so you are expected to monitor
|
||||
this flag and either destroy the window or give some kind of feedback to the
|
||||
user.
|
||||
|
||||
@code
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
// Keep running
|
||||
}
|
||||
@endcode
|
||||
|
||||
You can be notified when the user is attempting to close the window by setting
|
||||
a close callback with @ref glfwSetWindowCloseCallback. The callback will be
|
||||
called immediately after the close flag has been set.
|
||||
|
||||
You can also set it yourself with @ref glfwSetWindowShouldClose. This can be
|
||||
useful if you want to interpret other kinds of input as closing the window, like
|
||||
for example pressing the escape key.
|
||||
|
||||
|
||||
@subsection quick_key_input Receiving input events
|
||||
|
||||
Each window has a large number of callbacks that can be set to receive all the
|
||||
various kinds of events. To receive key press and release events, create a key
|
||||
callback function.
|
||||
|
||||
@code
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
}
|
||||
@endcode
|
||||
|
||||
The key callback, like other window related callbacks, are set per-window.
|
||||
|
||||
@code
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
@endcode
|
||||
|
||||
In order for event callbacks to be called when events occur, you need to process
|
||||
events as described below.
|
||||
|
||||
|
||||
@subsection quick_render Rendering with OpenGL
|
||||
|
||||
Once you have a current OpenGL context, you can use OpenGL normally. In this
|
||||
tutorial, a multi-colored rotating triangle will be rendered. The framebuffer
|
||||
size needs to be retrieved for `glViewport`.
|
||||
|
||||
@code
|
||||
int width, height;
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
@endcode
|
||||
|
||||
You can also set a framebuffer size callback using @ref
|
||||
glfwSetFramebufferSizeCallback and call `glViewport` from there.
|
||||
|
||||
|
||||
@subsection quick_timer Reading the timer
|
||||
|
||||
To create smooth animation, a time source is needed. GLFW provides a timer that
|
||||
returns the number of seconds since initialization. The time source used is the
|
||||
most accurate on each platform and generally has micro- or nanosecond
|
||||
resolution.
|
||||
|
||||
@code
|
||||
double time = glfwGetTime();
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection quick_swap_buffers Swapping buffers
|
||||
|
||||
GLFW windows by default use double buffering. That means that each window has
|
||||
two rendering buffers; a front buffer and a back buffer. The front buffer is
|
||||
the one being displayed and the back buffer the one you render to.
|
||||
|
||||
When the entire frame has been rendered, the buffers need to be swapped with one
|
||||
another, so the back buffer becomes the front buffer and vice versa.
|
||||
|
||||
@code
|
||||
glfwSwapBuffers(window);
|
||||
@endcode
|
||||
|
||||
The swap interval indicates how many frames to wait until swapping the buffers,
|
||||
commonly known as _vsync_. By default, the swap interval is zero, meaning
|
||||
buffer swapping will occur immediately. On fast machines, many of those frames
|
||||
will never be seen, as the screen is still only updated typically 60-75 times
|
||||
per second, so this wastes a lot of CPU and GPU cycles.
|
||||
|
||||
Also, because the buffers will be swapped in the middle the screen update,
|
||||
leading to [screen tearing](https://en.wikipedia.org/wiki/Screen_tearing).
|
||||
|
||||
For these reasons, applications will typically want to set the swap interval to
|
||||
one. It can be set to higher values, but this is usually not recommended,
|
||||
because of the input latency it leads to.
|
||||
|
||||
@code
|
||||
glfwSwapInterval(1);
|
||||
@endcode
|
||||
|
||||
This function acts on the current context and will fail unless a context is
|
||||
current.
|
||||
|
||||
|
||||
@subsection quick_process_events Processing events
|
||||
|
||||
GLFW needs to communicate regularly with the window system both in order to
|
||||
receive events and to show that the application hasn't locked up. Event
|
||||
processing must be done regularly while you have visible windows and is normally
|
||||
done each frame after buffer swapping.
|
||||
|
||||
There are two methods for processing pending events; polling and waiting. This
|
||||
example will use event polling, which processes only those events that have
|
||||
already been received and then returns immediately.
|
||||
|
||||
@code
|
||||
glfwPollEvents();
|
||||
@endcode
|
||||
|
||||
This is the best choice when rendering continually, like most games do. If
|
||||
instead you only need to update your rendering once you have received new input,
|
||||
@ref glfwWaitEvents is a better choice. It waits until at least one event has
|
||||
been received, putting the thread to sleep in the meantime, and then processes
|
||||
all received events. This saves a great deal of CPU cycles and is useful for,
|
||||
for example, many kinds of editing tools.
|
||||
|
||||
|
||||
@section quick_example Putting it together
|
||||
|
||||
Now that you know how to initialize GLFW, create a window and poll for
|
||||
keyboard input, it's possible to create a simple program.
|
||||
|
||||
@snippet simple.c code
|
||||
|
||||
This program creates a 640 by 480 windowed mode window and starts a loop that
|
||||
clears the screen, renders a triangle and processes events until the user either
|
||||
presses Escape or closes the window.
|
||||
|
||||
This program uses only a few of the many functions GLFW provides. There are
|
||||
guides for each of the areas covered by GLFW. Each guide will introduce all the
|
||||
functions for that category.
|
||||
|
||||
- @ref intro
|
||||
- @ref window
|
||||
- @ref context
|
||||
- @ref monitor
|
||||
- @ref input
|
||||
|
||||
|
||||
@section quick_build Compiling and linking the program
|
||||
|
||||
The complete program above can be found in the source distribution as
|
||||
`examples/simple.c` and is compiled along with all other examples when you
|
||||
build GLFW. That is, if you have compiled GLFW then you have already built this
|
||||
as `simple.exe` on Windows, `simple` on Linux or `simple.app` on OS X.
|
||||
|
||||
This tutorial ends here. Once you have written a program that uses GLFW, you
|
||||
will need to compile and link it. How to do that depends on the development
|
||||
environment you are using and is best explained by the documentation for that
|
||||
environment. To learn about the details that are specific to GLFW, see
|
||||
@ref build.
|
||||
|
||||
*/
|
199
examples/common/glfw/docs/rift.dox
Normal file
199
examples/common/glfw/docs/rift.dox
Normal file
|
@ -0,0 +1,199 @@
|
|||
/*!
|
||||
|
||||
@page rift Oculus Rift guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide is intended to fill in the gaps between the
|
||||
[Oculus PC SDK documentation](https://developer.oculus.com/documentation/) and
|
||||
the rest of the GLFW documentation and is not a replacement for either. It
|
||||
requires you to use [native access](@ref native) and assumes a certain level of
|
||||
proficiency with LibOVR, platform specific APIs and your chosen development
|
||||
environment.
|
||||
|
||||
While GLFW has no explicit support for LibOVR, it is tested with and tries to
|
||||
interoperate well with it.
|
||||
|
||||
@note Because of the speed of development of the Oculus SDK, this guide may
|
||||
become outdated before the next release. If this is a local copy of the
|
||||
documentation, you may want to check the GLFW website for updates. This
|
||||
revision of the guide is written against version 0.4.4 of the SDK.
|
||||
|
||||
|
||||
@section rift_include Including the LibOVR and GLFW header files
|
||||
|
||||
Both the OpenGL LibOVR header and the GLFW native header need macros telling
|
||||
them what OS you are building for. Because LibOVR only supports three major
|
||||
desktop platforms, this can be solved with canonical predefined macros.
|
||||
|
||||
@code
|
||||
#if defined(_WIN32)
|
||||
#define GLFW_EXPOSE_NATIVE_WIN32
|
||||
#define GLFW_EXPOSE_NATIVE_WGL
|
||||
#define OVR_OS_WIN32
|
||||
#elif defined(__APPLE__)
|
||||
#define GLFW_EXPOSE_NATIVE_COCOA
|
||||
#define GLFW_EXPOSE_NATIVE_NSGL
|
||||
#define OVR_OS_MAC
|
||||
#elif defined(__linux__)
|
||||
#define GLFW_EXPOSE_NATIVE_X11
|
||||
#define GLFW_EXPOSE_NATIVE_GLX
|
||||
#define OVR_OS_LINUX
|
||||
#endif
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <GLFW/glfw3native.h>
|
||||
|
||||
#include <OVR_CAPI_GL.h>
|
||||
@endcode
|
||||
|
||||
Both the GLFW and LibOVR headers by default attempt to include the standard
|
||||
OpenGL `GL/gl.h` header (`OpenGL/gl.h` on OS X). If you wish to use a different
|
||||
standard header or an [extension loading library](@ref context_glext_auto),
|
||||
include that header before these.
|
||||
|
||||
|
||||
@section rift_init Initializing LibOVR and GLFW
|
||||
|
||||
LibOVR needs to be initialized before GLFW. This means calling at least
|
||||
`ovr_Initialize`, `ovrHmd_Create` and `ovrHmd_ConfigureTracking` before @ref
|
||||
glfwInit. Similarly, LibOVR must be shut down after GLFW. This means calling
|
||||
`ovrHmd_Destroy` and `ovr_Shutdown` after @ref glfwTerminate.
|
||||
|
||||
|
||||
@section rift_direct Direct HMD mode
|
||||
|
||||
Direct HMD mode is the recommended display mode for new applications, but the
|
||||
Oculus Rift runtime currently (January 2015) only supports this mode on Windows.
|
||||
In direct mode the HMD is not detectable as a GLFW monitor.
|
||||
|
||||
|
||||
@subsection rift_direct_create Creating a window and context
|
||||
|
||||
If the HMD is in direct mode you can use either a full screen or a windowed mode
|
||||
window, but full screen is only recommended if there is a monitor that supports
|
||||
the resolution of the HMD. Due to limitations in LibOVR, the size of the client
|
||||
area of the window must equal the resolution of the HMD.
|
||||
|
||||
If the resolution of the HMD is much larger than the regular monitor, the window
|
||||
may be resized by the window manager on creation. One way to avoid this is to
|
||||
make it undecorated with the [GLFW_DECORATED](@ref window_hints_wnd) window
|
||||
hint.
|
||||
|
||||
|
||||
@subsection rift_direct_attach Attaching the window to the HMD
|
||||
|
||||
Once you have created the window and context, you need to attach the native
|
||||
handle of the GLFW window to the HMD.
|
||||
|
||||
@code
|
||||
ovrHmd_AttachToWindow(hmd, glfwGetWin32Window(window), NULL, NULL);
|
||||
@endcode
|
||||
|
||||
|
||||
@section rift_extend Extend Desktop mode
|
||||
|
||||
Extend desktop mode is a legacy display mode, but is still (January 2015) the
|
||||
only available mode on OS X and Linux, as well as on Windows machines that for
|
||||
technical reasons do not yet support direct HMD mode.
|
||||
|
||||
|
||||
@subsection rift_extend_detect Detecting a HMD with GLFW
|
||||
|
||||
If the HMD is in extend desktop mode you can deduce which GLFW monitor it
|
||||
corresponds to and create a full screen window on that monitor.
|
||||
|
||||
On Windows, the native display device name of a GLFW monitor corresponds to the
|
||||
display device name of the detected HMD as stored, in the `DisplayDeviceName`
|
||||
member of `ovrHmdDesc`.
|
||||
|
||||
On OS X, the native display ID of a GLFW monitor corresponds to the display ID
|
||||
of the detected HMD, as stored in the `DisplayId` member of `ovrHmdDesc`.
|
||||
|
||||
At the time of writing (January 2015), the Oculus SDK does not support detecting
|
||||
which monitor corresponds to the HMD in any sane fashion, but as long as the HMD
|
||||
is set up and rotated properly it can be found via the screen position and
|
||||
resolution provided by LibOVR. This method may instead find another monitor
|
||||
that is mirroring the HMD, but this only matters if you intend to change its
|
||||
video mode.
|
||||
|
||||
@code
|
||||
int i, count;
|
||||
GLFWmonitor** monitors = glfwGetMonitors(&count);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
if (strcmp(glfwGetWin32Monitor(monitors[i]), hmd->DisplayDeviceName) == 0)
|
||||
return monitors[i];
|
||||
#elif defined(__APPLE__)
|
||||
if (glfwGetCocoaMonitor(monitors[i]) == hmd->DisplayId)
|
||||
return monitors[i];
|
||||
#elif defined(__linux__)
|
||||
int xpos, ypos;
|
||||
const GLFWvidmode* mode = glfwGetVideoMode(monitors[i]);
|
||||
glfwGetMonitorPos(monitors[i], &xpos, &ypos);
|
||||
|
||||
if (hmd->WindowsPos.x == xpos &&
|
||||
hmd->WindowsPos.y == ypos &&
|
||||
hmd->Resolution.w == mode->width &&
|
||||
hmd->Resolution.h == mode->height)
|
||||
{
|
||||
return monitors[i];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection rift_extend_create Creating a window and context
|
||||
|
||||
The window is created as a regular full screen window on the found monitor. It
|
||||
is usually a good idea to create a
|
||||
[windowed full screen](@ref window_windowed_full_screen) window, as the HMD will
|
||||
very likely already be set to the correct video mode. However, in extend
|
||||
desktop mode it behaves like a regular monitor and any supported video mode can
|
||||
be requested.
|
||||
|
||||
If other monitors are mirroring the HMD and you request a different video mode,
|
||||
all monitors in the mirroring set will get the new video mode.
|
||||
|
||||
|
||||
@section rift_render Rendering to the HMD
|
||||
|
||||
@subsection rift_render_sdk SDK distortion rendering
|
||||
|
||||
If you wish to use SDK distortion rendering you will need some information from
|
||||
GLFW to configure the renderer. Below are the parts of the `ovrGLConfig` union
|
||||
that need to be filled with from GLFW. Note that there are other fields that
|
||||
also need to be filled for `ovrHmd_ConfigureRendering` to succeed.
|
||||
|
||||
Before configuring SDK distortion rendering you should make your context
|
||||
current.
|
||||
|
||||
@code
|
||||
int width, height;
|
||||
union ovrGLConfig config;
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
|
||||
config.OGL.Header.BackBufferSize.w = width;
|
||||
config.OGL.Header.BackBufferSize.h = height;
|
||||
#if defined(_WIN32)
|
||||
config.OGL.Window = glfwGetWin32Window(window);
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(__linux__)
|
||||
config.OGL.Disp = glfwGetX11Display();
|
||||
#endif
|
||||
@endcode
|
||||
|
||||
When using SDK distortion rendering you should not swap the buffers yourself, as
|
||||
the HMD is updated by `ovrHmd_EndFrame`.
|
||||
|
||||
|
||||
@subsection rift_render_custom Client distortion rendering
|
||||
|
||||
With client distortion rendering you are in full control of the contents of the
|
||||
HMD and should render and swap the buffers normally.
|
||||
|
||||
*/
|
872
examples/common/glfw/docs/spaces.svg
Normal file
872
examples/common/glfw/docs/spaces.svg
Normal file
|
@ -0,0 +1,872 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="688.48718"
|
||||
height="327.98221"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="spaces.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<marker
|
||||
inkscape:stockid="Arrow2Lend"
|
||||
orient="auto"
|
||||
refY="0.0"
|
||||
refX="0.0"
|
||||
id="Arrow2Lend"
|
||||
style="overflow:visible;">
|
||||
<path
|
||||
id="path3888"
|
||||
style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
|
||||
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
|
||||
transform="scale(1.1) rotate(180) translate(1,0)" />
|
||||
</marker>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="2.5611424"
|
||||
inkscape:cx="344.24359"
|
||||
inkscape:cy="163.9911"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="svg2"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1021"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="30"
|
||||
inkscape:window-maximized="1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
units="px"
|
||||
showborder="false"
|
||||
inkscape:showpageshadow="false" />
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(-12.627039,-339.86462)">
|
||||
<rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#0000ff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:3,3;stroke-dashoffset:0"
|
||||
id="rect2985"
|
||||
width="687.36469"
|
||||
height="326.85971"
|
||||
x="13.188287"
|
||||
y="340.42587"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<rect
|
||||
style="fill:#f3fff3;fill-opacity:1;stroke:#00b800;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3757"
|
||||
width="318.05698"
|
||||
height="277.04684"
|
||||
x="38.315689"
|
||||
y="366.05841"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<rect
|
||||
style="fill:#f3fff3;fill-opacity:1;stroke:#00b800;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3767"
|
||||
width="319.01456"
|
||||
height="198.09369"
|
||||
x="356.36722"
|
||||
y="366.01291"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;text-align:start;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3769">
|
||||
<path
|
||||
d="m 365.3732,374.63632 0,2.73926 1.24023,0 c 0.45898,0 0.8138,-0.11881 1.06446,-0.35645 0.25064,-0.23762 0.37597,-0.57616 0.37597,-1.01562 0,-0.43619 -0.12533,-0.77311 -0.37597,-1.01074 -0.25066,-0.23763 -0.60548,-0.35644 -1.06446,-0.35645 l -1.24023,0 m -0.98633,-0.81054 2.22656,0 c 0.81706,0 1.43392,0.18555 1.85059,0.55664 0.41992,0.36784 0.62988,0.9082 0.62988,1.62109 0,0.7194 -0.20996,1.26302 -0.62988,1.63086 -0.41667,0.36784 -1.03353,0.55176 -1.85059,0.55176 l -1.24023,0 0,2.92968 -0.98633,0 0,-7.29003"
|
||||
style="font-size:10px"
|
||||
id="path3281" />
|
||||
<path
|
||||
d="m 373.37613,376.48691 c -0.10092,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0147 0.0749,0.007 0.15788,0.0179 0.24903,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3283" />
|
||||
<path
|
||||
d="m 374.32828,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3285" />
|
||||
<path
|
||||
d="m 381.35953,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68033,-0.28808 1.10352,-0.28808 0.56965,0 1.0091,0.2002 1.31836,0.60058 0.30923,0.39714 0.46385,0.96355 0.46386,1.69922 l 0,3.30078 -0.90332,0 0,-3.27148 c 0,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18555,-0.2539 -0.46875,-0.38086 -0.84961,-0.38086 -0.4655,0 -0.83334,0.15463 -1.10351,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40528,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c 0,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18555,-0.2539 -0.472,-0.38086 -0.85937,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27019,0.30925 -0.40528,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62662,-0.23926 1.02051,-0.23926 0.39713,0 0.73404,0.10092 1.01074,0.30273 0.27994,0.20183 0.48665,0.4948 0.62012,0.87891"
|
||||
style="font-size:10px"
|
||||
id="path3287" />
|
||||
<path
|
||||
d="m 389.33316,378.36679 c -0.72591,0 -1.22884,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44923 -0.41992,0.84961 0,0.31902 0.10416,0.57292 0.3125,0.76172 0.21159,0.18555 0.49804,0.27832 0.85937,0.27832 0.49805,0 0.89681,-0.17578 1.19629,-0.52734 0.30273,-0.35482 0.4541,-0.82519 0.45411,-1.41113 l 0,-0.2002 -0.89356,0 m 1.79199,-0.37109 0,3.12011 -0.89843,0 0,-0.83007 c -0.20509,0.33203 -0.46062,0.5778 -0.76661,0.7373 -0.30599,0.15625 -0.68034,0.23438 -1.12304,0.23438 -0.5599,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32878,-0.31576 -0.49317,-0.73731 -0.49317,-1.26465 0,-0.61523 0.20508,-1.0791 0.61524,-1.3916 0.41341,-0.3125 1.02864,-0.46875 1.8457,-0.46875 l 1.25977,0 0,-0.0879 c -10e-6,-0.41341 -0.13673,-0.73242 -0.41016,-0.95704 -0.27019,-0.22786 -0.65105,-0.34179 -1.14258,-0.34179 -0.3125,0 -0.61686,0.0374 -0.91309,0.1123 -0.29622,0.0749 -0.58105,0.18718 -0.85449,0.33692 l 0,-0.83008 c 0.32878,-0.12695 0.64779,-0.22135 0.95703,-0.28321 0.30925,-0.0651 0.61035,-0.0977 0.90332,-0.0977 0.79102,0 1.38184,0.20508 1.77247,0.61523 0.39062,0.41016 0.58593,1.03191 0.58593,1.86524"
|
||||
style="font-size:10px"
|
||||
id="path3289" />
|
||||
<path
|
||||
d="m 396.14957,376.48691 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33203,-0.12696 -0.1172,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3291" />
|
||||
<path
|
||||
d="m 399.37711,381.62363 c -0.25391,0.65104 -0.50131,1.07584 -0.74219,1.27441 -0.24089,0.19857 -0.56315,0.29785 -0.9668,0.29785 l -0.71777,0 0,-0.75195 0.52734,0 c 0.2474,0 0.43945,-0.0586 0.57617,-0.17578 0.13672,-0.11719 0.28809,-0.39388 0.45411,-0.83008 l 0.16113,-0.41016 -2.21192,-5.38086 0.95215,0 1.70899,4.27735 1.70898,-4.27735 0.95215,0 -2.40234,5.97657"
|
||||
style="font-size:10px"
|
||||
id="path3293" />
|
||||
<path
|
||||
d="m 410.46109,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68034,-0.28808 1.10352,-0.28808 0.56965,0 1.00911,0.2002 1.31836,0.60058 0.30924,0.39714 0.46386,0.96355 0.46387,1.69922 l 0,3.30078 -0.90332,0 0,-3.27148 c -1e-5,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18556,-0.2539 -0.46876,-0.38086 -0.84961,-0.38086 -0.4655,0 -0.83334,0.15463 -1.10352,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40527,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c -10e-6,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18555,-0.2539 -0.47201,-0.38086 -0.85938,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27018,0.30925 -0.40527,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62663,-0.23926 1.02051,-0.23926 0.39713,0 0.73405,0.10092 1.01074,0.30273 0.27995,0.20183 0.48665,0.4948 0.62012,0.87891"
|
||||
style="font-size:10px"
|
||||
id="path3295" />
|
||||
<path
|
||||
d="m 418.06851,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3297" />
|
||||
<path
|
||||
d="m 426.60855,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41993,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.4834,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3299" />
|
||||
<path
|
||||
d="m 428.41031,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3301" />
|
||||
<path
|
||||
d="m 432.07242,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17187,-0.12858 -1.43554,-0.38574 -0.26368,-0.26041 -0.39551,-0.73242 -0.39551,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3303" />
|
||||
<path
|
||||
d="m 437.22867,376.27695 c -0.48178,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.13769,-0.56641 0.27995,-0.3776 0.41992,-0.89192 0.41993,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41993,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.13769,-0.57129 m 0,-0.76172 c 0.78124,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66894,2.10937 0,0.89519 -0.22298,1.59831 -0.66894,2.10938 -0.44597,0.50781 -1.05958,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66407,-2.10938 0,-0.89843 0.22136,-1.60156 0.66407,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3305" />
|
||||
<path
|
||||
d="m 444.39175,376.48691 c -0.10091,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.7373,-0.7373 0.30274,-0.16276 0.67057,-0.24414 1.10352,-0.24414 0.0618,0 0.1302,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3307" />
|
||||
<path
|
||||
d="m 449.39664,380.2955 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32551 0.42643,-0.5664 0.71289,-0.72265 0.28971,-0.1595 0.63476,-0.23926 1.03515,-0.23926 0.66406,0 1.2028,0.26368 1.61621,0.79101 0.41667,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20833,1.55274 -0.625,2.08008 -0.41341,0.52734 -0.95215,0.79102 -1.61621,0.79102 -0.40039,0 -0.74544,-0.0781 -1.03515,-0.23438 -0.28646,-0.1595 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c -1e-5,-0.6608 -0.13673,-1.17838 -0.41016,-1.55273 -0.27019,-0.3776 -0.64291,-0.5664 -1.11816,-0.56641 -0.47527,1e-5 -0.84961,0.18881 -1.12305,0.56641 -0.27018,0.37435 -0.40527,0.89193 -0.40527,1.55273 0,0.66081 0.13509,1.18002 0.40527,1.55762 0.27344,0.37435 0.64778,0.56152 1.12305,0.56152 0.47525,0 0.84797,-0.18717 1.11816,-0.56152 0.27343,-0.3776 0.41015,-0.89681 0.41016,-1.55762"
|
||||
style="font-size:10px"
|
||||
id="path3309" />
|
||||
<path
|
||||
d="m 456.99429,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -10e-6,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3311" />
|
||||
<path
|
||||
d="m 464.47476,375.8082 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27344,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78126,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33204,0.3418 -0.33203,0.61523 -10e-6,0.20834 0.0798,0.37273 0.23925,0.49317 0.15951,0.11719 0.48015,0.22949 0.96192,0.33691 l 0.30762,0.0684 c 0.63801,0.13672 1.09049,0.33041 1.35742,0.58106 0.27017,0.24739 0.40527,0.59407 0.40527,1.04004 0,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64942,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.3418,-0.35156 0.3418,-0.61524 0,-0.24413 -0.083,-0.43131 -0.24902,-0.56152 -0.16277,-0.13021 -0.52247,-0.25553 -1.07911,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11718 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24413 -0.37109,-0.57779 -0.37109,-1.00097 0,-0.51432 0.18229,-0.91146 0.54687,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55274,-0.41992 0.33202,0 0.64452,0.0244 0.9375,0.0732 0.29296,0.0488 0.56314,0.12208 0.81054,0.21973"
|
||||
style="font-size:10px"
|
||||
id="path3313" />
|
||||
<path
|
||||
d="m 466.20328,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3315" />
|
||||
<path
|
||||
d="m 469.86539,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.3955,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3317" />
|
||||
<path
|
||||
d="m 472.9025,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3319" />
|
||||
<path
|
||||
d="m 477.79507,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66244,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3321" />
|
||||
<path
|
||||
d="m 486.33511,377.81503 0,3.30078 -0.89843,0 0,-3.27148 c -1e-5,-0.51757 -0.10092,-0.90494 -0.30274,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75683,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42579,0.58594 0.32226,0.38737 0.48339,0.95866 0.48339,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3323" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#00b800;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3773">
|
||||
<path
|
||||
d="m 242.85294,625.22699 0,1.1543 c -0.44923,-0.21484 -0.87306,-0.375 -1.27149,-0.48047 -0.39844,-0.10546 -0.78321,-0.1582 -1.1543,-0.15821 -0.64453,10e-6 -1.14258,0.12501 -1.49414,0.375 -0.34765,0.25001 -0.52148,0.60548 -0.52148,1.06641 0,0.38673 0.11523,0.67969 0.3457,0.87891 0.23438,0.19532 0.67578,0.35352 1.32422,0.47461 l 0.71485,0.14648 c 0.8828,0.16797 1.53319,0.46485 1.95117,0.89063 0.42187,0.42187 0.6328,0.98828 0.63281,1.69921 -1e-5,0.84766 -0.28516,1.49024 -0.85547,1.92774 -0.56641,0.4375 -1.39844,0.65625 -2.49609,0.65625 -0.41407,0 -0.85547,-0.0469 -1.32422,-0.14063 -0.46485,-0.0937 -0.94727,-0.23242 -1.44727,-0.41601 l 0,-1.21875 c 0.48047,0.26953 0.95117,0.47266 1.41211,0.60937 0.46094,0.13672 0.91406,0.20508 1.35938,0.20508 0.67577,0 1.19726,-0.13281 1.56445,-0.39844 0.36718,-0.26562 0.55078,-0.64453 0.55078,-1.13671 0,-0.42969 -0.13282,-0.76563 -0.39844,-1.00782 -0.26172,-0.24218 -0.69336,-0.42382 -1.29492,-0.54492 l -0.7207,-0.14062 c -0.88282,-0.17578 -1.52149,-0.45117 -1.91602,-0.82618 -0.39453,-0.37499 -0.59179,-0.89647 -0.59179,-1.56445 0,-0.77343 0.27148,-1.3828 0.81445,-1.82812 0.54687,-0.44531 1.29882,-0.66796 2.25586,-0.66797 0.41015,10e-6 0.82812,0.0371 1.25391,0.11133 0.42577,0.0742 0.86132,0.18555 1.30664,0.33398"
|
||||
style=""
|
||||
id="path3355" />
|
||||
<path
|
||||
d="m 250.79239,630.13715 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96093,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16016,-0.45703 l 0,1.01953 c -0.38673,0.16407 -0.78321,0.28907 -1.18946,0.375 -0.40625,0.0859 -0.81836,0.12891 -1.23633,0.12891 -1.04687,0 -1.87695,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91406,-1.43359 -0.91406,-2.47266 0,-1.07421 0.28906,-1.92578 0.86719,-2.55469 0.58202,-0.6328 1.36523,-0.94921 2.3496,-0.94922 0.88281,10e-6 1.58008,0.28517 2.0918,0.85547 0.51562,0.56641 0.77343,1.3379 0.77344,2.31446 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49804,-1.41211 -0.32032,-0.35156 -0.7461,-0.52734 -1.27735,-0.52734 -0.60156,0 -1.08398,0.16992 -1.44726,0.50976 -0.35938,0.33985 -0.56641,0.81837 -0.6211,1.43555 l 3.84375,-0.006"
|
||||
style=""
|
||||
id="path3357" />
|
||||
<path
|
||||
d="m 257.28458,627.37738 0,1.00781 c -0.3047,-0.16796 -0.61134,-0.29296 -0.91993,-0.375 -0.30469,-0.0859 -0.61328,-0.1289 -0.92578,-0.1289 -0.69922,0 -1.24219,0.22266 -1.6289,0.66797 -0.38672,0.44141 -0.58008,1.0625 -0.58008,1.86328 0,0.80078 0.19336,1.42383 0.58008,1.86914 0.38671,0.4414 0.92968,0.66211 1.6289,0.66211 0.3125,0 0.62109,-0.041 0.92578,-0.12305 0.30859,-0.0859 0.61523,-0.21289 0.91993,-0.38086 l 0,0.99609 c -0.30079,0.14063 -0.61329,0.2461 -0.9375,0.31641 -0.32032,0.0703 -0.66212,0.10547 -1.02539,0.10547 -0.98829,0 -1.77344,-0.31055 -2.35547,-0.93164 -0.58204,-0.62109 -0.87305,-1.45898 -0.87305,-2.51367 0,-1.07031 0.29297,-1.91211 0.87891,-2.52539 0.58984,-0.61328 1.39648,-0.91992 2.41992,-0.91993 0.33203,10e-6 0.65624,0.0352 0.97265,0.10547 0.31641,0.0664 0.62305,0.16798 0.91993,0.30469"
|
||||
style=""
|
||||
id="path3359" />
|
||||
<path
|
||||
d="m 261.71426,627.88129 c -0.57812,0 -1.03515,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33594,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.0293,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33594,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67383,0.3047 2.20899,0.91407 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
|
||||
style=""
|
||||
id="path3361" />
|
||||
<path
|
||||
d="m 271.96231,629.72699 0,3.96094 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08594 -0.36329,-1.39454 -0.24219,-0.30858 -0.60547,-0.46288 -1.08984,-0.46289 -0.58203,10e-6 -1.04102,0.18556 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70899 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39453 0.56055,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.2129,-0.29297 0.7539,10e-6 1.32421,0.23439 1.71093,0.70313 0.38672,0.46485 0.58007,1.15039 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3363" />
|
||||
<path
|
||||
d="m 278.44278,628.12152 0,-3.55078 1.07812,0 0,9.11719 -1.07812,0 0,-0.98438 c -0.22657,0.39063 -0.51368,0.68164 -0.86133,0.87305 -0.34375,0.1875 -0.75781,0.28125 -1.24219,0.28125 -0.79297,0 -1.43945,-0.31641 -1.93945,-0.94922 -0.49609,-0.63281 -0.74414,-1.46484 -0.74414,-2.49609 0,-1.03125 0.24805,-1.86328 0.74414,-2.4961 0.5,-0.6328 1.14648,-0.94921 1.93945,-0.94922 0.48438,10e-6 0.89844,0.0957 1.24219,0.28711 0.34765,0.18751 0.63476,0.47657 0.86133,0.86719 m -3.67383,2.29102 c 0,0.79297 0.16211,1.41601 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34766,0.67383 0.5703,0 1.01952,-0.22461 1.34765,-0.67383 0.32812,-0.45313 0.49218,-1.07617 0.49219,-1.86914 -1e-5,-0.79297 -0.16407,-1.41406 -0.49219,-1.86328 -0.32813,-0.45312 -0.77735,-0.67969 -1.34765,-0.67969 -0.57032,0 -1.01954,0.22657 -1.34766,0.67969 -0.32422,0.44922 -0.48633,1.07031 -0.48633,1.86328"
|
||||
style=""
|
||||
id="path3365" />
|
||||
<path
|
||||
d="m 284.72403,630.3891 c -0.8711,0 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53906 -0.5039,1.01953 -1e-5,0.38281 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63282 0.36328,-0.42578 0.54492,-0.99023 0.54493,-1.69336 l 0,-0.24023 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.9961 c -0.2461,0.39844 -0.55274,0.69336 -0.91993,0.88477 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.37891 -0.5918,-0.88477 -0.5918,-1.51758 0,-0.73828 0.24609,-1.29492 0.73828,-1.66992 0.49609,-0.375 1.23437,-0.5625 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32423,-0.27343 -0.78126,-0.41015 -1.3711,-0.41015 -0.375,0 -0.74023,0.0449 -1.0957,0.13476 -0.35547,0.0899 -0.69727,0.22462 -1.02539,0.4043 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33985 0.37109,-0.0781 0.73242,-0.11718 1.08398,-0.11719 0.94922,10e-6 1.6582,0.2461 2.12696,0.73829 0.46874,0.49219 0.70311,1.23828 0.70312,2.23828"
|
||||
style=""
|
||||
id="path3367" />
|
||||
<path
|
||||
d="m 292.90372,628.13324 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,10e-6 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39453 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88477,-0.88477 0.36327,-0.1953 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3369" />
|
||||
<path
|
||||
d="m 296.77676,634.2973 c -0.30469,0.78125 -0.60156,1.29102 -0.89062,1.5293 -0.28907,0.23828 -0.67578,0.35742 -1.16016,0.35742 l -0.86133,0 0,-0.90234 0.63282,0 c 0.29687,0 0.52734,-0.0703 0.6914,-0.21094 0.16406,-0.14063 0.3457,-0.47266 0.54493,-0.99609 l 0.19335,-0.49219 -2.65429,-6.45703 1.14258,0 2.05078,5.13281 2.05078,-5.13281 1.14258,0 -2.88282,7.17187"
|
||||
style=""
|
||||
id="path3371" />
|
||||
<path
|
||||
d="m 305.01505,624.93988 1.76367,0 2.23242,5.95313 2.24414,-5.95313 1.76367,0 0,8.74805 -1.1543,0 0,-7.68164 -2.25585,6 -1.18946,0 -2.25586,-6 0,7.68164 -1.14843,0 0,-8.74805"
|
||||
style=""
|
||||
id="path3373" />
|
||||
<path
|
||||
d="m 317.87051,627.88129 c -0.57812,0 -1.03515,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33594,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.0293,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33594,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67383,0.3047 2.20899,0.91407 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79687,-2.53125 -10e-6,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
|
||||
style=""
|
||||
id="path3375" />
|
||||
<path
|
||||
d="m 328.11856,629.72699 0,3.96094 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08594 -0.36329,-1.39454 -0.24219,-0.30858 -0.60547,-0.46288 -1.08984,-0.46289 -0.58203,10e-6 -1.04102,0.18556 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70899 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39453 0.56055,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.2129,-0.29297 0.7539,10e-6 1.32421,0.23439 1.71093,0.70313 0.38672,0.46485 0.58007,1.15039 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3377" />
|
||||
<path
|
||||
d="m 330.28067,627.12543 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55469 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3379" />
|
||||
<path
|
||||
d="m 334.6752,625.26215 0,1.86328 2.2207,0 0,0.83789 -2.2207,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14843,0.15234 0.44726,0.22851 0.89648,0.22851 l 1.10742,0 0,0.90235 -1.10742,0 c -0.83203,0 -1.40625,-0.1543 -1.72265,-0.46289 -0.31641,-0.3125 -0.47461,-0.87891 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
|
||||
style=""
|
||||
id="path3381" />
|
||||
<path
|
||||
d="m 340.8627,627.88129 c -0.57813,0 -1.03516,0.22656 -1.37109,0.67968 -0.33594,0.44923 -0.50391,1.06641 -0.50391,1.85157 0,0.78516 0.16602,1.4043 0.49805,1.85742 0.33593,0.44922 0.79492,0.67383 1.37695,0.67383 0.57422,0 1.02929,-0.22656 1.36524,-0.67969 0.33593,-0.45312 0.5039,-1.07031 0.5039,-1.85156 0,-0.77734 -0.16797,-1.39258 -0.5039,-1.84571 -0.33595,-0.45702 -0.79102,-0.68554 -1.36524,-0.68554 m 0,-0.91407 c 0.9375,10e-6 1.67382,0.3047 2.20899,0.91407 0.53515,0.60938 0.80272,1.45313 0.80273,2.53125 -10e-6,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53517,0.60937 -1.27149,0.91406 -2.20899,0.91406 -0.94141,0 -1.67969,-0.30469 -2.21484,-0.91406 -0.53125,-0.61328 -0.79688,-1.45703 -0.79688,-2.53125 0,-1.07812 0.26563,-1.92187 0.79688,-2.53125 0.53515,-0.60937 1.27343,-0.91406 2.21484,-0.91407"
|
||||
style=""
|
||||
id="path3383" />
|
||||
<path
|
||||
d="m 349.4584,628.13324 c -0.12109,-0.0703 -0.25391,-0.12109 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,10e-6 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39453 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88477 0.36328,-0.1953 0.80469,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3385" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#00b800;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3777">
|
||||
<path
|
||||
d="m 575.27002,547.52673 0,3.28711 1.48828,0 c 0.55078,10e-6 0.97656,-0.14257 1.27734,-0.42773 0.30078,-0.28515 0.45117,-0.6914 0.45118,-1.21875 -10e-6,-0.52343 -0.1504,-0.92773 -0.45118,-1.21289 -0.30078,-0.28515 -0.72656,-0.42773 -1.27734,-0.42774 l -1.48828,0 m -1.18359,-0.97265 2.67187,0 c 0.98046,10e-6 1.7207,0.22266 2.2207,0.66797 0.5039,0.44141 0.75586,1.08985 0.75586,1.94531 0,0.86328 -0.25196,1.51563 -0.75586,1.95703 -0.5,0.44141 -1.24024,0.66211 -2.2207,0.66211 l -1.48828,0 0,3.51562 -1.18359,0 0,-8.74804"
|
||||
style=""
|
||||
id="path3326" />
|
||||
<path
|
||||
d="m 584.87354,549.74744 c -0.1211,-0.0703 -0.25392,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52148,-0.69336 0.88477,-0.88477 0.36327,-0.19531 0.80468,-0.29296 1.32421,-0.29297 0.0742,10e-6 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
|
||||
style=""
|
||||
id="path3328" />
|
||||
<path
|
||||
d="m 586.01611,548.73962 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55468 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3330" />
|
||||
<path
|
||||
d="m 594.45361,549.99939 c 0.26953,-0.48437 0.59179,-0.84179 0.9668,-1.07227 0.37499,-0.23046 0.8164,-0.34569 1.32422,-0.3457 0.68358,10e-6 1.21093,0.24024 1.58203,0.7207 0.37108,0.47657 0.55663,1.15626 0.55664,2.03907 l 0,3.96093 -1.08398,0 0,-3.92578 c -10e-6,-0.6289 -0.11134,-1.0957 -0.33399,-1.40039 -0.22266,-0.30468 -0.56251,-0.45702 -1.01953,-0.45703 -0.5586,10e-6 -1.00001,0.18555 -1.32422,0.55664 -0.32422,0.3711 -0.48633,0.87696 -0.48633,1.51758 l 0,3.70898 -1.08398,0 0,-3.92578 c -1e-5,-0.63281 -0.11133,-1.0996 -0.33398,-1.40039 -0.22267,-0.30468 -0.56642,-0.45702 -1.03125,-0.45703 -0.55079,10e-6 -0.98829,0.18751 -1.3125,0.5625 -0.32423,0.3711 -0.48634,0.87501 -0.48633,1.51172 l 0,3.70898 -1.08399,0 0,-6.5625 1.08399,0 0,1.01954 c 0.24609,-0.40234 0.54101,-0.69922 0.88476,-0.89063 0.34375,-0.1914 0.75195,-0.2871 1.22461,-0.28711 0.47656,10e-6 0.88086,0.1211 1.21289,0.36328 0.33593,0.2422 0.58398,0.59376 0.74414,1.05469"
|
||||
style=""
|
||||
id="path3332" />
|
||||
<path
|
||||
d="m 604.02197,552.0033 c -0.87109,0 -1.47461,0.0996 -1.81054,0.29882 -0.33594,0.19923 -0.50391,0.53907 -0.50391,1.01954 0,0.38281 0.125,0.6875 0.375,0.91406 0.2539,0.22265 0.59765,0.33398 1.03125,0.33398 0.59765,0 1.07617,-0.21093 1.43555,-0.63281 0.36327,-0.42578 0.54491,-0.99023 0.54492,-1.69336 l 0,-0.24023 -1.07227,0 m 2.15039,-0.44532 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39844 -0.55274,0.69336 -0.91992,0.88477 -0.36719,0.1875 -0.81641,0.28125 -1.34766,0.28125 -0.67188,0 -1.20703,-0.1875 -1.60547,-0.5625 -0.39453,-0.37891 -0.5918,-0.88477 -0.5918,-1.51758 0,-0.73828 0.2461,-1.29492 0.73829,-1.66992 0.49609,-0.375 1.23437,-0.5625 2.21484,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32422,-0.27343 -0.78125,-0.41015 -1.37109,-0.41016 -0.37501,10e-6 -0.74024,0.0449 -1.09571,0.13477 -0.35547,0.0898 -0.69726,0.22461 -1.02539,0.4043 l 0,-0.9961 c 0.39453,-0.15234 0.77735,-0.26562 1.14844,-0.33984 0.37109,-0.0781 0.73242,-0.11718 1.08399,-0.11719 0.94921,10e-6 1.65819,0.2461 2.12695,0.73828 0.46874,0.4922 0.70312,1.23829 0.70312,2.23828"
|
||||
style=""
|
||||
id="path3334" />
|
||||
<path
|
||||
d="m 612.20166,549.74744 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52149,-0.69336 0.88477,-0.88477 0.36328,-0.19531 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
|
||||
style=""
|
||||
id="path3336" />
|
||||
<path
|
||||
d="m 616.07471,555.9115 c -0.30469,0.78125 -0.60157,1.29101 -0.89063,1.5293 -0.28906,0.23827 -0.67578,0.35742 -1.16015,0.35742 l -0.86133,0 0,-0.90235 0.63281,0 c 0.29687,0 0.52734,-0.0703 0.69141,-0.21093 0.16406,-0.14063 0.3457,-0.47266 0.54492,-0.9961 l 0.19336,-0.49218 -2.6543,-6.45704 1.14258,0 2.05078,5.13282 2.05078,-5.13282 1.14258,0 -2.88281,7.17188"
|
||||
style=""
|
||||
id="path3338" />
|
||||
<path
|
||||
d="m 624.31299,546.55408 1.76367,0 2.23242,5.95312 2.24414,-5.95312 1.76367,0 0,8.74804 -1.15429,0 0,-7.68164 -2.25586,6 -1.18945,0 -2.25586,-6 0,7.68164 -1.14844,0 0,-8.74804"
|
||||
style=""
|
||||
id="path3340" />
|
||||
<path
|
||||
d="m 637.16846,549.49548 c -0.57813,10e-6 -1.03516,0.22657 -1.3711,0.67969 -0.33594,0.44922 -0.5039,1.06641 -0.5039,1.85156 0,0.78516 0.16601,1.4043 0.49804,1.85743 0.33594,0.44921 0.79492,0.67382 1.37696,0.67382 0.57421,0 1.02929,-0.22656 1.36523,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -10e-6,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36523,-0.68555 m 0,-0.91406 c 0.93749,10e-6 1.67382,0.30469 2.20898,0.91406 0.53515,0.60938 0.80273,1.45313 0.80274,2.53125 -10e-6,1.07422 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.60938 -1.27149,0.91407 -2.20898,0.91407 -0.94141,0 -1.67969,-0.30469 -2.21485,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21485,-0.91406"
|
||||
style=""
|
||||
id="path3342" />
|
||||
<path
|
||||
d="m 647.4165,551.34119 0,3.96093 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60548,-0.46288 -1.08985,-0.46289 -0.58203,10e-6 -1.04101,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.25781,-0.39453 0.56055,-0.68945 0.90821,-0.88477 0.35156,-0.19531 0.75585,-0.29296 1.21289,-0.29297 0.7539,10e-6 1.32421,0.23438 1.71094,0.70313 0.38671,0.46485 0.58007,1.15039 0.58007,2.05664"
|
||||
style=""
|
||||
id="path3344" />
|
||||
<path
|
||||
d="m 649.57861,548.73962 1.07813,0 0,6.5625 -1.07813,0 0,-6.5625 m 0,-2.55468 1.07813,0 0,1.36523 -1.07813,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3346" />
|
||||
<path
|
||||
d="m 653.97314,546.87634 0,1.86328 2.22071,0 0,0.83789 -2.22071,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14844,0.15235 0.44726,0.22852 0.89649,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83204,0 -1.40626,-0.15429 -1.72266,-0.46289 -0.31641,-0.3125 -0.47461,-0.8789 -0.47461,-1.69922 l 0,-3.5625 -0.79102,0 0,-0.83789 0.79102,0 0,-1.86328 1.08398,0"
|
||||
style=""
|
||||
id="path3348" />
|
||||
<path
|
||||
d="m 660.16064,549.49548 c -0.57812,10e-6 -1.03515,0.22657 -1.37109,0.67969 -0.33594,0.44922 -0.50391,1.06641 -0.50391,1.85156 0,0.78516 0.16602,1.4043 0.49805,1.85743 0.33594,0.44921 0.79492,0.67382 1.37695,0.67382 0.57422,0 1.0293,-0.22656 1.36524,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -1e-5,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36524,-0.68555 m 0,-0.91406 c 0.9375,10e-6 1.67383,0.30469 2.20899,0.91406 0.53515,0.60938 0.80273,1.45313 0.80273,2.53125 0,1.07422 -0.26758,1.91797 -0.80273,2.53125 -0.53516,0.60938 -1.27149,0.91407 -2.20899,0.91407 -0.9414,0 -1.67968,-0.30469 -2.21484,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21484,-0.91406"
|
||||
style=""
|
||||
id="path3350" />
|
||||
<path
|
||||
d="m 668.75635,549.74744 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15235 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,0 -1.07813,0.19922 -1.40625,0.59765 -0.32422,0.39454 -0.48633,0.9629 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01954 c 0.22656,-0.39844 0.52148,-0.69336 0.88477,-0.88477 0.36328,-0.19531 0.80468,-0.29296 1.32422,-0.29297 0.0742,10e-6 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10743"
|
||||
style=""
|
||||
id="path3352" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#0000ff;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3781">
|
||||
<path
|
||||
d="m 612.64136,657.77118 -3.33985,-8.74805 1.23633,0 2.77149,7.36524 2.77734,-7.36524 1.23047,0 -3.33399,8.74805 -1.34179,0"
|
||||
style=""
|
||||
id="path3401" />
|
||||
<path
|
||||
d="m 618.28394,651.20868 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55469 1.07812,0 0,1.36524 -1.07812,0 0,-1.36524"
|
||||
style=""
|
||||
id="path3403" />
|
||||
<path
|
||||
d="m 625.41479,652.21649 c -0.12109,-0.0703 -0.25391,-0.12109 -0.39843,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,1e-5 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39454 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88476,-0.88477 0.36328,-0.1953 0.80469,-0.29296 1.32422,-0.29296 0.0742,0 0.15625,0.006 0.2461,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3405" />
|
||||
<path
|
||||
d="m 627.62378,649.3454 0,1.86328 2.2207,0 0,0.83789 -2.2207,0 0,3.5625 c 0,0.53516 0.0723,0.87891 0.2168,1.03125 0.14843,0.15234 0.44726,0.22852 0.89648,0.22852 l 1.10742,0 0,0.90234 -1.10742,0 c -0.83203,0 -1.40625,-0.1543 -1.72266,-0.46289 -0.3164,-0.3125 -0.47461,-0.87891 -0.47461,-1.69922 l 0,-3.5625 -0.79101,0 0,-0.83789 0.79101,0 0,-1.86328 1.08399,0"
|
||||
style=""
|
||||
id="path3407" />
|
||||
<path
|
||||
d="m 631.15698,655.18134 0,-3.97266 1.07813,0 0,3.93164 c 0,0.6211 0.12109,1.08789 0.36328,1.40039 0.24218,0.3086 0.60546,0.46289 1.08984,0.46289 0.58203,0 1.04101,-0.18554 1.37696,-0.55664 0.33983,-0.37109 0.50976,-0.87695 0.50976,-1.51758 l 0,-3.7207 1.07813,0 0,6.5625 -1.07813,0 0,-1.00781 c -0.26172,0.39843 -0.56641,0.69531 -0.91406,0.89062 -0.34376,0.19141 -0.74415,0.28711 -1.20117,0.28711 -0.75391,0 -1.32618,-0.23437 -1.7168,-0.70312 -0.39063,-0.46875 -0.58594,-1.1543 -0.58594,-2.05664 m 2.71289,-4.13086 0,0"
|
||||
style=""
|
||||
id="path3409" />
|
||||
<path
|
||||
d="m 641.86792,654.47235 c -0.8711,0 -1.47461,0.0996 -1.81055,0.29883 -0.33594,0.19922 -0.50391,0.53906 -0.5039,1.01953 -10e-6,0.38281 0.12499,0.6875 0.375,0.91406 0.2539,0.22266 0.59765,0.33399 1.03125,0.33399 0.59765,0 1.07616,-0.21094 1.43554,-0.63282 0.36328,-0.42577 0.54492,-0.99023 0.54493,-1.69335 l 0,-0.24024 -1.07227,0 m 2.15039,-0.44531 0,3.74414 -1.07812,0 0,-0.99609 c -0.2461,0.39843 -0.55274,0.69336 -0.91993,0.88476 -0.36719,0.1875 -0.81641,0.28125 -1.34765,0.28125 -0.67188,0 -1.20704,-0.1875 -1.60547,-0.5625 -0.39453,-0.3789 -0.5918,-0.88476 -0.5918,-1.51758 0,-0.73828 0.24609,-1.29492 0.73828,-1.66992 0.49609,-0.37499 1.23438,-0.56249 2.21485,-0.5625 l 1.51172,0 0,-0.10547 c -10e-6,-0.49609 -0.16407,-0.8789 -0.49219,-1.14844 -0.32423,-0.27343 -0.78126,-0.41015 -1.3711,-0.41015 -0.375,0 -0.74023,0.0449 -1.0957,0.13476 -0.35547,0.0899 -0.69727,0.22462 -1.02539,0.4043 l 0,-0.99609 c 0.39453,-0.15234 0.77734,-0.26562 1.14844,-0.33985 0.37109,-0.0781 0.73242,-0.11718 1.08398,-0.11718 0.94922,0 1.6582,0.2461 2.12696,0.73828 0.46874,0.49219 0.70311,1.23828 0.70312,2.23828"
|
||||
style=""
|
||||
id="path3411" />
|
||||
<path
|
||||
d="m 646.24487,648.65399 1.07813,0 0,9.11719 -1.07813,0 0,-9.11719"
|
||||
style=""
|
||||
id="path3413" />
|
||||
<path
|
||||
d="m 658.68433,649.31024 0,1.1543 c -0.44923,-0.21484 -0.87306,-0.37499 -1.27149,-0.48047 -0.39844,-0.10546 -0.78321,-0.1582 -1.1543,-0.1582 -0.64453,0 -1.14258,0.125 -1.49414,0.375 -0.34765,0.25 -0.52148,0.60547 -0.52148,1.0664 0,0.38673 0.11523,0.6797 0.3457,0.87891 0.23438,0.19532 0.67578,0.35352 1.32422,0.47461 l 0.71485,0.14648 c 0.8828,0.16798 1.53319,0.46485 1.95117,0.89063 0.42187,0.42188 0.6328,0.98828 0.63281,1.69922 -10e-6,0.84765 -0.28516,1.49023 -0.85547,1.92773 -0.56641,0.4375 -1.39844,0.65625 -2.49609,0.65625 -0.41407,0 -0.85547,-0.0469 -1.32422,-0.14062 -0.46485,-0.0937 -0.94727,-0.23243 -1.44727,-0.41602 l 0,-1.21875 c 0.48047,0.26953 0.95117,0.47266 1.41211,0.60938 0.46094,0.13672 0.91406,0.20507 1.35938,0.20507 0.67577,0 1.19726,-0.13281 1.56445,-0.39843 0.36718,-0.26563 0.55078,-0.64453 0.55078,-1.13672 0,-0.42969 -0.13282,-0.76562 -0.39844,-1.00782 -0.26172,-0.24218 -0.69336,-0.42382 -1.29492,-0.54492 l -0.7207,-0.14062 c -0.88282,-0.17578 -1.52149,-0.45117 -1.91602,-0.82617 -0.39453,-0.375 -0.59179,-0.89648 -0.59179,-1.56446 0,-0.77343 0.27148,-1.3828 0.81445,-1.82812 0.54687,-0.44531 1.29883,-0.66796 2.25586,-0.66797 0.41015,1e-5 0.82812,0.0371 1.25391,0.11133 0.42577,0.0742 0.86132,0.18555 1.30664,0.33398"
|
||||
style=""
|
||||
id="path3415" />
|
||||
<path
|
||||
d="m 665.73315,651.46063 0,1.00781 c -0.30469,-0.16796 -0.61133,-0.29296 -0.91992,-0.375 -0.30469,-0.0859 -0.61328,-0.1289 -0.92578,-0.1289 -0.69922,0 -1.24219,0.22266 -1.62891,0.66797 -0.38672,0.44141 -0.58008,1.0625 -0.58007,1.86328 -10e-6,0.80078 0.19335,1.42383 0.58007,1.86914 0.38672,0.44141 0.92969,0.66211 1.62891,0.66211 0.3125,0 0.62109,-0.041 0.92578,-0.12305 0.30859,-0.0859 0.61523,-0.21289 0.91992,-0.38086 l 0,0.9961 c -0.30078,0.14062 -0.61328,0.24609 -0.9375,0.3164 -0.32031,0.0703 -0.66211,0.10547 -1.02539,0.10547 -0.98828,0 -1.77344,-0.31055 -2.35547,-0.93164 -0.58203,-0.62109 -0.87304,-1.45898 -0.87304,-2.51367 0,-1.07031 0.29297,-1.91211 0.8789,-2.52539 0.58985,-0.61328 1.39649,-0.91992 2.41993,-0.91992 0.33202,0 0.65624,0.0352 0.97265,0.10546 0.3164,0.0664 0.62304,0.16798 0.91992,0.30469"
|
||||
style=""
|
||||
id="path3417" />
|
||||
<path
|
||||
d="m 671.42261,652.21649 c -0.1211,-0.0703 -0.25391,-0.12109 -0.39844,-0.15234 -0.14063,-0.0352 -0.29688,-0.0527 -0.46875,-0.0527 -0.60938,1e-5 -1.07813,0.19923 -1.40625,0.59766 -0.32422,0.39454 -0.48633,0.96289 -0.48633,1.70508 l 0,3.45703 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.22656,-0.39843 0.52148,-0.69335 0.88477,-0.88477 0.36328,-0.1953 0.80468,-0.29296 1.32422,-0.29296 0.0742,0 0.15624,0.006 0.24609,0.0176 0.0898,0.008 0.18945,0.0215 0.29883,0.041 l 0.006,1.10742"
|
||||
style=""
|
||||
id="path3419" />
|
||||
<path
|
||||
d="m 677.92065,654.2204 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26953,1.3086 0.66797,1.69922 0.40234,0.38672 0.96094,0.58008 1.67578,0.58008 0.41406,0 0.81445,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16016,-0.45703 l 0,1.01953 c -0.38672,0.16407 -0.78321,0.28907 -1.18945,0.375 -0.40626,0.0859 -0.81837,0.12891 -1.23633,0.12891 -1.04688,0 -1.87696,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91407,-1.43359 -0.91407,-2.47266 0,-1.07421 0.28906,-1.92577 0.86719,-2.55469 0.58203,-0.6328 1.36523,-0.94921 2.34961,-0.94921 0.88281,0 1.58007,0.28516 2.0918,0.85546 0.51562,0.56642 0.77343,1.3379 0.77343,2.31446 m -1.07812,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32031,-0.35155 -0.7461,-0.52734 -1.27734,-0.52734 -0.60157,0 -1.08399,0.16993 -1.44727,0.50976 -0.35937,0.33985 -0.56641,0.81837 -0.62109,1.43555 l 3.84375,-0.006"
|
||||
style=""
|
||||
id="path3421" />
|
||||
<path
|
||||
d="m 685.30347,654.2204 0,0.52734 -4.95703,0 c 0.0469,0.74219 0.26952,1.3086 0.66796,1.69922 0.40235,0.38672 0.96094,0.58008 1.67579,0.58008 0.41405,0 0.81444,-0.0508 1.20117,-0.15235 0.39062,-0.10156 0.77734,-0.2539 1.16015,-0.45703 l 0,1.01953 c -0.38672,0.16407 -0.78321,0.28907 -1.18945,0.375 -0.40625,0.0859 -0.81836,0.12891 -1.23633,0.12891 -1.04688,0 -1.87695,-0.30469 -2.49023,-0.91406 -0.60938,-0.60938 -0.91407,-1.43359 -0.91406,-2.47266 -10e-6,-1.07421 0.28906,-1.92577 0.86718,-2.55469 0.58203,-0.6328 1.36523,-0.94921 2.34961,-0.94921 0.88281,0 1.58008,0.28516 2.0918,0.85546 0.51562,0.56642 0.77343,1.3379 0.77344,2.31446 m -1.07813,-0.31641 c -0.008,-0.58984 -0.17383,-1.06054 -0.49805,-1.41211 -0.32031,-0.35155 -0.74609,-0.52734 -1.27734,-0.52734 -0.60156,0 -1.08399,0.16993 -1.44726,0.50976 -0.35938,0.33985 -0.56641,0.81837 -0.6211,1.43555 l 3.84375,-0.006"
|
||||
style=""
|
||||
id="path3423" />
|
||||
<path
|
||||
d="m 692.52808,653.81024 0,3.96094 -1.07813,0 0,-3.92578 c 0,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.24219,-0.30859 -0.60547,-0.46289 -1.08984,-0.46289 -0.58204,0 -1.04102,0.18555 -1.37696,0.55664 -0.33594,0.3711 -0.50391,0.87695 -0.5039,1.51757 l 0,3.70899 -1.08399,0 0,-6.5625 1.08399,0 0,1.01953 c 0.25781,-0.39452 0.56054,-0.68945 0.9082,-0.88477 0.35156,-0.1953 0.75586,-0.29296 1.21289,-0.29296 0.7539,0 1.32421,0.23438 1.71094,0.70312 0.38671,0.46485 0.58007,1.1504 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3425" />
|
||||
</g>
|
||||
<rect
|
||||
style="fill:#b8b8b8;fill-opacity:1;stroke:#b8b8b8;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
|
||||
id="rect5577"
|
||||
width="173.25098"
|
||||
height="141.43118"
|
||||
x="157.75581"
|
||||
y="436.97159" />
|
||||
<rect
|
||||
style="fill:#ededed;fill-opacity:1;stroke:#ededed;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="rect3789"
|
||||
width="168.99611"
|
||||
height="136.87178"
|
||||
x="159.87543"
|
||||
y="439.39697"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#454545;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3791">
|
||||
<path
|
||||
d="m 274.28683,558.98682 1.19532,0 1.83984,7.39453 1.83399,-7.39453 1.33007,0 1.83985,7.39453 1.83398,-7.39453 1.20117,0 -2.19726,8.74804 -1.48828,0 -1.84571,-7.59375 -1.86328,7.59375 -1.48828,0 -2.19141,-8.74804"
|
||||
style=""
|
||||
id="path3388" />
|
||||
<path
|
||||
d="m 286.62082,561.17236 1.07812,0 0,6.5625 -1.07812,0 0,-6.5625 m 0,-2.55468 1.07812,0 0,1.36523 -1.07812,0 0,-1.36523"
|
||||
style=""
|
||||
id="path3390" />
|
||||
<path
|
||||
d="m 295.40402,563.77393 0,3.96093 -1.07812,0 0,-3.92578 c -10e-6,-0.62109 -0.1211,-1.08593 -0.36328,-1.39453 -0.2422,-0.30859 -0.60548,-0.46288 -1.08985,-0.46289 -0.58203,1e-5 -1.04102,0.18555 -1.37695,0.55664 -0.33594,0.3711 -0.50391,0.87696 -0.50391,1.51758 l 0,3.70898 -1.08398,0 0,-6.5625 1.08398,0 0,1.01953 c 0.25781,-0.39452 0.56055,-0.68944 0.90821,-0.88476 0.35156,-0.19531 0.75585,-0.29296 1.21289,-0.29297 0.7539,1e-5 1.32421,0.23438 1.71093,0.70313 0.38672,0.46484 0.58008,1.15039 0.58008,2.05664"
|
||||
style=""
|
||||
id="path3392" />
|
||||
<path
|
||||
d="m 301.88449,562.16846 0,-3.55078 1.07813,0 0,9.11718 -1.07813,0 0,-0.98437 c -0.22657,0.39062 -0.51368,0.68164 -0.86133,0.87305 -0.34375,0.1875 -0.75781,0.28124 -1.24218,0.28125 -0.79298,-1e-5 -1.43946,-0.31641 -1.93946,-0.94922 -0.49609,-0.63281 -0.74414,-1.46485 -0.74414,-2.4961 0,-1.03124 0.24805,-1.86327 0.74414,-2.49609 0.5,-0.63281 1.14648,-0.94921 1.93946,-0.94922 0.48437,1e-5 0.89843,0.0957 1.24218,0.28711 0.34765,0.18751 0.63476,0.47657 0.86133,0.86719 m -3.67383,2.29101 c 0,0.79297 0.16211,1.41602 0.48633,1.86914 0.32812,0.44922 0.77734,0.67383 1.34766,0.67383 0.57031,0 1.01952,-0.22461 1.34765,-0.67383 0.32812,-0.45312 0.49219,-1.07617 0.49219,-1.86914 0,-0.79296 -0.16407,-1.41406 -0.49219,-1.86328 -0.32813,-0.45312 -0.77734,-0.67968 -1.34765,-0.67969 -0.57032,10e-6 -1.01954,0.22657 -1.34766,0.67969 -0.32422,0.44922 -0.48633,1.07032 -0.48633,1.86328"
|
||||
style=""
|
||||
id="path3394" />
|
||||
<path
|
||||
d="m 307.72629,561.92822 c -0.57813,10e-6 -1.03516,0.22657 -1.3711,0.67969 -0.33594,0.44922 -0.5039,1.06641 -0.5039,1.85156 0,0.78516 0.16601,1.4043 0.49804,1.85742 0.33594,0.44922 0.79492,0.67383 1.37696,0.67383 0.57421,0 1.02929,-0.22656 1.36523,-0.67968 0.33593,-0.45313 0.5039,-1.07031 0.50391,-1.85157 -1e-5,-0.77734 -0.16798,-1.39257 -0.50391,-1.8457 -0.33594,-0.45703 -0.79102,-0.68554 -1.36523,-0.68555 m 0,-0.91406 c 0.93749,1e-5 1.67382,0.30469 2.20898,0.91406 0.53515,0.60938 0.80273,1.45313 0.80274,2.53125 -10e-6,1.07422 -0.26759,1.91797 -0.80274,2.53125 -0.53516,0.60938 -1.27149,0.91406 -2.20898,0.91407 -0.94141,-1e-5 -1.67969,-0.30469 -2.21485,-0.91407 -0.53125,-0.61328 -0.79687,-1.45703 -0.79687,-2.53125 0,-1.07812 0.26562,-1.92187 0.79687,-2.53125 0.53516,-0.60937 1.27344,-0.91405 2.21485,-0.91406"
|
||||
style=""
|
||||
id="path3396" />
|
||||
<path
|
||||
d="m 311.8923,561.17236 1.07813,0 1.34765,5.1211 1.3418,-5.1211 1.27149,0 1.34765,5.1211 1.3418,-5.1211 1.07812,0 -1.71679,6.5625 -1.27149,0 -1.41211,-5.3789 -1.41797,5.3789 -1.27148,0 -1.7168,-6.5625"
|
||||
style=""
|
||||
id="path3398" />
|
||||
</g>
|
||||
<rect
|
||||
y="439.39581"
|
||||
x="159.87428"
|
||||
height="8.8251209"
|
||||
width="168.99841"
|
||||
id="rect3795"
|
||||
style="fill:#7b7bff;fill-opacity:1;stroke:#7b7bff;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3797"
|
||||
sodipodi:cx="352.54324"
|
||||
sodipodi:cy="373.03461"
|
||||
sodipodi:rx="2.5253813"
|
||||
sodipodi:ry="2.5253813"
|
||||
d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
|
||||
transform="matrix(0.66107369,0,0,0.66107369,123.32145,119.41326)"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<path
|
||||
transform="matrix(0.66107369,0,0,0.66107369,-194.73594,119.44704)"
|
||||
d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
|
||||
sodipodi:ry="2.5253813"
|
||||
sodipodi:rx="2.5253813"
|
||||
sodipodi:cy="373.03461"
|
||||
sodipodi:cx="352.54324"
|
||||
id="path3799"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
sodipodi:type="arc"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none"
|
||||
id="path3801"
|
||||
sodipodi:cx="352.54324"
|
||||
sodipodi:cy="373.03461"
|
||||
sodipodi:rx="2.5253813"
|
||||
sodipodi:ry="2.5253813"
|
||||
d="m 355.06862,373.03461 c 0,1.39473 -1.13065,2.52538 -2.52538,2.52538 -1.39473,0 -2.52538,-1.13065 -2.52538,-2.52538 0,-1.39473 1.13065,-2.52538 2.52538,-2.52538 1.39473,0 2.52538,1.13065 2.52538,2.52538 z"
|
||||
transform="matrix(0.66107369,0,0,0.66107369,-73.218648,201.61091)"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
x="21.213203"
|
||||
y="340.20465"
|
||||
id="text3803"
|
||||
sodipodi:linespacing="125%"
|
||||
inkscape:export-filename="/home/elmindreda/projects/glfw/glfw/docs/spaces.png"
|
||||
inkscape:export-xdpi="109.89113"
|
||||
inkscape:export-ydpi="109.89113"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan3805"
|
||||
x="21.213203"
|
||||
y="340.20465" /></text>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3807">
|
||||
<path
|
||||
d="m 71.179893,455.55557 0.996094,0 1.533203,6.16211 1.528321,-6.16211 1.108398,0 1.533203,6.16211 1.528321,-6.16211 1.000976,0 -1.831055,7.29004 -1.240234,0 -1.538086,-6.32812 -1.552734,6.32812 -1.240235,0 -1.826172,-7.29004"
|
||||
style="font-size:10px"
|
||||
id="path3164" />
|
||||
<path
|
||||
d="m 81.458214,457.37686 0.898437,0 0,5.46875 -0.898437,0 0,-5.46875 m 0,-2.1289 0.898437,0 0,1.13769 -0.898437,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3166" />
|
||||
<path
|
||||
d="m 88.77755,459.54483 0,3.30078 -0.898438,0 0,-3.27148 c -4e-6,-0.51758 -0.100916,-0.90495 -0.302734,-1.16211 -0.201827,-0.25716 -0.504561,-0.38574 -0.908203,-0.38574 -0.485029,0 -0.867516,0.15462 -1.147461,0.46386 -0.27995,0.30925 -0.419924,0.7308 -0.419922,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.214842,-0.32877 0.46712,-0.57454 0.756836,-0.7373 0.292966,-0.16276 0.629879,-0.24414 1.010742,-0.24414 0.628251,0 1.103511,0.19531 1.425781,0.58593 0.322261,0.38738 0.483393,0.95867 0.483399,1.71387"
|
||||
style="font-size:10px"
|
||||
id="path3168" />
|
||||
<path
|
||||
d="m 94.17794,458.20694 0,-2.95898 0.898438,0 0,7.59765 -0.898438,0 0,-0.82031 c -0.188806,0.32552 -0.428064,0.56803 -0.717773,0.72754 -0.286462,0.15625 -0.631514,0.23437 -1.035156,0.23437 -0.66081,0 -1.199546,-0.26367 -1.616211,-0.79101 -0.413412,-0.52735 -0.620118,-1.2207 -0.620117,-2.08008 -10e-7,-0.85937 0.206705,-1.55273 0.620117,-2.08008 0.416665,-0.52734 0.955401,-0.79101 1.616211,-0.79101 0.403642,0 0.748694,0.0797 1.035156,0.23925 0.289709,0.15626 0.528967,0.39714 0.717773,0.72266 m -3.061523,1.90918 c -2e-6,0.66081 0.135089,1.18001 0.405273,1.55762 0.273436,0.37435 0.647784,0.56152 1.123047,0.56152 0.475257,0 0.849606,-0.18717 1.123047,-0.56152 0.273433,-0.37761 0.410152,-0.89681 0.410156,-1.55762 -4e-6,-0.6608 -0.136723,-1.17838 -0.410156,-1.55273 -0.273441,-0.3776 -0.64779,-0.56641 -1.123047,-0.56641 -0.475263,0 -0.849611,0.18881 -1.123047,0.56641 -0.270184,0.37435 -0.405275,0.89193 -0.405273,1.55273"
|
||||
style="font-size:10px"
|
||||
id="path3170" />
|
||||
<path
|
||||
d="m 99.046104,458.00674 c -0.481773,1e-5 -0.862632,0.18881 -1.142578,0.56641 -0.279949,0.37435 -0.419923,0.88868 -0.419922,1.54297 -10e-7,0.6543 0.138345,1.17025 0.415039,1.54785 0.279946,0.37435 0.662433,0.56153 1.147461,0.56152 0.478513,1e-5 0.857744,-0.1888 1.137696,-0.5664 0.27994,-0.3776 0.41992,-0.89193 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53809 -0.279952,-0.38085 -0.659183,-0.57128 -1.137696,-0.57129 m 0,-0.76171 c 0.781247,0 1.394856,0.25391 1.840816,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44596,0.50782 -1.059569,0.76172 -1.840816,0.76172 -0.784507,0 -1.399741,-0.2539 -1.845703,-0.76172 -0.442709,-0.51106 -0.664063,-1.21419 -0.664062,-2.10937 -10e-7,-0.89843 0.221353,-1.60156 0.664062,-2.10938 0.445962,-0.5078 1.061196,-0.76171 1.845703,-0.76171"
|
||||
style="font-size:10px"
|
||||
id="path3172" />
|
||||
<path
|
||||
d="m 102.51778,457.37686 0.89844,0 1.12305,4.26758 1.11816,-4.26758 1.05957,0 1.12305,4.26758 1.11816,-4.26758 0.89844,0 -1.43066,5.46875 -1.05957,0 -1.17676,-4.48242 -1.18164,4.48242 -1.05957,0 -1.43067,-5.46875"
|
||||
style="font-size:10px"
|
||||
id="path3174" />
|
||||
<path
|
||||
d="m 115.27657,462.0253 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32552 0.42643,-0.5664 0.71289,-0.72266 0.28971,-0.1595 0.63477,-0.23925 1.03516,-0.23925 0.66406,0 1.20279,0.26367 1.61621,0.79101 0.41666,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20834,1.55273 -0.625,2.08008 -0.41342,0.52734 -0.95215,0.79101 -1.61621,0.79101 -0.40039,0 -0.74545,-0.0781 -1.03516,-0.23437 -0.28646,-0.15951 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c 0,-0.6608 -0.13672,-1.17838 -0.41015,-1.55273 -0.27019,-0.3776 -0.64291,-0.56641 -1.11817,-0.56641 -0.47526,0 -0.84961,0.18881 -1.12304,0.56641 -0.27019,0.37435 -0.40528,0.89193 -0.40528,1.55273 0,0.66081 0.13509,1.18001 0.40528,1.55762 0.27343,0.37435 0.64778,0.56152 1.12304,0.56152 0.47526,0 0.84798,-0.18717 1.11817,-0.56152 0.27343,-0.37761 0.41015,-0.89681 0.41015,-1.55762"
|
||||
style="font-size:10px"
|
||||
id="path3176" />
|
||||
<path
|
||||
d="m 122.87423,458.00674 c -0.48177,1e-5 -0.86263,0.18881 -1.14258,0.56641 -0.27995,0.37435 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56152 0.47851,1e-5 0.85774,-0.1888 1.13769,-0.5664 0.27995,-0.3776 0.41992,-0.89193 0.41993,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41993,-1.53809 -0.27995,-0.38085 -0.65918,-0.57128 -1.13769,-0.57129 m 0,-0.76171 c 0.78125,0 1.39485,0.25391 1.84082,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44597,0.50782 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.2539 -1.8457,-0.76172 -0.44271,-0.51106 -0.66407,-1.21419 -0.66407,-2.10937 0,-0.89843 0.22136,-1.60156 0.66407,-2.10938 0.44596,-0.5078 1.06119,-0.76171 1.8457,-0.76171"
|
||||
style="font-size:10px"
|
||||
id="path3178" />
|
||||
<path
|
||||
d="m 130.3547,457.53799 0,0.84961 c -0.25391,-0.1302 -0.51758,-0.22786 -0.79102,-0.29296 -0.27344,-0.0651 -0.55664,-0.0977 -0.84961,-0.0977 -0.44596,0 -0.78125,0.0684 -1.00586,0.20508 -0.22135,0.13672 -0.33203,0.3418 -0.33203,0.61523 0,0.20834 0.0797,0.37273 0.23926,0.49317 0.1595,0.11719 0.48014,0.22949 0.96191,0.33691 l 0.30762,0.0684 c 0.63802,0.13672 1.09049,0.33041 1.35742,0.58105 0.27018,0.2474 0.40527,0.59408 0.40528,1.04004 -1e-5,0.50782 -0.20183,0.90983 -0.60547,1.20606 -0.4004,0.29622 -0.95215,0.44433 -1.65528,0.44433 -0.29297,0 -0.59896,-0.0293 -0.91796,-0.0879 -0.31576,-0.0553 -0.64942,-0.13997 -1.00098,-0.2539 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98144,0.39063 0.32227,0.0846 0.64128,0.12695 0.95704,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14649 0.34179,-0.35157 0.3418,-0.61524 -1e-5,-0.24414 -0.083,-0.43131 -0.24903,-0.56152 -0.16276,-0.13021 -0.52246,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11719 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24414 -0.3711,-0.5778 -0.3711,-1.00098 0,-0.51431 0.18229,-0.91145 0.54688,-1.1914 0.36458,-0.27994 0.88216,-0.41992 1.55273,-0.41992 0.33203,0 0.64453,0.0244 0.9375,0.0732 0.29297,0.0488 0.56315,0.12207 0.81055,0.21972"
|
||||
style="font-size:10px"
|
||||
id="path3180" />
|
||||
<path
|
||||
d="m 132.08321,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3182" />
|
||||
<path
|
||||
d="m 135.74532,455.82413 0,1.55273 1.85059,0 0,0.69824 -1.85059,0 0,2.96875 c 0,0.44597 0.0602,0.73243 0.18067,0.85938 0.12369,0.12695 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26042 -0.39551,-0.73242 -0.39551,-1.41602 l 0,-2.96875 -0.65918,0 0,-0.69824 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3184" />
|
||||
<path
|
||||
d="m 138.78243,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3186" />
|
||||
<path
|
||||
d="m 143.67501,458.00674 c -0.48177,1e-5 -0.86263,0.18881 -1.14258,0.56641 -0.27995,0.37435 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56152 0.47851,1e-5 0.85774,-0.1888 1.1377,-0.5664 0.27994,-0.3776 0.41991,-0.89193 0.41992,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41992,-1.53809 -0.27996,-0.38085 -0.65919,-0.57128 -1.1377,-0.57129 m 0,-0.76171 c 0.78125,0 1.39485,0.25391 1.84082,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44597,0.50782 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.2539 -1.8457,-0.76172 -0.44271,-0.51106 -0.66407,-1.21419 -0.66406,-2.10937 -10e-6,-0.89843 0.22135,-1.60156 0.66406,-2.10938 0.44596,-0.5078 1.06119,-0.76171 1.8457,-0.76171"
|
||||
style="font-size:10px"
|
||||
id="path3188" />
|
||||
<path
|
||||
d="m 152.21505,459.54483 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51758 -0.10091,-0.90495 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.90821,-0.38574 -0.48502,0 -0.86751,0.15462 -1.14746,0.46386 -0.27995,0.30925 -0.41992,0.7308 -0.41992,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19531 1.42578,0.58593 0.32226,0.38738 0.48339,0.95867 0.4834,1.71387"
|
||||
style="font-size:10px"
|
||||
id="path3190" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3817">
|
||||
<path
|
||||
d="m 49.798271,374.06503 0,0.96192 c -0.374354,-0.17903 -0.727544,-0.3125 -1.05957,-0.40039 -0.332035,-0.0879 -0.652673,-0.13183 -0.961914,-0.13184 -0.537112,1e-5 -0.952151,0.10417 -1.245117,0.3125 -0.289716,0.20834 -0.434572,0.50456 -0.434571,0.88867 -10e-7,0.32227 0.09603,0.56641 0.288086,0.73242 0.195311,0.16277 0.563149,0.2946 1.103516,0.39551 l 0.595703,0.12207 c 0.735673,0.13998 1.277664,0.38738 1.625977,0.74219 0.351556,0.35157 0.527338,0.82357 0.527343,1.41602 -5e-6,0.70638 -0.237635,1.24186 -0.71289,1.60644 -0.47201,0.36458 -1.165369,0.54688 -2.080078,0.54688 -0.345055,0 -0.712893,-0.0391 -1.103516,-0.11719 -0.387371,-0.0781 -0.789389,-0.19369 -1.206055,-0.34668 l 0,-1.01563 c 0.40039,0.22461 0.792642,0.39388 1.176758,0.50782 0.384112,0.11393 0.761716,0.1709 1.132813,0.17089 0.563147,10e-6 0.997717,-0.11067 1.30371,-0.33203 0.305985,-0.22135 0.45898,-0.5371 0.458985,-0.94726 -5e-6,-0.35807 -0.110682,-0.63802 -0.332031,-0.83985 -0.218104,-0.20182 -0.577804,-0.35318 -1.079102,-0.4541 l -0.600586,-0.11719 c -0.735679,-0.14648 -1.267905,-0.37597 -1.59668,-0.68847 -0.328776,-0.3125 -0.493164,-0.74707 -0.493164,-1.30371 0,-0.64453 0.226236,-1.15234 0.678711,-1.52344 0.455728,-0.37109 1.082355,-0.55663 1.879883,-0.55664 0.341793,10e-6 0.6901,0.0309 1.044922,0.0928 0.354813,0.0619 0.717768,0.15463 1.088867,0.27832"
|
||||
style="font-size:10px"
|
||||
id="path3193" />
|
||||
<path
|
||||
d="m 56.414482,378.15683 0,0.43945 -4.130859,0 c 0.03906,0.61849 0.224607,1.0905 0.55664,1.41602 0.335284,0.32226 0.800779,0.4834 1.396485,0.4834 0.345048,0 0.678707,-0.0423 1.000976,-0.12696 0.325516,-0.0846 0.647782,-0.21158 0.966797,-0.38086 l 0,0.84961 c -0.322271,0.13672 -0.652674,0.24089 -0.991211,0.3125 -0.338546,0.0716 -0.68197,0.10743 -1.030273,0.10743 -0.872399,0 -1.56413,-0.25391 -2.075196,-0.76172 -0.507813,-0.50781 -0.761719,-1.19466 -0.761718,-2.06055 -10e-7,-0.89518 0.240884,-1.60481 0.722656,-2.12891 0.485024,-0.52733 1.137693,-0.79101 1.958008,-0.79101 0.735673,0 1.316727,0.23763 1.743164,0.71289 0.429682,0.47201 0.644525,1.11491 0.644531,1.92871 m -0.898437,-0.26367 c -0.0065,-0.49153 -0.144862,-0.88379 -0.415039,-1.17676 -0.266932,-0.29296 -0.621749,-0.43945 -1.064454,-0.43945 -0.501304,0 -0.903322,0.1416 -1.206054,0.4248 -0.299481,0.28321 -0.472007,0.68197 -0.517578,1.19629 l 3.203125,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3195" />
|
||||
<path
|
||||
d="m 61.824638,375.85703 0,0.83984 c -0.253911,-0.13997 -0.509444,-0.24414 -0.766601,-0.3125 -0.25391,-0.0716 -0.511072,-0.10742 -0.771485,-0.10742 -0.582685,0 -1.035158,0.18555 -1.357421,0.55664 -0.322268,0.36784 -0.4834,0.88542 -0.483399,1.55273 -10e-7,0.66732 0.161131,1.18653 0.483399,1.55762 0.322263,0.36784 0.774736,0.55176 1.357421,0.55176 0.260413,0 0.517575,-0.0342 0.771485,-0.10254 0.257157,-0.0716 0.51269,-0.17741 0.766601,-0.31738 l 0,0.83007 c -0.250655,0.11719 -0.511072,0.20508 -0.78125,0.26368 -0.266931,0.0586 -0.551761,0.0879 -0.854492,0.0879 -0.82357,0 -1.477866,-0.25879 -1.96289,-0.77637 -0.485027,-0.51758 -0.72754,-1.21582 -0.72754,-2.09473 0,-0.89192 0.24414,-1.59342 0.732422,-2.10449 0.491535,-0.51106 1.163735,-0.7666 2.016602,-0.7666 0.276689,0 0.546871,0.0293 0.810547,0.0879 0.263667,0.0553 0.519201,0.13998 0.766601,0.25391"
|
||||
style="font-size:10px"
|
||||
id="path3197" />
|
||||
<path
|
||||
d="m 65.516045,376.27695 c -0.481774,0 -0.862633,0.1888 -1.142579,0.5664 -0.279949,0.37436 -0.419923,0.88868 -0.419921,1.54297 -2e-6,0.6543 0.138344,1.17025 0.415039,1.54785 0.279945,0.37435 0.662432,0.56153 1.147461,0.56153 0.478512,0 0.857743,-0.1888 1.137695,-0.56641 0.279943,-0.3776 0.419917,-0.89192 0.419922,-1.54297 -5e-6,-0.64778 -0.139979,-1.16048 -0.419922,-1.53808 -0.279952,-0.38086 -0.659183,-0.57129 -1.137695,-0.57129 m 0,-0.76172 c 0.781246,0 1.394852,0.25391 1.84082,0.76172 0.445958,0.50781 0.66894,1.21094 0.668945,2.10937 -5e-6,0.89519 -0.222987,1.59831 -0.668945,2.10938 -0.445968,0.50781 -1.059574,0.76172 -1.84082,0.76172 -0.784508,0 -1.399742,-0.25391 -1.845704,-0.76172 -0.442709,-0.51107 -0.664063,-1.21419 -0.664062,-2.10938 -10e-7,-0.89843 0.221353,-1.60156 0.664062,-2.10937 0.445962,-0.50781 1.061196,-0.76172 1.845704,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3199" />
|
||||
<path
|
||||
d="m 74.056084,377.81503 0,3.30078 -0.898438,0 0,-3.27148 c -4e-6,-0.51757 -0.100916,-0.90494 -0.302734,-1.16211 -0.201827,-0.25716 -0.504561,-0.38574 -0.908203,-0.38574 -0.485029,0 -0.867516,0.15463 -1.147461,0.46387 -0.27995,0.30924 -0.419924,0.73079 -0.419922,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.214842,-0.32877 0.46712,-0.57454 0.756836,-0.7373 0.292966,-0.16276 0.629879,-0.24414 1.010742,-0.24414 0.628251,0 1.103511,0.19532 1.425781,0.58594 0.322261,0.38737 0.483393,0.95866 0.483399,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3201" />
|
||||
<path
|
||||
d="m 79.456474,376.47714 0,-2.95898 0.898438,0 0,7.59765 -0.898438,0 0,-0.82031 c -0.188806,0.32552 -0.428064,0.56804 -0.717773,0.72754 -0.286462,0.15625 -0.631514,0.23438 -1.035156,0.23438 -0.66081,0 -1.199546,-0.26368 -1.616211,-0.79102 -0.413413,-0.52734 -0.620118,-1.2207 -0.620118,-2.08008 0,-0.85937 0.206705,-1.55273 0.620118,-2.08008 0.416665,-0.52733 0.955401,-0.79101 1.616211,-0.79101 0.403642,0 0.748694,0.0798 1.035156,0.23926 0.289709,0.15625 0.528967,0.39714 0.717773,0.72265 m -3.061523,1.90918 c -2e-6,0.66081 0.135089,1.18002 0.405273,1.55762 0.273436,0.37435 0.647784,0.56152 1.123047,0.56152 0.475257,0 0.849606,-0.18717 1.123047,-0.56152 0.273433,-0.3776 0.410152,-0.89681 0.410156,-1.55762 -4e-6,-0.6608 -0.136723,-1.17838 -0.410156,-1.55273 -0.273441,-0.3776 -0.64779,-0.5664 -1.123047,-0.56641 -0.475263,1e-5 -0.849611,0.18881 -1.123047,0.56641 -0.270184,0.37435 -0.405275,0.89193 -0.405273,1.55273"
|
||||
style="font-size:10px"
|
||||
id="path3203" />
|
||||
<path
|
||||
d="m 84.690849,378.36679 c -0.725914,0 -1.228843,0.083 -1.508789,0.24902 -0.279949,0.16602 -0.419923,0.44923 -0.419922,0.84961 -10e-7,0.31902 0.104165,0.57292 0.3125,0.76172 0.211587,0.18555 0.498045,0.27832 0.859375,0.27832 0.498044,0 0.896807,-0.17578 1.196289,-0.52734 0.302731,-0.35482 0.454098,-0.82519 0.454102,-1.41113 l 0,-0.2002 -0.893555,0 m 1.791992,-0.37109 0,3.12011 -0.898437,0 0,-0.83007 c -0.205082,0.33203 -0.460616,0.5778 -0.766602,0.7373 -0.305992,0.15625 -0.680341,0.23438 -1.123046,0.23438 -0.559898,0 -1.005861,-0.15625 -1.337891,-0.46875 -0.328777,-0.31576 -0.493165,-0.73731 -0.493164,-1.26465 -1e-6,-0.61523 0.205077,-1.0791 0.615234,-1.3916 0.41341,-0.3125 1.028644,-0.46875 1.845703,-0.46875 l 1.259766,0 0,-0.0879 c -4e-6,-0.41341 -0.136723,-0.73242 -0.410156,-0.95704 -0.270186,-0.22786 -0.651045,-0.34179 -1.142578,-0.34179 -0.312503,0 -0.616865,0.0374 -0.913086,0.1123 -0.296226,0.0749 -0.581056,0.18718 -0.854493,0.33692 l 0,-0.83008 c 0.328775,-0.12695 0.647785,-0.22135 0.957032,-0.28321 0.309242,-0.0651 0.610349,-0.0977 0.90332,-0.0977 0.791012,0 1.381832,0.20508 1.772461,0.61523 0.39062,0.41016 0.585932,1.03191 0.585937,1.86524"
|
||||
style="font-size:10px"
|
||||
id="path3205" />
|
||||
<path
|
||||
d="m 91.507256,376.48691 c -0.100916,-0.0586 -0.211593,-0.10091 -0.332032,-0.12696 -0.117191,-0.0293 -0.247399,-0.0439 -0.390625,-0.0439 -0.507815,0 -0.89844,0.16602 -1.171875,0.49805 -0.270184,0.32878 -0.405275,0.80241 -0.405273,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.434568,-0.57779 0.737305,-0.7373 0.302731,-0.16276 0.670569,-0.24414 1.103515,-0.24414 0.06185,0 0.130205,0.005 0.205078,0.0147 0.07487,0.007 0.157874,0.0179 0.249024,0.0342 l 0.0049,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3207" />
|
||||
<path
|
||||
d="m 94.734795,381.62363 c -0.25391,0.65104 -0.501305,1.07584 -0.742188,1.27441 -0.240888,0.19857 -0.563153,0.29785 -0.966797,0.29785 l -0.717773,0 0,-0.75195 0.527344,0 c 0.247394,0 0.439451,-0.0586 0.576171,-0.17578 0.136717,-0.11719 0.288084,-0.39388 0.454102,-0.83008 l 0.161133,-0.41016 -2.211914,-5.38086 0.952148,0 1.708985,4.27735 1.708984,-4.27735 0.952148,0 -2.402343,5.97657"
|
||||
style="font-size:10px"
|
||||
id="path3209" />
|
||||
<path
|
||||
d="m 105.81878,376.69687 c 0.2246,-0.40364 0.49316,-0.70149 0.80566,-0.89356 0.3125,-0.19205 0.68033,-0.28808 1.10352,-0.28808 0.56965,0 1.00911,0.2002 1.31836,0.60058 0.30923,0.39714 0.46386,0.96355 0.46387,1.69922 l 0,3.30078 -0.90333,0 0,-3.27148 c 0,-0.52408 -0.0928,-0.91308 -0.27832,-1.16699 -0.18555,-0.2539 -0.46875,-0.38086 -0.8496,-0.38086 -0.46551,0 -0.83334,0.15463 -1.10352,0.46387 -0.27019,0.30924 -0.40528,0.73079 -0.40527,1.26464 l 0,3.09082 -0.90332,0 0,-3.27148 c -10e-6,-0.52734 -0.0928,-0.91634 -0.27832,-1.16699 -0.18556,-0.2539 -0.47201,-0.38086 -0.85938,-0.38086 -0.45899,0 -0.82357,0.15625 -1.09375,0.46875 -0.27018,0.30925 -0.40527,0.72917 -0.40527,1.25976 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.20507,-0.33528 0.45084,-0.58267 0.7373,-0.74218 0.28646,-0.1595 0.62663,-0.23926 1.02051,-0.23926 0.39713,0 0.73404,0.10092 1.01074,0.30273 0.27994,0.20183 0.48665,0.4948 0.62012,0.87891"
|
||||
style="font-size:10px"
|
||||
id="path3211" />
|
||||
<path
|
||||
d="m 113.4262,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27996,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66406,-2.10938 -10e-6,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3213" />
|
||||
<path
|
||||
d="m 121.96624,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.90821,-0.38574 -0.48502,0 -0.86751,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41992,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.48339,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3215" />
|
||||
<path
|
||||
d="m 123.768,375.64706 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3217" />
|
||||
<path
|
||||
d="m 127.43011,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c 0,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.3955,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3219" />
|
||||
<path
|
||||
d="m 132.58636,376.27695 c -0.48178,0 -0.86264,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.13769,-0.56641 0.27995,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13997,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.13769,-0.57129 m 0,-0.76172 c 0.78124,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66894,2.10937 0,0.89519 -0.22298,1.59831 -0.66894,2.10938 -0.44597,0.50781 -1.05958,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.84571,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44597,-0.50781 1.0612,-0.76172 1.84571,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3221" />
|
||||
<path
|
||||
d="m 139.74944,376.48691 c -0.10091,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.42089 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.7373,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10352,-0.24414 0.0618,0 0.1302,0.005 0.20508,0.0147 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3223" />
|
||||
<path
|
||||
d="m 144.75433,380.2955 0,2.90039 -0.90332,0 0,-7.54883 0.90332,0 0,0.83008 c 0.1888,-0.32551 0.42643,-0.5664 0.71289,-0.72265 0.28971,-0.1595 0.63476,-0.23926 1.03515,-0.23926 0.66406,0 1.2028,0.26368 1.61621,0.79101 0.41666,0.52735 0.625,1.22071 0.625,2.08008 0,0.85938 -0.20834,1.55274 -0.625,2.08008 -0.41341,0.52734 -0.95215,0.79102 -1.61621,0.79102 -0.40039,0 -0.74544,-0.0781 -1.03515,-0.23438 -0.28646,-0.1595 -0.52409,-0.40202 -0.71289,-0.72754 m 3.05664,-1.90918 c -1e-5,-0.6608 -0.13673,-1.17838 -0.41016,-1.55273 -0.27019,-0.3776 -0.64291,-0.5664 -1.11816,-0.56641 -0.47527,1e-5 -0.84962,0.18881 -1.12305,0.56641 -0.27018,0.37435 -0.40528,0.89193 -0.40527,1.55273 -1e-5,0.66081 0.13509,1.18002 0.40527,1.55762 0.27343,0.37435 0.64778,0.56152 1.12305,0.56152 0.47525,0 0.84797,-0.18717 1.11816,-0.56152 0.27343,-0.3776 0.41015,-0.89681 0.41016,-1.55762"
|
||||
style="font-size:10px"
|
||||
id="path3225" />
|
||||
<path
|
||||
d="m 152.35198,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -1e-5,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3227" />
|
||||
<path
|
||||
d="m 159.83245,375.8082 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27345,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78126,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33204,0.3418 -0.33203,0.61523 -1e-5,0.20834 0.0798,0.37273 0.23925,0.49317 0.15951,0.11719 0.48014,0.22949 0.96192,0.33691 l 0.30761,0.0684 c 0.63802,0.13672 1.0905,0.33041 1.35743,0.58106 0.27017,0.24739 0.40526,0.59407 0.40527,1.04004 -1e-5,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64942,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33203,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42317,0 0.74869,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.34179,-0.35156 0.3418,-0.61524 -1e-5,-0.24413 -0.083,-0.43131 -0.24903,-0.56152 -0.16276,-0.13021 -0.52246,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55664,-0.11718 -0.95866,-0.29622 -1.20605,-0.53711 -0.2474,-0.24413 -0.3711,-0.57779 -0.3711,-1.00097 0,-0.51432 0.1823,-0.91146 0.54688,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55273,-0.41992 0.33203,0 0.64453,0.0244 0.9375,0.0732 0.29297,0.0488 0.56315,0.12208 0.81055,0.21973"
|
||||
style="font-size:10px"
|
||||
id="path3229" />
|
||||
<path
|
||||
d="m 161.56097,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3231" />
|
||||
<path
|
||||
d="m 165.22308,374.09433 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c -1e-5,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.39551,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3233" />
|
||||
<path
|
||||
d="m 168.26019,375.64706 0.89843,0 0,5.46875 -0.89843,0 0,-5.46875 m 0,-2.1289 0.89843,0 0,1.13769 -0.89843,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3235" />
|
||||
<path
|
||||
d="m 173.15276,376.27695 c -0.48177,0 -0.86263,0.1888 -1.14257,0.5664 -0.27995,0.37436 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56153 0.47852,0 0.85775,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41992,-0.89192 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27995,-0.38086 -0.65918,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39486,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44596,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66406,-1.21419 -0.66406,-2.10938 0,-0.89843 0.22135,-1.60156 0.66406,-2.10937 0.44596,-0.50781 1.0612,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3237" />
|
||||
<path
|
||||
d="m 181.6928,377.81503 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10091,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41993,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21485,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.4834,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3239" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3826">
|
||||
<path
|
||||
d="m 172.22728,456.1171 0,1.04004 c -0.33204,-0.30924 -0.68686,-0.54036 -1.06445,-0.69336 -0.37436,-0.15299 -0.77312,-0.22949 -1.19629,-0.2295 -0.83334,10e-6 -1.47136,0.25554 -1.91407,0.76661 -0.44271,0.50781 -0.66406,1.24349 -0.66406,2.20703 0,0.96029 0.22135,1.69596 0.66406,2.20703 0.44271,0.50781 1.08073,0.76172 1.91407,0.76172 0.42317,0 0.82193,-0.0765 1.19629,-0.2295 0.37759,-0.15299 0.73241,-0.38411 1.06445,-0.69336 l 0,1.03028 c -0.34506,0.23437 -0.71127,0.41015 -1.09863,0.52734 -0.38412,0.11719 -0.79102,0.17578 -1.22071,0.17578 -1.10351,0 -1.97265,-0.33691 -2.60742,-1.01074 -0.63476,-0.67708 -0.95215,-1.59993 -0.95215,-2.76855 0,-1.17187 0.31739,-2.09472 0.95215,-2.76856 0.63477,-0.67707 1.50391,-1.01562 2.60742,-1.01562 0.4362,0 0.84635,0.0586 1.23047,0.17578 0.38737,0.11394 0.75032,0.28646 1.08887,0.51758"
|
||||
style="font-size:10px"
|
||||
id="path3108" />
|
||||
<path
|
||||
d="m 173.72142,455.24796 0.89844,0 0,7.59765 -0.89844,0 0,-7.59765"
|
||||
style="font-size:10px"
|
||||
id="path3110" />
|
||||
<path
|
||||
d="m 176.49486,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3112" />
|
||||
<path
|
||||
d="m 183.94603,459.88663 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.22461,1.0905 0.55664,1.41602 0.33528,0.32226 0.80078,0.4834 1.39649,0.48339 0.34504,1e-5 0.6787,-0.0423 1.00097,-0.12695 0.32552,-0.0846 0.64778,-0.21159 0.9668,-0.38086 l 0,0.84961 c -0.32227,0.13672 -0.65268,0.24089 -0.99121,0.3125 -0.33855,0.0716 -0.68197,0.10742 -1.03028,0.10742 -0.87239,0 -1.56413,-0.2539 -2.07519,-0.76172 -0.50781,-0.50781 -0.76172,-1.19466 -0.76172,-2.06054 0,-0.89518 0.24088,-1.60482 0.72266,-2.12891 0.48502,-0.52734 1.13769,-0.79101 1.958,-0.79101 0.73568,0 1.31673,0.23763 1.74317,0.71289 0.42968,0.47201 0.64452,1.11491 0.64453,1.92871 m -0.89844,-0.26367 c -0.007,-0.49154 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29297 -0.62175,-0.43945 -1.06445,-0.43946 -0.5013,1e-5 -0.90332,0.14161 -1.20605,0.42481 -0.29949,0.28321 -0.47201,0.68197 -0.51758,1.19629 l 3.20312,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3114" />
|
||||
<path
|
||||
d="m 189.96654,459.54483 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51758 -0.10092,-0.90495 -0.30273,-1.16211 -0.20183,-0.25716 -0.50457,-0.38574 -0.90821,-0.38574 -0.48503,0 -0.86751,0.15462 -1.14746,0.46386 -0.27995,0.30925 -0.41992,0.7308 -0.41992,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19531 1.42578,0.58593 0.32226,0.38738 0.48339,0.95867 0.4834,1.71387"
|
||||
style="font-size:10px"
|
||||
id="path3116" />
|
||||
<path
|
||||
d="m 192.65697,455.82413 0,1.55273 1.85058,0 0,0.69824 -1.85058,0 0,2.96875 c 0,0.44597 0.0602,0.73243 0.18066,0.85938 0.1237,0.12695 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26042 -0.3955,-0.73242 -0.3955,-1.41602 l 0,-2.96875 -0.65918,0 0,-0.69824 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3118" />
|
||||
<path
|
||||
d="m 201.36302,460.09659 c -0.72591,0 -1.22884,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44922 -0.41992,0.84961 0,0.31901 0.10417,0.57292 0.3125,0.76172 0.21159,0.18555 0.49805,0.27832 0.85938,0.27832 0.49804,0 0.8968,-0.17578 1.19628,-0.52734 0.30274,-0.35482 0.4541,-0.8252 0.45411,-1.41114 l 0,-0.20019 -0.89356,0 m 1.79199,-0.3711 0,3.12012 -0.89843,0 0,-0.83008 c -0.20509,0.33204 -0.46062,0.5778 -0.76661,0.73731 -0.30599,0.15625 -0.68034,0.23437 -1.12304,0.23437 -0.5599,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32878,-0.31575 -0.49317,-0.7373 -0.49317,-1.26465 0,-0.61523 0.20508,-1.07909 0.61524,-1.3916 0.41341,-0.31249 1.02864,-0.46874 1.8457,-0.46875 l 1.25977,0 0,-0.0879 c -1e-5,-0.4134 -0.13673,-0.73242 -0.41016,-0.95703 -0.27019,-0.22786 -0.65104,-0.34179 -1.14258,-0.3418 -0.3125,1e-5 -0.61686,0.0374 -0.91308,0.11231 -0.29623,0.0749 -0.58106,0.18718 -0.8545,0.33691 l 0,-0.83007 c 0.32878,-0.12695 0.64779,-0.22135 0.95704,-0.28321 0.30924,-0.0651 0.61034,-0.0976 0.90332,-0.0976 0.79101,0 1.38183,0.20508 1.77246,0.61523 0.39062,0.41016 0.58593,1.03191 0.58593,1.86523"
|
||||
style="font-size:10px"
|
||||
id="path3120" />
|
||||
<path
|
||||
d="m 208.17943,458.21671 c -0.10092,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49804 -0.27019,0.32878 -0.40528,0.80242 -0.40528,1.4209 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33203 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15788,0.0179 0.24903,0.0342 l 0.005,0.92286"
|
||||
style="font-size:10px"
|
||||
id="path3122" />
|
||||
<path
|
||||
d="m 213.59447,459.88663 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.22461,1.0905 0.55664,1.41602 0.33528,0.32226 0.80078,0.4834 1.39648,0.48339 0.34505,1e-5 0.67871,-0.0423 1.00098,-0.12695 0.32552,-0.0846 0.64778,-0.21159 0.9668,-0.38086 l 0,0.84961 c -0.32227,0.13672 -0.65268,0.24089 -0.99121,0.3125 -0.33855,0.0716 -0.68197,0.10742 -1.03028,0.10742 -0.8724,0 -1.56413,-0.2539 -2.07519,-0.76172 -0.50782,-0.50781 -0.76172,-1.19466 -0.76172,-2.06054 0,-0.89518 0.24088,-1.60482 0.72265,-2.12891 0.48503,-0.52734 1.1377,-0.79101 1.95801,-0.79101 0.73567,0 1.31673,0.23763 1.74317,0.71289 0.42968,0.47201 0.64452,1.11491 0.64453,1.92871 m -0.89844,-0.26367 c -0.007,-0.49154 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29297 -0.62175,-0.43945 -1.06445,-0.43946 -0.50131,1e-5 -0.90333,0.14161 -1.20606,0.42481 -0.29948,0.28321 -0.472,0.68197 -0.51758,1.19629 l 3.20313,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3124" />
|
||||
<path
|
||||
d="m 217.55443,460.09659 c -0.72592,0 -1.22885,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44922 -0.41992,0.84961 0,0.31901 0.10416,0.57292 0.3125,0.76172 0.21158,0.18555 0.49804,0.27832 0.85937,0.27832 0.49805,0 0.89681,-0.17578 1.19629,-0.52734 0.30273,-0.35482 0.4541,-0.8252 0.4541,-1.41114 l 0,-0.20019 -0.89355,0 m 1.79199,-0.3711 0,3.12012 -0.89844,0 0,-0.83008 c -0.20508,0.33204 -0.46061,0.5778 -0.7666,0.73731 -0.30599,0.15625 -0.68034,0.23437 -1.12305,0.23437 -0.55989,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32877,-0.31575 -0.49316,-0.7373 -0.49316,-1.26465 0,-0.61523 0.20508,-1.07909 0.61523,-1.3916 0.41341,-0.31249 1.02865,-0.46874 1.84571,-0.46875 l 1.25976,0 0,-0.0879 c 0,-0.4134 -0.13672,-0.73242 -0.41015,-0.95703 -0.27019,-0.22786 -0.65105,-0.34179 -1.14258,-0.3418 -0.3125,1e-5 -0.61687,0.0374 -0.91309,0.11231 -0.29622,0.0749 -0.58105,0.18718 -0.85449,0.33691 l 0,-0.83007 c 0.32877,-0.12695 0.64779,-0.22135 0.95703,-0.28321 0.30924,-0.0651 0.61035,-0.0976 0.90332,-0.0976 0.79101,0 1.38183,0.20508 1.77246,0.61523 0.39062,0.41016 0.58594,1.03191 0.58594,1.86523"
|
||||
style="font-size:10px"
|
||||
id="path3126" />
|
||||
<path
|
||||
d="m 226.50462,458.00674 c -0.48177,1e-5 -0.86263,0.18881 -1.14257,0.56641 -0.27995,0.37435 -0.41993,0.88868 -0.41993,1.54297 0,0.6543 0.13835,1.17025 0.41504,1.54785 0.27995,0.37435 0.66243,0.56153 1.14746,0.56152 0.47852,1e-5 0.85775,-0.1888 1.1377,-0.5664 0.27994,-0.3776 0.41992,-0.89193 0.41992,-1.54297 0,-0.64778 -0.13998,-1.16048 -0.41992,-1.53809 -0.27995,-0.38085 -0.65918,-0.57128 -1.1377,-0.57129 m 0,-0.76171 c 0.78125,0 1.39486,0.25391 1.84082,0.76171 0.44596,0.50782 0.66894,1.21095 0.66895,2.10938 -1e-5,0.89518 -0.22299,1.59831 -0.66895,2.10937 -0.44596,0.50782 -1.05957,0.76172 -1.84082,0.76172 -0.7845,0 -1.39974,-0.2539 -1.8457,-0.76172 -0.44271,-0.51106 -0.66406,-1.21419 -0.66406,-2.10937 0,-0.89843 0.22135,-1.60156 0.66406,-2.10938 0.44596,-0.5078 1.0612,-0.76171 1.8457,-0.76171"
|
||||
style="font-size:10px"
|
||||
id="path3128" />
|
||||
<path
|
||||
d="m 233.66771,458.21671 c -0.10092,-0.0586 -0.21159,-0.10091 -0.33203,-0.12696 -0.11719,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49804 -0.27019,0.32878 -0.40528,0.80242 -0.40528,1.4209 l 0,2.88086 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33203 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15788,0.0179 0.24903,0.0342 l 0.005,0.92286"
|
||||
style="font-size:10px"
|
||||
id="path3130" />
|
||||
<path
|
||||
d="m 234.61986,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3132" />
|
||||
<path
|
||||
d="m 240.99193,460.04776 c -1e-5,-0.65104 -0.1351,-1.15559 -0.40528,-1.51367 -0.26693,-0.35807 -0.6429,-0.53711 -1.12793,-0.53711 -0.48177,0 -0.85774,0.17904 -1.12792,0.53711 -0.26693,0.35808 -0.4004,0.86263 -0.4004,1.51367 0,0.64779 0.13347,1.15072 0.4004,1.50879 0.27018,0.35807 0.64615,0.53711 1.12792,0.53711 0.48503,0 0.861,-0.17904 1.12793,-0.53711 0.27018,-0.35807 0.40527,-0.861 0.40528,-1.50879 m 0.89844,2.11914 c -1e-5,0.93099 -0.20672,1.62272 -0.62012,2.0752 -0.41342,0.45572 -1.04655,0.68359 -1.89942,0.68359 -0.31575,0 -0.6136,-0.0244 -0.89355,-0.0732 -0.27995,-0.0456 -0.55176,-0.11719 -0.81543,-0.21485 l 0,-0.87402 c 0.26367,0.14323 0.52409,0.24902 0.78125,0.31738 0.25716,0.0684 0.5192,0.10254 0.78613,0.10254 0.58919,0 1.03027,-0.15462 1.32324,-0.46386 0.29297,-0.306 0.43945,-0.76986 0.43946,-1.39161 l 0,-0.44433 c -0.18555,0.32226 -0.42318,0.56315 -0.71289,0.72265 -0.28972,0.15951 -0.6364,0.23926 -1.04004,0.23926 -0.67058,0 -1.21094,-0.25553 -1.6211,-0.7666 -0.41015,-0.51107 -0.61523,-1.18815 -0.61523,-2.03125 0,-0.84635 0.20508,-1.52506 0.61523,-2.03613 0.41016,-0.51107 0.95052,-0.7666 1.6211,-0.7666 0.40364,0 0.75032,0.0797 1.04004,0.23925 0.28971,0.15951 0.52734,0.4004 0.71289,0.72266 l 0,-0.83008 0.89844,0 0,4.79004"
|
||||
style="font-size:10px"
|
||||
id="path3134" />
|
||||
<path
|
||||
d="m 243.74095,457.37686 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3136" />
|
||||
<path
|
||||
d="m 251.06029,459.54483 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51758 -0.10092,-0.90495 -0.30273,-1.16211 -0.20183,-0.25716 -0.50457,-0.38574 -0.90821,-0.38574 -0.48503,0 -0.86751,0.15462 -1.14746,0.46386 -0.27995,0.30925 -0.41992,0.7308 -0.41992,1.26465 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19531 1.42578,0.58593 0.32226,0.38738 0.48339,0.95867 0.4834,1.71387"
|
||||
style="font-size:10px"
|
||||
id="path3138" />
|
||||
</g>
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text3017">
|
||||
<path
|
||||
d="m 367.17007,356.71783 -2.7832,-7.29003 1.03027,0 2.30958,6.13769 2.31445,-6.13769 1.02539,0 -2.77832,7.29003 -1.11817,0"
|
||||
style="font-size:10px"
|
||||
id="path3242" />
|
||||
<path
|
||||
d="m 371.87222,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3244" />
|
||||
<path
|
||||
d="m 377.81461,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33204,-0.12695 -0.11719,-0.0293 -0.24739,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3246" />
|
||||
<path
|
||||
d="m 379.65543,349.69635 0,1.55273 1.85058,0 0,0.69825 -1.85058,0 0,2.96875 c -1e-5,0.44596 0.0602,0.73242 0.18066,0.85937 0.1237,0.12696 0.37272,0.19043 0.74707,0.19043 l 0.92285,0 0,0.75195 -0.92285,0 c -0.69336,0 -1.17188,-0.12858 -1.43555,-0.38574 -0.26367,-0.26041 -0.39551,-0.73242 -0.3955,-1.41601 l 0,-2.96875 -0.65918,0 0,-0.69825 0.65918,0 0,-1.55273 0.90332,0"
|
||||
style="font-size:10px"
|
||||
id="path3248" />
|
||||
<path
|
||||
d="m 382.59976,354.55963 0,-3.31055 0.89844,0 0,3.27637 c 0,0.51758 0.10091,0.90658 0.30273,1.16699 0.20182,0.25717 0.50456,0.38575 0.90821,0.38575 0.48502,0 0.86751,-0.15463 1.14746,-0.46387 0.2832,-0.30924 0.4248,-0.73079 0.4248,-1.26465 l 0,-3.10059 0.89844,0 0,5.46875 -0.89844,0 0,-0.83984 c -0.2181,0.33203 -0.47201,0.57943 -0.76172,0.74219 -0.28646,0.1595 -0.62012,0.23926 -1.00097,0.23926 -0.62826,0 -1.10515,-0.19532 -1.43067,-0.58594 -0.32552,-0.39063 -0.48828,-0.96191 -0.48828,-1.71387 m 2.26074,-3.44238 0,0"
|
||||
style="font-size:10px"
|
||||
id="path3250" />
|
||||
<path
|
||||
d="m 391.52554,353.96881 c -0.72591,0 -1.22884,0.083 -1.50879,0.24902 -0.27995,0.16602 -0.41992,0.44923 -0.41992,0.84961 0,0.31902 0.10417,0.57292 0.3125,0.76172 0.21159,0.18555 0.49805,0.27832 0.85938,0.27832 0.49804,0 0.8968,-0.17578 1.19629,-0.52734 0.30273,-0.35482 0.45409,-0.82519 0.4541,-1.41113 l 0,-0.2002 -0.89356,0 m 1.792,-0.37109 0,3.12011 -0.89844,0 0,-0.83007 c -0.20508,0.33203 -0.46062,0.5778 -0.7666,0.7373 -0.306,0.15625 -0.68035,0.23438 -1.12305,0.23438 -0.5599,0 -1.00586,-0.15625 -1.33789,-0.46875 -0.32878,-0.31576 -0.49317,-0.73731 -0.49317,-1.26465 0,-0.61523 0.20508,-1.0791 0.61524,-1.3916 0.41341,-0.3125 1.02864,-0.46875 1.8457,-0.46875 l 1.25977,0 0,-0.0879 c -1e-5,-0.41341 -0.13673,-0.73242 -0.41016,-0.95704 -0.27018,-0.22786 -0.65104,-0.34179 -1.14258,-0.34179 -0.3125,0 -0.61686,0.0374 -0.91308,0.1123 -0.29623,0.0749 -0.58106,0.18718 -0.85449,0.33692 l 0,-0.83008 c 0.32877,-0.12695 0.64778,-0.22135 0.95703,-0.28321 0.30924,-0.0651 0.61035,-0.0976 0.90332,-0.0976 0.79101,0 1.38183,0.20508 1.77246,0.61523 0.39062,0.41016 0.58593,1.03191 0.58594,1.86524"
|
||||
style="font-size:10px"
|
||||
id="path3252" />
|
||||
<path
|
||||
d="m 395.173,349.12018 0.89844,0 0,7.59765 -0.89844,0 0,-7.59765"
|
||||
style="font-size:10px"
|
||||
id="path3254" />
|
||||
<path
|
||||
d="m 404.61636,351.41022 0,0.84961 c -0.25391,-0.13021 -0.51758,-0.22786 -0.79101,-0.29297 -0.27344,-0.0651 -0.55665,-0.0976 -0.84961,-0.0977 -0.44597,1e-5 -0.78125,0.0684 -1.00586,0.20508 -0.22136,0.13672 -0.33203,0.3418 -0.33203,0.61523 0,0.20834 0.0797,0.37273 0.23926,0.49317 0.1595,0.11719 0.48014,0.22949 0.96191,0.33691 l 0.30762,0.0684 c 0.63801,0.13672 1.09049,0.33041 1.35742,0.58106 0.27018,0.24739 0.40527,0.59407 0.40527,1.04004 0,0.50781 -0.20183,0.90983 -0.60547,1.20605 -0.40039,0.29622 -0.95215,0.44434 -1.65527,0.44434 -0.29297,0 -0.59896,-0.0293 -0.91797,-0.0879 -0.31576,-0.0553 -0.64941,-0.13998 -1.00098,-0.25391 l 0,-0.92774 c 0.33204,0.17253 0.65918,0.30274 0.98145,0.39063 0.32226,0.0846 0.64127,0.12695 0.95703,0.12695 0.42318,0 0.7487,-0.0716 0.97656,-0.21484 0.22786,-0.14648 0.3418,-0.35156 0.3418,-0.61524 0,-0.24413 -0.083,-0.43131 -0.24902,-0.56152 -0.16277,-0.1302 -0.52247,-0.25553 -1.0791,-0.37598 l -0.3125,-0.0732 c -0.55665,-0.11718 -0.95866,-0.29622 -1.20606,-0.53711 -0.2474,-0.24413 -0.37109,-0.57779 -0.37109,-1.00097 0,-0.51432 0.18229,-0.91146 0.54687,-1.19141 0.36458,-0.27994 0.88216,-0.41992 1.55274,-0.41992 0.33202,0 0.64452,0.0244 0.9375,0.0732 0.29296,0.0488 0.56314,0.12208 0.81054,0.21973"
|
||||
style="font-size:10px"
|
||||
id="path3256" />
|
||||
<path
|
||||
d="m 410.28043,351.45905 0,0.83984 c -0.25391,-0.13997 -0.50945,-0.24414 -0.76661,-0.3125 -0.25391,-0.0716 -0.51107,-0.10742 -0.77148,-0.10742 -0.58268,0 -1.03516,0.18555 -1.35742,0.55664 -0.32227,0.36784 -0.4834,0.88542 -0.4834,1.55273 0,0.66732 0.16113,1.18653 0.4834,1.55762 0.32226,0.36784 0.77474,0.55176 1.35742,0.55176 0.26041,0 0.51757,-0.0342 0.77148,-0.10254 0.25716,-0.0716 0.5127,-0.17741 0.76661,-0.31738 l 0,0.83007 c -0.25066,0.11719 -0.51108,0.20508 -0.78125,0.26368 -0.26693,0.0586 -0.55177,0.0879 -0.8545,0.0879 -0.82357,0 -1.47786,-0.25879 -1.96289,-0.77637 -0.48502,-0.51758 -0.72754,-1.21582 -0.72754,-2.09473 0,-0.89192 0.24414,-1.59342 0.73243,-2.10449 0.49153,-0.51106 1.16373,-0.7666 2.0166,-0.7666 0.27669,0 0.54687,0.0293 0.81054,0.0879 0.26367,0.0553 0.51921,0.13998 0.76661,0.25391"
|
||||
style="font-size:10px"
|
||||
id="path3258" />
|
||||
<path
|
||||
d="m 415.02164,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33203,-0.12695 -0.1172,-0.0293 -0.2474,-0.0439 -0.39063,-0.0439 -0.50781,0 -0.89844,0.16602 -1.17187,0.49805 -0.27019,0.32878 -0.40528,0.80241 -0.40528,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3260" />
|
||||
<path
|
||||
d="m 420.43668,353.75885 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.2246,1.0905 0.55664,1.41602 0.33528,0.32227 0.80078,0.4834 1.39648,0.4834 0.34505,0 0.67871,-0.0423 1.00098,-0.12696 0.32551,-0.0846 0.64778,-0.21158 0.9668,-0.38086 l 0,0.84961 c -0.32228,0.13672 -0.65268,0.24089 -0.99122,0.3125 -0.33854,0.0716 -0.68197,0.10743 -1.03027,0.10743 -0.8724,0 -1.56413,-0.25391 -2.07519,-0.76172 -0.50782,-0.50781 -0.76172,-1.19466 -0.76172,-2.06055 0,-0.89518 0.24088,-1.60481 0.72265,-2.12891 0.48503,-0.52733 1.1377,-0.79101 1.95801,-0.79101 0.73567,0 1.31673,0.23763 1.74316,0.71289 0.42969,0.47201 0.64453,1.11491 0.64454,1.92871 m -0.89844,-0.26367 c -0.007,-0.49153 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29296 -0.62175,-0.43945 -1.06445,-0.43945 -0.50131,0 -0.90333,0.1416 -1.20606,0.4248 -0.29948,0.28321 -0.47201,0.68197 -0.51758,1.19629 l 3.20313,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3262" />
|
||||
<path
|
||||
d="m 426.58902,353.75885 0,0.43945 -4.13086,0 c 0.0391,0.61849 0.22461,1.0905 0.55664,1.41602 0.33529,0.32227 0.80078,0.4834 1.39649,0.4834 0.34504,0 0.6787,-0.0423 1.00097,-0.12696 0.32552,-0.0846 0.64778,-0.21158 0.9668,-0.38086 l 0,0.84961 c -0.32227,0.13672 -0.65268,0.24089 -0.99121,0.3125 -0.33855,0.0716 -0.68197,0.10743 -1.03028,0.10743 -0.87239,0 -1.56412,-0.25391 -2.07519,-0.76172 -0.50781,-0.50781 -0.76172,-1.19466 -0.76172,-2.06055 0,-0.89518 0.24089,-1.60481 0.72266,-2.12891 0.48502,-0.52733 1.13769,-0.79101 1.958,-0.79101 0.73568,0 1.31673,0.23763 1.74317,0.71289 0.42968,0.47201 0.64452,1.11491 0.64453,1.92871 m -0.89844,-0.26367 c -0.007,-0.49153 -0.14486,-0.88379 -0.41504,-1.17676 -0.26693,-0.29296 -0.62175,-0.43945 -1.06445,-0.43945 -0.5013,0 -0.90332,0.1416 -1.20605,0.4248 -0.29949,0.28321 -0.47201,0.68197 -0.51758,1.19629 l 3.20312,-0.005"
|
||||
style="font-size:10px"
|
||||
id="path3264" />
|
||||
<path
|
||||
d="m 432.60953,353.41705 0,3.30078 -0.89844,0 0,-3.27148 c 0,-0.51757 -0.10092,-0.90494 -0.30273,-1.16211 -0.20183,-0.25716 -0.50457,-0.38574 -0.90821,-0.38574 -0.48503,0 -0.86751,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41992,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75684,-0.7373 0.29296,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62825,0 1.10351,0.19532 1.42578,0.58594 0.32226,0.38737 0.48339,0.95866 0.4834,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3266" />
|
||||
<path
|
||||
d="m 439.71402,351.87897 c -0.48177,0 -0.86263,0.1888 -1.14258,0.5664 -0.27995,0.37436 -0.41992,0.88868 -0.41992,1.54297 0,0.6543 0.13834,1.17025 0.41504,1.54785 0.27994,0.37435 0.66243,0.56153 1.14746,0.56153 0.47851,0 0.85774,-0.1888 1.1377,-0.56641 0.27994,-0.3776 0.41991,-0.89192 0.41992,-1.54297 -10e-6,-0.64778 -0.13998,-1.16048 -0.41992,-1.53808 -0.27996,-0.38086 -0.65919,-0.57129 -1.1377,-0.57129 m 0,-0.76172 c 0.78125,0 1.39485,0.25391 1.84082,0.76172 0.44596,0.50781 0.66894,1.21094 0.66895,2.10937 -1e-5,0.89519 -0.22299,1.59831 -0.66895,2.10938 -0.44597,0.50781 -1.05957,0.76172 -1.84082,0.76172 -0.78451,0 -1.39974,-0.25391 -1.8457,-0.76172 -0.44271,-0.51107 -0.66407,-1.21419 -0.66407,-2.10938 0,-0.89843 0.22136,-1.60156 0.66407,-2.10937 0.44596,-0.50781 1.06119,-0.76172 1.8457,-0.76172"
|
||||
style="font-size:10px"
|
||||
id="path3268" />
|
||||
<path
|
||||
d="m 446.87711,352.08893 c -0.10092,-0.0586 -0.2116,-0.10091 -0.33204,-0.12695 -0.11719,-0.0293 -0.24739,-0.0439 -0.39062,-0.0439 -0.50782,0 -0.89844,0.16602 -1.17188,0.49805 -0.27018,0.32878 -0.40527,0.80241 -0.40527,1.4209 l 0,2.88085 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.1888,-0.33202 0.43457,-0.57779 0.73731,-0.7373 0.30273,-0.16276 0.67057,-0.24414 1.10351,-0.24414 0.0618,0 0.13021,0.005 0.20508,0.0146 0.0749,0.007 0.15787,0.0179 0.24902,0.0342 l 0.005,0.92285"
|
||||
style="font-size:10px"
|
||||
id="path3270" />
|
||||
<path
|
||||
d="m 447.82925,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3272" />
|
||||
<path
|
||||
d="m 454.20132,353.91998 c 0,-0.65104 -0.13509,-1.15559 -0.40527,-1.51367 -0.26693,-0.35807 -0.64291,-0.5371 -1.12793,-0.53711 -0.48177,1e-5 -0.85775,0.17904 -1.12793,0.53711 -0.26693,0.35808 -0.40039,0.86263 -0.40039,1.51367 0,0.64779 0.13346,1.15072 0.40039,1.50879 0.27018,0.35808 0.64616,0.53711 1.12793,0.53711 0.48502,0 0.861,-0.17903 1.12793,-0.53711 0.27018,-0.35807 0.40527,-0.861 0.40527,-1.50879 m 0.89844,2.11914 c 0,0.93099 -0.20671,1.62272 -0.62012,2.0752 -0.41341,0.45573 -1.04655,0.68359 -1.89941,0.68359 -0.31576,0 -0.61361,-0.0244 -0.89355,-0.0732 -0.27995,-0.0456 -0.55176,-0.11719 -0.81543,-0.21484 l 0,-0.87403 c 0.26367,0.14323 0.52408,0.24903 0.78125,0.31739 0.25716,0.0684 0.5192,0.10253 0.78613,0.10254 0.58919,-10e-6 1.03027,-0.15463 1.32324,-0.46387 0.29297,-0.30599 0.43945,-0.76986 0.43945,-1.3916 l 0,-0.44434 c -0.18555,0.32227 -0.42318,0.56315 -0.71289,0.72266 -0.28971,0.1595 -0.63639,0.23925 -1.04004,0.23925 -0.67057,0 -1.21093,-0.25553 -1.62109,-0.7666 -0.41016,-0.51106 -0.61523,-1.18815 -0.61523,-2.03125 0,-0.84635 0.20507,-1.52506 0.61523,-2.03613 0.41016,-0.51106 0.95052,-0.7666 1.62109,-0.7666 0.40365,0 0.75033,0.0798 1.04004,0.23926 0.28971,0.15951 0.52734,0.40039 0.71289,0.72265 l 0,-0.83008 0.89844,0 0,4.79004"
|
||||
style="font-size:10px"
|
||||
id="path3274" />
|
||||
<path
|
||||
d="m 456.95035,351.24908 0.89844,0 0,5.46875 -0.89844,0 0,-5.46875 m 0,-2.1289 0.89844,0 0,1.13769 -0.89844,0 0,-1.13769"
|
||||
style="font-size:10px"
|
||||
id="path3276" />
|
||||
<path
|
||||
d="m 464.26968,353.41705 0,3.30078 -0.89843,0 0,-3.27148 c -10e-6,-0.51757 -0.10092,-0.90494 -0.30274,-1.16211 -0.20183,-0.25716 -0.50456,-0.38574 -0.9082,-0.38574 -0.48503,0 -0.86752,0.15463 -1.14746,0.46387 -0.27995,0.30924 -0.41993,0.73079 -0.41992,1.26464 l 0,3.09082 -0.90332,0 0,-5.46875 0.90332,0 0,0.84961 c 0.21484,-0.32877 0.46712,-0.57454 0.75683,-0.7373 0.29297,-0.16276 0.62988,-0.24414 1.01074,-0.24414 0.62826,0 1.10352,0.19532 1.42579,0.58594 0.32226,0.38737 0.48339,0.95866 0.48339,1.71386"
|
||||
style="font-size:10px"
|
||||
id="path3278" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
|
||||
d="m 343.73692,26.224389 0.01,294.941191"
|
||||
id="path3861"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc"
|
||||
transform="translate(12.627039,339.86462)" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4307"
|
||||
d="m 356.48533,366.00457 336.31202,-0.0196"
|
||||
style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend);stroke-miterlimit:4;stroke-dasharray:none" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4309"
|
||||
d="m 159.89916,447.6257 -0.0625,145.00422"
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
|
||||
d="m 160.03997,448.23877 184.95568,-0.0159"
|
||||
id="path4493"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
<g
|
||||
style="font-size:12px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
id="text4495">
|
||||
<path
|
||||
d="m 228.57881,442.02737 0.49805,0 0.7666,3.08106 0.76416,-3.08106 0.5542,0 0.7666,3.08106 0.76416,-3.08106 0.50049,0 -0.91553,3.64502 -0.62012,0 -0.76904,-3.16406 -0.77637,3.16406 -0.62011,0 -0.91309,-3.64502"
|
||||
style="font-size:5px"
|
||||
id="path3141" />
|
||||
<path
|
||||
d="m 233.71797,442.93802 0.44922,0 0,2.73437 -0.44922,0 0,-2.73437 m 0,-1.06445 0.44922,0 0,0.56884 -0.44922,0 0,-0.56884"
|
||||
style="font-size:5px"
|
||||
id="path3143" />
|
||||
<path
|
||||
d="m 237.37764,444.022 0,1.65039 -0.44922,0 0,-1.63574 c 0,-0.25879 -0.0505,-0.45247 -0.15137,-0.58105 -0.10091,-0.12858 -0.25228,-0.19287 -0.4541,-0.19287 -0.24251,0 -0.43376,0.0773 -0.57373,0.23193 -0.13997,0.15462 -0.20996,0.3654 -0.20996,0.63232 l 0,1.54541 -0.45166,0 0,-2.73437 0.45166,0 0,0.4248 c 0.10742,-0.16438 0.23356,-0.28727 0.37842,-0.36865 0.14648,-0.0814 0.31494,-0.12207 0.50537,-0.12207 0.31413,0 0.55176,0.0977 0.71289,0.29297 0.16113,0.19369 0.2417,0.47933 0.2417,0.85693"
|
||||
style="font-size:5px"
|
||||
id="path3145" />
|
||||
<path
|
||||
d="m 240.07784,443.35306 0,-1.47949 0.44921,0 0,3.79882 -0.44921,0 0,-0.41015 c -0.0944,0.16276 -0.21404,0.28401 -0.35889,0.36377 -0.14323,0.0781 -0.31576,0.11718 -0.51758,0.11718 -0.3304,0 -0.59977,-0.13183 -0.80811,-0.3955 -0.2067,-0.26367 -0.31005,-0.61035 -0.31005,-1.04004 0,-0.42969 0.10335,-0.77637 0.31005,-1.04004 0.20834,-0.26367 0.47771,-0.39551 0.80811,-0.39551 0.20182,0 0.37435,0.0399 0.51758,0.11963 0.14485,0.0781 0.26448,0.19857 0.35889,0.36133 m -1.53077,0.95459 c 0,0.3304 0.0676,0.59 0.20264,0.77881 0.13672,0.18717 0.32389,0.28076 0.56152,0.28076 0.23763,0 0.42481,-0.0936 0.56153,-0.28076 0.13671,-0.18881 0.20507,-0.44841 0.20508,-0.77881 -1e-5,-0.3304 -0.0684,-0.58919 -0.20508,-0.77637 -0.13672,-0.1888 -0.3239,-0.2832 -0.56153,-0.2832 -0.23763,0 -0.4248,0.0944 -0.56152,0.2832 -0.13509,0.18718 -0.20264,0.44597 -0.20264,0.77637"
|
||||
style="font-size:5px"
|
||||
id="path3147" />
|
||||
<path
|
||||
d="m 242.51192,443.25296 c -0.24089,0 -0.43132,0.0944 -0.57129,0.2832 -0.13998,0.18718 -0.20996,0.44434 -0.20996,0.77149 0,0.32715 0.0692,0.58512 0.20752,0.77392 0.13997,0.18718 0.33121,0.28077 0.57373,0.28077 0.23925,0 0.42887,-0.0944 0.56884,-0.28321 0.13998,-0.1888 0.20996,-0.44596 0.20997,-0.77148 -1e-5,-0.32389 -0.07,-0.58024 -0.20997,-0.76905 -0.13997,-0.19042 -0.32959,-0.28564 -0.56884,-0.28564 m 0,-0.38086 c 0.39062,0 0.69742,0.12696 0.92041,0.38086 0.22298,0.25391 0.33447,0.60547 0.33447,1.05469 0,0.44759 -0.11149,0.79915 -0.33447,1.05469 -0.22299,0.2539 -0.52979,0.38085 -0.92041,0.38085 -0.39226,0 -0.69987,-0.12695 -0.92285,-0.38085 -0.22136,-0.25554 -0.33204,-0.6071 -0.33204,-1.05469 0,-0.44922 0.11068,-0.80078 0.33204,-1.05469 0.22298,-0.2539 0.53059,-0.38086 0.92285,-0.38086"
|
||||
style="font-size:5px"
|
||||
id="path3149" />
|
||||
<path
|
||||
d="m 244.24776,442.93802 0.44922,0 0.56152,2.13379 0.55908,-2.13379 0.52979,0 0.56152,2.13379 0.55908,-2.13379 0.44922,0 -0.71533,2.73437 -0.52979,0 -0.58838,-2.24121 -0.59082,2.24121 -0.52978,0 -0.71533,-2.73437"
|
||||
style="font-size:5px"
|
||||
id="path3151" />
|
||||
<path
|
||||
d="m 249.70674,442.02737 3.0835,0 0,0.41504 -1.29395,0 0,3.22998 -0.4956,0 0,-3.22998 -1.29395,0 0,-0.41504"
|
||||
style="font-size:5px"
|
||||
id="path3153" />
|
||||
<path
|
||||
d="m 253.09297,442.93802 0.44922,0 0,2.73437 -0.44922,0 0,-2.73437 m 0,-1.06445 0.44922,0 0,0.56884 -0.44922,0 0,-0.56884"
|
||||
style="font-size:5px"
|
||||
id="path3155" />
|
||||
<path
|
||||
d="m 254.92403,442.16165 0,0.77637 0.92529,0 0,0.34912 -0.92529,0 0,1.48437 c 0,0.22299 0.0301,0.36622 0.0903,0.42969 0.0618,0.0635 0.18636,0.0952 0.37353,0.0952 l 0.46143,0 0,0.37597 -0.46143,0 c -0.34668,0 -0.58593,-0.0643 -0.71777,-0.19287 -0.13184,-0.13021 -0.19775,-0.36621 -0.19775,-0.70801 l 0,-1.48437 -0.32959,0 0,-0.34912 0.32959,0 0,-0.77637 0.45166,0"
|
||||
style="font-size:5px"
|
||||
id="path3157" />
|
||||
<path
|
||||
d="m 256.44258,441.87357 0.44922,0 0,3.79882 -0.44922,0 0,-3.79882"
|
||||
style="font-size:5px"
|
||||
id="path3159" />
|
||||
<path
|
||||
d="m 260.16817,444.1929 0,0.21973 -2.06543,0 c 0.0195,0.30924 0.1123,0.54525 0.27832,0.70801 0.16764,0.16113 0.40039,0.2417 0.69824,0.2417 0.17252,0 0.33935,-0.0212 0.50049,-0.0635 0.16276,-0.0423 0.32389,-0.1058 0.4834,-0.19043 l 0,0.4248 c -0.16114,0.0684 -0.32634,0.12045 -0.49561,0.15625 -0.16927,0.0358 -0.34098,0.0537 -0.51514,0.0537 -0.43619,0 -0.78206,-0.12695 -1.03759,-0.38085 -0.25391,-0.25391 -0.38086,-0.59733 -0.38086,-1.03028 0,-0.44759 0.12044,-0.8024 0.36133,-1.06445 0.24251,-0.26367 0.56884,-0.39551 0.979,-0.39551 0.36784,0 0.65836,0.11882 0.87158,0.35645 0.21484,0.236 0.32226,0.55745 0.32227,0.96435 m -0.44922,-0.13183 c -0.003,-0.24577 -0.0724,-0.4419 -0.20752,-0.58838 -0.13347,-0.14649 -0.31088,-0.21973 -0.53223,-0.21973 -0.25065,0 -0.45166,0.0708 -0.60303,0.2124 -0.14974,0.14161 -0.236,0.34099 -0.25878,0.59815 l 1.60156,-0.002"
|
||||
style="font-size:5px"
|
||||
id="path3161" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 109 KiB |
803
examples/common/glfw/docs/window.dox
Normal file
803
examples/common/glfw/docs/window.dox
Normal file
|
@ -0,0 +1,803 @@
|
|||
/*!
|
||||
|
||||
@page window Window guide
|
||||
|
||||
@tableofcontents
|
||||
|
||||
This guide introduces the window related functions of GLFW. There are also
|
||||
guides for the other areas of GLFW.
|
||||
|
||||
- @ref intro
|
||||
- @ref context
|
||||
- @ref monitor
|
||||
- @ref input
|
||||
|
||||
|
||||
@section window_object Window objects
|
||||
|
||||
The @ref GLFWwindow object encapsulates both a window and a context. They are
|
||||
created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow, or
|
||||
@ref glfwTerminate, if any remain. As the window and context are inseparably
|
||||
linked, the object pointer is used as both a context and window handle.
|
||||
|
||||
To see the event stream provided to the various window related callbacks, run
|
||||
the `events` test program.
|
||||
|
||||
|
||||
@subsection window_creation Window creation
|
||||
|
||||
A window and its OpenGL or OpenGL ES context are created with @ref
|
||||
glfwCreateWindow, which returns a handle to the created window object. For
|
||||
example, this creates a 640 by 480 windowed mode window:
|
||||
|
||||
@code
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
|
||||
@endcode
|
||||
|
||||
If window creation fails, `NULL` will be returned, so it is necessary to check
|
||||
the return value.
|
||||
|
||||
The window handle is passed to all window related functions and is provided to
|
||||
along with all input events, so event handlers can tell which window received
|
||||
the event.
|
||||
|
||||
|
||||
@subsubsection window_full_screen Full screen windows
|
||||
|
||||
To create a full screen window, you need to specify which monitor the window
|
||||
should use. In most cases, the user's primary monitor is a good choice.
|
||||
For more information about retrieving monitors, see @ref monitor_monitors.
|
||||
|
||||
@code
|
||||
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL);
|
||||
@endcode
|
||||
|
||||
Full screen windows cover the entire display area of a monitor, have no border
|
||||
or decorations.
|
||||
|
||||
Each field of the @ref GLFWvidmode structure corresponds to a function parameter
|
||||
or window hint and combine to form the _desired video mode_ for that window.
|
||||
The supported video mode most closely matching the desired video mode will be
|
||||
set for the chosen monitor as long as the window has input focus. For more
|
||||
information about retrieving video modes, see @ref monitor_modes.
|
||||
|
||||
Video mode field | Corresponds to
|
||||
----------------------- | ------------------------
|
||||
GLFWvidmode.width | `width` parameter
|
||||
GLFWvidmode.height | `height` parameter
|
||||
GLFWvidmode.redBits | `GLFW_RED_BITS` hint
|
||||
GLFWvidmode.greenBits | `GLFW_GREEN_BITS` hint
|
||||
GLFWvidmode.blueBits | `GLFW_BLUE_BITS` hint
|
||||
GLFWvidmode.refreshRate | `GLFW_REFRESH_RATE` hint
|
||||
|
||||
Once you have a full screen window, you can change its resolution with @ref
|
||||
glfwSetWindowSize. The new video mode will be selected and set the same way as
|
||||
the video mode chosen by @ref glfwCreateWindow.
|
||||
|
||||
By default, the original video mode of the monitor will be restored and the
|
||||
window iconified if it loses input focus, to allow the user to switch back to
|
||||
the desktop. This behavior can be disabled with the `GLFW_AUTO_ICONIFY` window
|
||||
hint, for example if you wish to simultaneously cover multiple windows with full
|
||||
screen windows.
|
||||
|
||||
|
||||
@subsubsection window_windowed_full_screen "Windowed full screen" windows
|
||||
|
||||
To create a so called _windowed full screen_ or _borderless full screen_ window,
|
||||
i.e. a full screen window that doesn't change the video mode of the monitor, you
|
||||
need to request the current video mode of the chosen monitor.
|
||||
|
||||
@code
|
||||
const GLFWvidmode* mode = glfwGetVideoMode(monitor);
|
||||
|
||||
glfwWindowHint(GLFW_RED_BITS, mode->redBits);
|
||||
glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
|
||||
glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
|
||||
glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);
|
||||
|
||||
GLFWwindow* window = glfwCreateWindow(mode->width, mode->height, "My Title", monitor, NULL);
|
||||
@endcode
|
||||
|
||||
GLFW will detect this and will not perform any mode setting for that window.
|
||||
|
||||
|
||||
@subsection window_destruction Window destruction
|
||||
|
||||
When a window is no longer needed, destroy it with @ref glfwDestroyWindow.
|
||||
|
||||
@code
|
||||
glfwDestroyWindow(window);
|
||||
@endcode
|
||||
|
||||
Window destruction always succeeds. Before the actual destruction, all
|
||||
callbacks are removed so no further events will be delivered for the window.
|
||||
All windows remaining when @ref glfwTerminate is called are destroyed as well.
|
||||
|
||||
When a full screen window is destroyed, the original video mode of its monitor
|
||||
is restored, but the gamma ramp is left untouched.
|
||||
|
||||
|
||||
@subsection window_hints Window creation hints
|
||||
|
||||
There are a number of hints that can be set before the creation of a window and
|
||||
context. Some affect the window itself, others affect the framebuffer or
|
||||
context. These hints are set to their default values each time the library is
|
||||
initialized with @ref glfwInit, can be set individually with @ref glfwWindowHint
|
||||
and reset all at once to their defaults with @ref glfwDefaultWindowHints.
|
||||
|
||||
Note that hints need to be set _before_ the creation of the window and context
|
||||
you wish to have the specified attributes.
|
||||
|
||||
|
||||
@subsubsection window_hints_hard Hard and soft constraints
|
||||
|
||||
Some window hints are hard constraints. These must match the available
|
||||
capabilities _exactly_ for window and context creation to succeed. Hints
|
||||
that are not hard constraints are matched as closely as possible, but the
|
||||
resulting window and context may differ from what these hints requested. To
|
||||
find out the actual attributes of the created window and context, use the
|
||||
@ref glfwGetWindowAttrib function.
|
||||
|
||||
The following hints are always hard constraints:
|
||||
- `GLFW_STEREO`
|
||||
- `GLFW_DOUBLEBUFFER`
|
||||
- `GLFW_CLIENT_API`
|
||||
|
||||
The following additional hints are hard constraints when requesting an OpenGL
|
||||
context, but are ignored when requesting an OpenGL ES context:
|
||||
- `GLFW_OPENGL_FORWARD_COMPAT`
|
||||
- `GLFW_OPENGL_PROFILE`
|
||||
|
||||
|
||||
@subsubsection window_hints_wnd Window related hints
|
||||
|
||||
`GLFW_RESIZABLE` specifies whether the (windowed mode) window will be resizable
|
||||
_by the user_. The window will still be resizable using the @ref
|
||||
glfwSetWindowSize function. This hint is ignored for full screen windows.
|
||||
|
||||
`GLFW_VISIBLE` specifies whether the (windowed mode) window will be initially
|
||||
visible. This hint is ignored for full screen windows.
|
||||
|
||||
`GLFW_DECORATED` specifies whether the (windowed mode) window will have window
|
||||
decorations such as a border, a close widget, etc. This hint is ignored for
|
||||
full screen windows. Note that even though a window may lack a close widget, it
|
||||
is usually still possible for the user to generate close events.
|
||||
|
||||
`GLFW_FOCUSED` specifies whether the (windowed mode) window will be given input
|
||||
focus when created. This hint is ignored for full screen and initially hidden
|
||||
windows.
|
||||
|
||||
`GLFW_AUTO_ICONIFY` specifies whether the (full screen) window will
|
||||
automatically iconify and restore the previous video mode on input focus loss.
|
||||
This hint is ignored for windowed mode windows.
|
||||
|
||||
`GLFW_FLOATING` specifies whether the window will be floating above other
|
||||
regular windows, also called topmost or always-on-top. This is intended
|
||||
primarily for debugging purposes and cannot be used to implement proper full
|
||||
screen windows. This hint is ignored for full screen windows.
|
||||
|
||||
|
||||
@subsubsection window_hints_fb Framebuffer related hints
|
||||
|
||||
`GLFW_RED_BITS`, `GLFW_GREEN_BITS`, `GLFW_BLUE_BITS`, `GLFW_ALPHA_BITS`,
|
||||
`GLFW_DEPTH_BITS` and `GLFW_STENCIL_BITS` specify the desired bit depths of the
|
||||
various components of the default framebuffer. `GLFW_DONT_CARE` means the
|
||||
application has no preference.
|
||||
|
||||
`GLFW_ACCUM_RED_BITS`, `GLFW_ACCUM_GREEN_BITS`, `GLFW_ACCUM_BLUE_BITS` and
|
||||
`GLFW_ACCUM_ALPHA_BITS` specify the desired bit depths of the various components
|
||||
of the accumulation buffer. `GLFW_DONT_CARE` means the application has no
|
||||
preference.
|
||||
|
||||
@par
|
||||
Accumulation buffers are a legacy OpenGL feature and should not be used in new
|
||||
code.
|
||||
|
||||
`GLFW_AUX_BUFFERS` specifies the desired number of auxiliary buffers.
|
||||
`GLFW_DONT_CARE` means the application has no preference.
|
||||
|
||||
@par
|
||||
Auxiliary buffers are a legacy OpenGL feature and should not be used in new
|
||||
code.
|
||||
|
||||
`GLFW_STEREO` specifies whether to use stereoscopic rendering. This is a hard
|
||||
constraint.
|
||||
|
||||
`GLFW_SAMPLES` specifies the desired number of samples to use for multisampling.
|
||||
Zero disables multisampling. `GLFW_DONT_CARE` means the application has no
|
||||
preference.
|
||||
|
||||
`GLFW_SRGB_CAPABLE` specifies whether the framebuffer should be sRGB capable.
|
||||
|
||||
`GLFW_DOUBLEBUFFER` specifies whether the framebuffer should be double buffered.
|
||||
You nearly always want to use double buffering. This is a hard constraint.
|
||||
|
||||
|
||||
@subsubsection window_hints_mtr Monitor related hints
|
||||
|
||||
`GLFW_REFRESH_RATE` specifies the desired refresh rate for full screen windows.
|
||||
If set to `GLFW_DONT_CARE`, the highest available refresh rate will be used.
|
||||
This hint is ignored for windowed mode windows.
|
||||
|
||||
|
||||
@subsubsection window_hints_ctx Context related hints
|
||||
|
||||
`GLFW_CLIENT_API` specifies which client API to create the context for.
|
||||
Possible values are `GLFW_OPENGL_API` and `GLFW_OPENGL_ES_API`. This is a hard
|
||||
constraint.
|
||||
|
||||
`GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` specify the client
|
||||
API version that the created context must be compatible with. The exact
|
||||
behavior of these hints depend on the requested client API.
|
||||
|
||||
@par
|
||||
__OpenGL:__ `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` are not hard
|
||||
constraints, but creation will fail if the OpenGL version of the created context
|
||||
is less than the one requested. It is therefore perfectly safe to use the
|
||||
default of version 1.0 for legacy code and you may still get
|
||||
backwards-compatible contexts of version 3.0 and above when available.
|
||||
|
||||
@par
|
||||
While there is no way to ask the driver for a context of the highest supported
|
||||
version, GLFW will attempt to provide this when you ask for a version 1.0
|
||||
context, which is the default for these hints.
|
||||
|
||||
@par
|
||||
__OpenGL ES:__ `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR` are not hard
|
||||
constraints, but creation will fail if the OpenGL ES version of the created
|
||||
context is less than the one requested. Additionally, OpenGL ES 1.x cannot be
|
||||
returned if 2.0 or later was requested, and vice versa. This is because OpenGL
|
||||
ES 3.x is backward compatible with 2.0, but OpenGL ES 2.0 is not backward
|
||||
compatible with 1.x.
|
||||
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` specifies whether the OpenGL context should be
|
||||
forward-compatible, i.e. one where all functionality deprecated in the requested
|
||||
version of OpenGL is removed. This may only be used if the requested OpenGL
|
||||
version is 3.0 or above. If OpenGL ES is requested, this hint is ignored.
|
||||
|
||||
@par
|
||||
Forward-compatibility is described in detail in the
|
||||
[OpenGL Reference Manual](https://www.opengl.org/registry/).
|
||||
|
||||
`GLFW_OPENGL_DEBUG_CONTEXT` specifies whether to create a debug OpenGL context,
|
||||
which may have additional error and performance issue reporting functionality.
|
||||
If OpenGL ES is requested, this hint is ignored.
|
||||
|
||||
`GLFW_OPENGL_PROFILE` specifies which OpenGL profile to create the context for.
|
||||
Possible values are one of `GLFW_OPENGL_CORE_PROFILE` or
|
||||
`GLFW_OPENGL_COMPAT_PROFILE`, or `GLFW_OPENGL_ANY_PROFILE` to not request
|
||||
a specific profile. If requesting an OpenGL version below 3.2,
|
||||
`GLFW_OPENGL_ANY_PROFILE` must be used. If another OpenGL ES is requested,
|
||||
this hint is ignored.
|
||||
|
||||
@par
|
||||
OpenGL profiles are described in detail in the
|
||||
[OpenGL Reference Manual](https://www.opengl.org/registry/).
|
||||
|
||||
`GLFW_CONTEXT_ROBUSTNESS` specifies the robustness strategy to be used by the
|
||||
context. This can be one of `GLFW_NO_RESET_NOTIFICATION` or
|
||||
`GLFW_LOSE_CONTEXT_ON_RESET`, or `GLFW_NO_ROBUSTNESS` to not request
|
||||
a robustness strategy.
|
||||
|
||||
`GLFW_CONTEXT_RELEASE_BEHAVIOR` specifies the release behavior to be
|
||||
used by the context. Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`,
|
||||
`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the
|
||||
behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context
|
||||
creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`,
|
||||
the pipeline will be flushed whenever the context is released from being the
|
||||
current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will
|
||||
not be flushed on release.
|
||||
|
||||
@par
|
||||
Context release behaviors are described in detail by the
|
||||
[GL_KHR_context_flush_control](https://www.opengl.org/registry/specs/KHR/context_flush_control.txt)
|
||||
extension.
|
||||
|
||||
|
||||
@subsubsection window_hints_values Supported and default values
|
||||
|
||||
Window hint | Default value | Supported values
|
||||
------------------------------- | --------------------------- | ----------------
|
||||
`GLFW_RESIZABLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_VISIBLE` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_DECORATED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_FOCUSED` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_AUTO_ICONIFY` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_FLOATING` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_RED_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_GREEN_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_BLUE_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_ALPHA_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_DEPTH_BITS` | 24 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_STENCIL_BITS` | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_ACCUM_RED_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_ACCUM_GREEN_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_ACCUM_BLUE_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_ACCUM_ALPHA_BITS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_AUX_BUFFERS` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_SAMPLES` | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_REFRESH_RATE` | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE`
|
||||
`GLFW_STEREO` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_SRGB_CAPABLE` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_DOUBLEBUFFER` | `GL_TRUE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_CLIENT_API` | `GLFW_OPENGL_API` | `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`
|
||||
`GLFW_CONTEXT_VERSION_MAJOR` | 1 | Any valid major version number of the chosen client API
|
||||
`GLFW_CONTEXT_VERSION_MINOR` | 0 | Any valid minor version number of the chosen client API
|
||||
`GLFW_CONTEXT_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET`
|
||||
`GLFW_CONTEXT_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_OPENGL_DEBUG_CONTEXT` | `GL_FALSE` | `GL_TRUE` or `GL_FALSE`
|
||||
`GLFW_OPENGL_PROFILE` | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE`
|
||||
|
||||
|
||||
@section window_events Window event processing
|
||||
|
||||
See @ref events.
|
||||
|
||||
|
||||
@section window_properties Window properties and events
|
||||
|
||||
@subsection window_userptr User pointer
|
||||
|
||||
Each window has a user pointer that can be set with @ref
|
||||
glfwSetWindowUserPointer and fetched with @ref glfwGetWindowUserPointer. This
|
||||
can be used for any purpose you need and will not be modified by GLFW throughout
|
||||
the life-time of the window.
|
||||
|
||||
The initial value of the pointer is `NULL`.
|
||||
|
||||
|
||||
@subsection window_close Window closing and close flag
|
||||
|
||||
When the user attempts to close the window, for example by clicking the close
|
||||
widget or using a key chord like Alt+F4, the _close flag_ of the window is set.
|
||||
The window is however not actually destroyed and, unless you watch for this
|
||||
state change, nothing further happens.
|
||||
|
||||
The current state of the close flag is returned by @ref glfwWindowShouldClose
|
||||
and can be set or cleared directly with @ref glfwSetWindowShouldClose. A common
|
||||
pattern is to use the close flag as a main loop condition.
|
||||
|
||||
@code
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
render(window);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
@endcode
|
||||
|
||||
If you wish to be notified when the user attempts to close a window, set a close
|
||||
callback.
|
||||
|
||||
@code
|
||||
glfwSetWindowCloseCallback(window, window_close_callback);
|
||||
@endcode
|
||||
|
||||
The callback function is called directly _after_ the close flag has been set.
|
||||
It can be used for example to filter close requests and clear the close flag
|
||||
again unless certain conditions are met.
|
||||
|
||||
@code
|
||||
void window_close_callback(GLFWwindow* window)
|
||||
{
|
||||
if (!time_to_close)
|
||||
glfwSetWindowShouldClose(window, GL_FALSE);
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection window_size Window size
|
||||
|
||||
The size of a window can be changed with @ref glfwSetWindowSize. For windowed
|
||||
mode windows, this sets the size, in
|
||||
[screen coordinates](@ref coordinate_systems) of the _client area_ or _content
|
||||
area_ of the window. The window system may impose limits on window size.
|
||||
|
||||
@code
|
||||
glfwSetWindowSize(window, 640, 480);
|
||||
@endcode
|
||||
|
||||
For full screen windows, the specified size becomes the new resolution of the
|
||||
window's *desired video mode*. The video mode most closely matching the new
|
||||
desired video mode is set immediately. The window is resized to fit the
|
||||
resolution of the set video mode.
|
||||
|
||||
If you wish to be notified when a window is resized, whether by the user or
|
||||
the system, set a size callback.
|
||||
|
||||
@code
|
||||
glfwSetWindowSizeCallback(window, window_size_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the new size, in screen coordinates, of the
|
||||
client area of the window when it is resized.
|
||||
|
||||
@code
|
||||
void window_size_callback(GLFWwindow* window, int width, int height)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
There is also @ref glfwGetWindowSize for directly retrieving the current size of
|
||||
a window.
|
||||
|
||||
@code
|
||||
int width, height;
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
@endcode
|
||||
|
||||
@note Do not pass the window size to `glViewport` or other pixel-based OpenGL
|
||||
calls. The window size is in screen coordinates, not pixels. Use the
|
||||
[framebuffer size](@ref window_fbsize), which is in pixels, for pixel-based
|
||||
calls.
|
||||
|
||||
The above functions work with the size of the client area, but decorated windows
|
||||
typically have title bars and window frames around this rectangle. You can
|
||||
retrieve the extents of these with @ref glfwGetWindowFrameSize.
|
||||
|
||||
@code
|
||||
int left, top, right, bottom;
|
||||
glfwGetWindowFrameSize(window, &left, &top, &right, &bottom);
|
||||
@endcode
|
||||
|
||||
The returned values are the distances, in screen coordinates, from the edges of
|
||||
the client area to the corresponding edges of the full window. As they are
|
||||
distances and not coordinates, they are always zero or positive.
|
||||
|
||||
|
||||
@subsection window_fbsize Framebuffer size
|
||||
|
||||
While the size of a window is measured in screen coordinates, OpenGL works with
|
||||
pixels. The size you pass into `glViewport`, for example, should be in pixels.
|
||||
On some machines screen coordinates and pixels are the same, but on others they
|
||||
will not be. There is a second set of functions to retrieve the size, in
|
||||
pixels, of the framebuffer of a window.
|
||||
|
||||
If you wish to be notified when the framebuffer of a window is resized, whether
|
||||
by the user or the system, set a size callback.
|
||||
|
||||
@code
|
||||
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the new size of the framebuffer when it is
|
||||
resized, which can for example be used to update the OpenGL viewport.
|
||||
|
||||
@code
|
||||
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
}
|
||||
@endcode
|
||||
|
||||
There is also @ref glfwGetFramebufferSize for directly retrieving the current
|
||||
size of the framebuffer of a window.
|
||||
|
||||
@code
|
||||
int width, height;
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
glViewport(0, 0, width, height);
|
||||
@endcode
|
||||
|
||||
The size of a framebuffer may change independently of the size of a window, for
|
||||
example if the window is dragged between a regular monitor and a high-DPI one.
|
||||
|
||||
|
||||
@subsection window_pos Window position
|
||||
|
||||
The position of a windowed-mode window can be changed with @ref
|
||||
glfwSetWindowPos. This moves the window so that the upper-left corner of its
|
||||
client area has the specified [screen coordinates](@ref coordinate_systems).
|
||||
The window system may put limitations on window placement.
|
||||
|
||||
@code
|
||||
glfwSetWindowPos(window, 100, 100);
|
||||
@endcode
|
||||
|
||||
If you wish to be notified when a window is moved, whether by the user, system
|
||||
or your own code, set a position callback.
|
||||
|
||||
@code
|
||||
glfwSetWindowPosCallback(window, window_pos_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives the new position of the upper-left corner of the
|
||||
client area when the window is moved.
|
||||
|
||||
@code
|
||||
void window_pos_callback(GLFWwindow* window, int xpos, int ypos)
|
||||
{
|
||||
}
|
||||
@endcode
|
||||
|
||||
There is also @ref glfwGetWindowPos for directly retrieving the current position
|
||||
of the client area of the window.
|
||||
|
||||
@code
|
||||
int xpos, ypos;
|
||||
glfwGetWindowPos(window, &xpos, &ypos);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection window_title Window title
|
||||
|
||||
All GLFW windows have a title, although undecorated or full screen windows may
|
||||
not display it or only display it in a task bar or similar interface. You can
|
||||
set a UTF-8 encoded window title with @ref glfwSetWindowTitle.
|
||||
|
||||
@code
|
||||
glfwSetWindowTitle(window, "My Window");
|
||||
@endcode
|
||||
|
||||
The specified string is copied before the function returns, so there is no need
|
||||
to keep it around.
|
||||
|
||||
As long as your source file is encoded as UTF-8, you can use any Unicode
|
||||
characters directly in the source.
|
||||
|
||||
@code
|
||||
glfwSetWindowTitle(window, "ヒカルの碁");
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection window_monitor Window monitor
|
||||
|
||||
Full screen windows are associated with a specific monitor. You can get the
|
||||
handle for this monitor with @ref glfwGetWindowMonitor.
|
||||
|
||||
@code
|
||||
GLFWmonitor* monitor = glfwGetWindowMonitor(window);
|
||||
@endcode
|
||||
|
||||
This monitor handle is one of those returned by @ref glfwGetMonitors.
|
||||
|
||||
For windowed mode windows, this function returns `NULL`. This is the
|
||||
recommended way to tell full screen windows from windowed mode windows.
|
||||
|
||||
|
||||
@subsection window_iconify Window iconification
|
||||
|
||||
Windows can be iconified (i.e. minimized) with @ref glfwIconifyWindow.
|
||||
|
||||
@code
|
||||
glfwIconifyWindow(window);
|
||||
@endcode
|
||||
|
||||
When a full screen window is iconified, the original video mode of its monitor
|
||||
is restored until the user or application restores the window.
|
||||
|
||||
Iconified windows can be restored with @ref glfwRestoreWindow.
|
||||
|
||||
@code
|
||||
glfwRestoreWindow(window);
|
||||
@endcode
|
||||
|
||||
When a full screen window is restored, the desired video mode is restored to its
|
||||
monitor as well.
|
||||
|
||||
If you wish to be notified when a window is iconified or restored, whether by
|
||||
the user, system or your own code, set a iconify callback.
|
||||
|
||||
@code
|
||||
glfwSetWindowIconifyCallback(window, window_iconify_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives changes in the iconification state of the window.
|
||||
|
||||
@code
|
||||
void window_iconify_callback(GLFWwindow* window, int iconified)
|
||||
{
|
||||
if (iconified)
|
||||
{
|
||||
// The window was iconified
|
||||
}
|
||||
else
|
||||
{
|
||||
// The window was restored
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
You can also get the current iconification state with @ref glfwGetWindowAttrib.
|
||||
|
||||
@code
|
||||
int iconified = glfwGetWindowAttrib(window, GLFW_ICONIFIED);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection window_hide Window visibility
|
||||
|
||||
Windowed mode windows can be hidden with @ref glfwHideWindow.
|
||||
|
||||
@code
|
||||
glfwHideWindow(window);
|
||||
@endcode
|
||||
|
||||
This makes the window completely invisible to the user, including removing it
|
||||
from the task bar, dock or window list. Full screen windows cannot be hidden
|
||||
and calling @ref glfwHideWindow on a full screen window does nothing.
|
||||
|
||||
Hidden windows can be shown with @ref glfwShowWindow.
|
||||
|
||||
@code
|
||||
glfwShowWindow(window);
|
||||
@endcode
|
||||
|
||||
Windowed mode windows can be created initially hidden with the `GLFW_VISIBLE`
|
||||
[window hint](@ref window_hints_wnd). Windows created hidden are completely
|
||||
invisible to the user until shown. This can be useful if you need to set up
|
||||
your window further before showing it, for example moving it to a specific
|
||||
location.
|
||||
|
||||
You can also get the current visibility state with @ref glfwGetWindowAttrib.
|
||||
|
||||
@code
|
||||
int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection window_focus Window input focus
|
||||
|
||||
If you wish to be notified when a window gains or loses input focus, whether by
|
||||
the user, system or your own code, set a focus callback.
|
||||
|
||||
@code
|
||||
glfwSetWindowFocusCallback(window, window_focus_callback);
|
||||
@endcode
|
||||
|
||||
The callback function receives changes in the input focus state of the window.
|
||||
|
||||
@code
|
||||
void window_focus_callback(GLFWwindow* window, int focused)
|
||||
{
|
||||
if (focused)
|
||||
{
|
||||
// The window gained input focus
|
||||
}
|
||||
else
|
||||
{
|
||||
// The window lost input focus
|
||||
}
|
||||
}
|
||||
@endcode
|
||||
|
||||
You can also get the current input focus state with @ref glfwGetWindowAttrib.
|
||||
|
||||
@code
|
||||
int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED);
|
||||
@endcode
|
||||
|
||||
|
||||
@subsection window_refresh Window damage and refresh
|
||||
|
||||
If you wish to be notified when the contents of a window is damaged and needs
|
||||
to be refreshed, set a window refresh callback.
|
||||
|
||||
@code
|
||||
glfwSetWindowRefreshCallback(m_handle, window_refresh_callback);
|
||||
@endcode
|
||||
|
||||
The callback function is called when the contents of the window needs to be
|
||||
refreshed.
|
||||
|
||||
@code
|
||||
void window_refresh_callback(GLFWwindow* window)
|
||||
{
|
||||
draw_editor_ui(window);
|
||||
glfwSwapBuffers(window);
|
||||
}
|
||||
@endcode
|
||||
|
||||
@note On compositing window systems such as Aero, Compiz or Aqua, where the
|
||||
window contents are saved off-screen, this callback might only be called when
|
||||
the window or framebuffer is resized.
|
||||
|
||||
|
||||
@subsection window_attribs Window attributes
|
||||
|
||||
Windows have a number of attributes that can be returned using @ref
|
||||
glfwGetWindowAttrib. Some reflect state that may change during the lifetime of
|
||||
the window, while others reflect the corresponding hints and are fixed at the
|
||||
time of creation. Some are related to the actual window and others to its
|
||||
context.
|
||||
|
||||
@code
|
||||
if (glfwGetWindowAttrib(window, GLFW_FOCUSED))
|
||||
{
|
||||
// window has input focus
|
||||
}
|
||||
@endcode
|
||||
|
||||
|
||||
@subsubsection window_attribs_wnd Window related attributes
|
||||
|
||||
`GLFW_FOCUSED` indicates whether the specified window has input focus. Initial
|
||||
input focus is controlled by the [window hint](@ref window_hints_wnd) with the
|
||||
same name.
|
||||
|
||||
`GLFW_ICONIFIED` indicates whether the specified window is iconified, whether by
|
||||
the user or with @ref glfwIconifyWindow.
|
||||
|
||||
`GLFW_VISIBLE` indicates whether the specified window is visible. Window
|
||||
visibility can be controlled with @ref glfwShowWindow and @ref glfwHideWindow
|
||||
and initial visibility is controlled by the [window hint](@ref window_hints_wnd)
|
||||
with the same name.
|
||||
|
||||
`GLFW_RESIZABLE` indicates whether the specified window is resizable _by the
|
||||
user_. This is set on creation with the [window hint](@ref window_hints_wnd)
|
||||
with the same name.
|
||||
|
||||
`GLFW_DECORATED` indicates whether the specified window has decorations such as
|
||||
a border, a close widget, etc. This is set on creation with the
|
||||
[window hint](@ref window_hints_wnd) with the same name.
|
||||
|
||||
`GLFW_FLOATING` indicates whether the specified window is floating, also called
|
||||
topmost or always-on-top. This is controlled by the
|
||||
[window hint](@ref window_hints_wnd) with the same name.
|
||||
|
||||
|
||||
@subsubsection window_attribs_ctx Context related attributes
|
||||
|
||||
`GLFW_CLIENT_API` indicates the client API provided by the window's context;
|
||||
either `GLFW_OPENGL_API` or `GLFW_OPENGL_ES_API`.
|
||||
|
||||
`GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and
|
||||
`GLFW_CONTEXT_REVISION` indicate the client API version of the window's context.
|
||||
|
||||
`GLFW_OPENGL_FORWARD_COMPAT` is `GL_TRUE` if the window's context is an OpenGL
|
||||
forward-compatible one, or `GL_FALSE` otherwise.
|
||||
|
||||
`GLFW_OPENGL_DEBUG_CONTEXT` is `GL_TRUE` if the window's context is an OpenGL
|
||||
debug context, or `GL_FALSE` otherwise.
|
||||
|
||||
`GLFW_OPENGL_PROFILE` indicates the OpenGL profile used by the context. This is
|
||||
`GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context uses
|
||||
a known profile, or `GLFW_OPENGL_ANY_PROFILE` if the OpenGL profile is unknown
|
||||
or the context is an OpenGL ES context. Note that the returned profile may not
|
||||
match the profile bits of the context flags, as GLFW will try other means of
|
||||
detecting the profile when no bits are set.
|
||||
|
||||
`GLFW_CONTEXT_ROBUSTNESS` indicates the robustness strategy used by the context.
|
||||
This is `GLFW_LOSE_CONTEXT_ON_RESET` or `GLFW_NO_RESET_NOTIFICATION` if the
|
||||
window's context supports robustness, or `GLFW_NO_ROBUSTNESS` otherwise.
|
||||
|
||||
|
||||
@section buffer_swap Buffer swapping
|
||||
|
||||
GLFW windows are by default double buffered. That means that you have two
|
||||
rendering buffers; a front buffer and a back buffer. The front buffer is
|
||||
the one being displayed and the back buffer the one you render to.
|
||||
|
||||
When the entire frame has been rendered, it is time to swap the back and the
|
||||
front buffers in order to display what has been rendered and begin rendering
|
||||
a new frame. This is done with @ref glfwSwapBuffers.
|
||||
|
||||
@code
|
||||
glfwSwapBuffers(window);
|
||||
@endcode
|
||||
|
||||
Sometimes it can be useful to select when the buffer swap will occur. With the
|
||||
function @ref glfwSwapInterval it is possible to select the minimum number of
|
||||
monitor refreshes the driver wait should from the time @ref glfwSwapBuffers was
|
||||
called before swapping the buffers:
|
||||
|
||||
@code
|
||||
glfwSwapInterval(1);
|
||||
@endcode
|
||||
|
||||
If the interval is zero, the swap will take place immediately when @ref
|
||||
glfwSwapBuffers is called without waiting for a refresh. Otherwise at least
|
||||
interval retraces will pass between each buffer swap. Using a swap interval of
|
||||
zero can be useful for benchmarking purposes, when it is not desirable to
|
||||
measure the time it takes to wait for the vertical retrace. However, a swap
|
||||
interval of one lets you avoid tearing.
|
||||
|
||||
Note that this may not work on all machines, as some drivers have
|
||||
user-controlled settings that override any swap interval the application
|
||||
requests. It is also by default disabled on Windows Vista and later when using
|
||||
DWM (Aero), as using it there sometimes leads to severe jitter. You can
|
||||
forcibly enable it for machines using DWM using @ref compile_options_win32.
|
||||
|
||||
*/
|
80
examples/common/glfw/examples/CMakeLists.txt
Normal file
80
examples/common/glfw/examples/CMakeLists.txt
Normal file
|
@ -0,0 +1,80 @@
|
|||
|
||||
link_libraries(glfw "${OPENGL_glu_LIBRARY}")
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
add_definitions(-DGLFW_DLL)
|
||||
link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}")
|
||||
else()
|
||||
link_libraries(${glfw_LIBRARIES})
|
||||
endif()
|
||||
|
||||
include_directories("${GLFW_SOURCE_DIR}/include"
|
||||
"${GLFW_SOURCE_DIR}/deps")
|
||||
|
||||
if ("${OPENGL_INCLUDE_DIR}")
|
||||
include_directories("${OPENGL_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
set(GLAD "${GLFW_SOURCE_DIR}/deps/glad/glad.h"
|
||||
"${GLFW_SOURCE_DIR}/deps/glad.c")
|
||||
set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h"
|
||||
"${GLFW_SOURCE_DIR}/deps/getopt.c")
|
||||
set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h"
|
||||
"${GLFW_SOURCE_DIR}/deps/tinycthread.c")
|
||||
|
||||
if (APPLE)
|
||||
# Set fancy names for bundles
|
||||
add_executable(Boing MACOSX_BUNDLE boing.c)
|
||||
add_executable(Gears MACOSX_BUNDLE gears.c)
|
||||
add_executable(Heightmap MACOSX_BUNDLE heightmap.c ${GLAD})
|
||||
add_executable(Particles MACOSX_BUNDLE particles.c ${TINYCTHREAD})
|
||||
add_executable(Simple MACOSX_BUNDLE simple.c)
|
||||
add_executable(SplitView MACOSX_BUNDLE splitview.c)
|
||||
add_executable(Wave MACOSX_BUNDLE wave.c)
|
||||
|
||||
set_target_properties(Boing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Boing")
|
||||
set_target_properties(Gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
|
||||
set_target_properties(Heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
|
||||
set_target_properties(Particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
|
||||
set_target_properties(Simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple")
|
||||
set_target_properties(SplitView PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Split View")
|
||||
set_target_properties(Wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
|
||||
|
||||
set_target_properties(Boing Gears Heightmap Particles Simple SplitView Wave PROPERTIES
|
||||
FOLDER "GLFW3/Examples")
|
||||
else()
|
||||
# Set boring names for executables
|
||||
add_executable(boing WIN32 boing.c)
|
||||
add_executable(gears WIN32 gears.c)
|
||||
add_executable(heightmap WIN32 heightmap.c ${GLAD})
|
||||
add_executable(particles WIN32 particles.c ${TINYCTHREAD} ${GETOPT})
|
||||
add_executable(simple WIN32 simple.c)
|
||||
add_executable(splitview WIN32 splitview.c)
|
||||
add_executable(wave WIN32 wave.c)
|
||||
|
||||
set_target_properties(boing gears heightmap particles simple splitview wave PROPERTIES
|
||||
FOLDER "GLFW3/Examples")
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(Particles "${CMAKE_THREAD_LIBS_INIT}")
|
||||
elseif (UNIX)
|
||||
target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}")
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
set(WINDOWS_BINARIES boing gears heightmap particles simple splitview wave)
|
||||
|
||||
# Tell MSVC to use main instead of WinMain for Windows subsystem executables
|
||||
set_target_properties(${WINDOWS_BINARIES} PROPERTIES
|
||||
LINK_FLAGS "/ENTRY:mainCRTStartup")
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
set(BUNDLE_BINARIES Boing Gears Heightmap Particles Simple SplitView Wave)
|
||||
|
||||
set_target_properties(${BUNDLE_BINARIES} PROPERTIES
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION}
|
||||
MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL})
|
||||
endif()
|
||||
|
669
examples/common/glfw/examples/boing.c
Normal file
669
examples/common/glfw/examples/boing.c
Normal file
|
@ -0,0 +1,669 @@
|
|||
/*****************************************************************************
|
||||
* Title: GLBoing
|
||||
* Desc: Tribute to Amiga Boing.
|
||||
* Author: Jim Brooks <gfx@jimbrooks.org>
|
||||
* Original Amiga authors were R.J. Mical and Dale Luck.
|
||||
* GLFW conversion by Marcus Geelnard
|
||||
* Notes: - 360' = 2*PI [radian]
|
||||
*
|
||||
* - Distances between objects are created by doing a relative
|
||||
* Z translations.
|
||||
*
|
||||
* - Although OpenGL enticingly supports alpha-blending,
|
||||
* the shadow of the original Boing didn't affect the color
|
||||
* of the grid.
|
||||
*
|
||||
* - [Marcus] Changed timing scheme from interval driven to frame-
|
||||
* time based animation steps (which results in much smoother
|
||||
* movement)
|
||||
*
|
||||
* History of Amiga Boing:
|
||||
*
|
||||
* Boing was demonstrated on the prototype Amiga (codenamed "Lorraine") in
|
||||
* 1985. According to legend, it was written ad-hoc in one night by
|
||||
* R. J. Mical and Dale Luck. Because the bouncing ball animation was so fast
|
||||
* and smooth, attendees did not believe the Amiga prototype was really doing
|
||||
* the rendering. Suspecting a trick, they began looking around the booth for
|
||||
* a hidden computer or VCR.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Various declarations and macros
|
||||
*****************************************************************************/
|
||||
|
||||
/* Prototypes */
|
||||
void init( void );
|
||||
void display( void );
|
||||
void reshape( GLFWwindow* window, int w, int h );
|
||||
void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods );
|
||||
void mouse_button_callback( GLFWwindow* window, int button, int action, int mods );
|
||||
void cursor_position_callback( GLFWwindow* window, double x, double y );
|
||||
void DrawBoingBall( void );
|
||||
void BounceBall( double dt );
|
||||
void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi );
|
||||
void DrawGrid( void );
|
||||
|
||||
#define RADIUS 70.f
|
||||
#define STEP_LONGITUDE 22.5f /* 22.5 makes 8 bands like original Boing */
|
||||
#define STEP_LATITUDE 22.5f
|
||||
|
||||
#define DIST_BALL (RADIUS * 2.f + RADIUS * 0.1f)
|
||||
|
||||
#define VIEW_SCENE_DIST (DIST_BALL * 3.f + 200.f)/* distance from viewer to middle of boing area */
|
||||
#define GRID_SIZE (RADIUS * 4.5f) /* length (width) of grid */
|
||||
#define BOUNCE_HEIGHT (RADIUS * 2.1f)
|
||||
#define BOUNCE_WIDTH (RADIUS * 2.1f)
|
||||
|
||||
#define SHADOW_OFFSET_X -20.f
|
||||
#define SHADOW_OFFSET_Y 10.f
|
||||
#define SHADOW_OFFSET_Z 0.f
|
||||
|
||||
#define WALL_L_OFFSET 0.f
|
||||
#define WALL_R_OFFSET 5.f
|
||||
|
||||
/* Animation speed (50.0 mimics the original GLUT demo speed) */
|
||||
#define ANIMATION_SPEED 50.f
|
||||
|
||||
/* Maximum allowed delta time per physics iteration */
|
||||
#define MAX_DELTA_T 0.02f
|
||||
|
||||
/* Draw ball, or its shadow */
|
||||
typedef enum { DRAW_BALL, DRAW_BALL_SHADOW } DRAW_BALL_ENUM;
|
||||
|
||||
/* Vertex type */
|
||||
typedef struct {float x; float y; float z;} vertex_t;
|
||||
|
||||
/* Global vars */
|
||||
int width, height;
|
||||
GLfloat deg_rot_y = 0.f;
|
||||
GLfloat deg_rot_y_inc = 2.f;
|
||||
GLboolean override_pos = GL_FALSE;
|
||||
GLfloat cursor_x = 0.f;
|
||||
GLfloat cursor_y = 0.f;
|
||||
GLfloat ball_x = -RADIUS;
|
||||
GLfloat ball_y = -RADIUS;
|
||||
GLfloat ball_x_inc = 1.f;
|
||||
GLfloat ball_y_inc = 2.f;
|
||||
DRAW_BALL_ENUM drawBallHow;
|
||||
double t;
|
||||
double t_old = 0.f;
|
||||
double dt;
|
||||
|
||||
/* Random number generator */
|
||||
#ifndef RAND_MAX
|
||||
#define RAND_MAX 4095
|
||||
#endif
|
||||
|
||||
/* PI */
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Truncate a degree.
|
||||
*****************************************************************************/
|
||||
GLfloat TruncateDeg( GLfloat deg )
|
||||
{
|
||||
if ( deg >= 360.f )
|
||||
return (deg - 360.f);
|
||||
else
|
||||
return deg;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Convert a degree (360-based) into a radian.
|
||||
* 360' = 2 * PI
|
||||
*****************************************************************************/
|
||||
double deg2rad( double deg )
|
||||
{
|
||||
return deg / 360 * (2 * M_PI);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* 360' sin().
|
||||
*****************************************************************************/
|
||||
double sin_deg( double deg )
|
||||
{
|
||||
return sin( deg2rad( deg ) );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* 360' cos().
|
||||
*****************************************************************************/
|
||||
double cos_deg( double deg )
|
||||
{
|
||||
return cos( deg2rad( deg ) );
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Compute a cross product (for a normal vector).
|
||||
*
|
||||
* c = a x b
|
||||
*****************************************************************************/
|
||||
void CrossProduct( vertex_t a, vertex_t b, vertex_t c, vertex_t *n )
|
||||
{
|
||||
GLfloat u1, u2, u3;
|
||||
GLfloat v1, v2, v3;
|
||||
|
||||
u1 = b.x - a.x;
|
||||
u2 = b.y - a.y;
|
||||
u3 = b.y - a.z;
|
||||
|
||||
v1 = c.x - a.x;
|
||||
v2 = c.y - a.y;
|
||||
v3 = c.z - a.z;
|
||||
|
||||
n->x = u2 * v3 - v2 * v3;
|
||||
n->y = u3 * v1 - v3 * u1;
|
||||
n->z = u1 * v2 - v1 * u2;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Calculate the angle to be passed to gluPerspective() so that a scene
|
||||
* is visible. This function originates from the OpenGL Red Book.
|
||||
*
|
||||
* Parms : size
|
||||
* The size of the segment when the angle is intersected at "dist"
|
||||
* (ie at the outermost edge of the angle of vision).
|
||||
*
|
||||
* dist
|
||||
* Distance from viewpoint to scene.
|
||||
*****************************************************************************/
|
||||
GLfloat PerspectiveAngle( GLfloat size,
|
||||
GLfloat dist )
|
||||
{
|
||||
GLfloat radTheta, degTheta;
|
||||
|
||||
radTheta = 2.f * (GLfloat) atan2( size / 2.f, dist );
|
||||
degTheta = (180.f * radTheta) / (GLfloat) M_PI;
|
||||
return degTheta;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define BOING_DEBUG 0
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* init()
|
||||
*****************************************************************************/
|
||||
void init( void )
|
||||
{
|
||||
/*
|
||||
* Clear background.
|
||||
*/
|
||||
glClearColor( 0.55f, 0.55f, 0.55f, 0.f );
|
||||
|
||||
glShadeModel( GL_FLAT );
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* display()
|
||||
*****************************************************************************/
|
||||
void display(void)
|
||||
{
|
||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||
glPushMatrix();
|
||||
|
||||
drawBallHow = DRAW_BALL_SHADOW;
|
||||
DrawBoingBall();
|
||||
|
||||
DrawGrid();
|
||||
|
||||
drawBallHow = DRAW_BALL;
|
||||
DrawBoingBall();
|
||||
|
||||
glPopMatrix();
|
||||
glFlush();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* reshape()
|
||||
*****************************************************************************/
|
||||
void reshape( GLFWwindow* window, int w, int h )
|
||||
{
|
||||
glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
|
||||
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
|
||||
gluPerspective( PerspectiveAngle( RADIUS * 2, 200 ),
|
||||
(GLfloat)w / (GLfloat)h,
|
||||
1.0,
|
||||
VIEW_SCENE_DIST );
|
||||
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
|
||||
gluLookAt( 0.0, 0.0, VIEW_SCENE_DIST,/* eye */
|
||||
0.0, 0.0, 0.0, /* center of vision */
|
||||
0.0, -1.0, 0.0 ); /* up vector */
|
||||
}
|
||||
|
||||
void key_callback( GLFWwindow* window, int key, int scancode, int action, int mods )
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
}
|
||||
|
||||
static void set_ball_pos ( GLfloat x, GLfloat y )
|
||||
{
|
||||
ball_x = (width / 2) - x;
|
||||
ball_y = y - (height / 2);
|
||||
}
|
||||
|
||||
void mouse_button_callback( GLFWwindow* window, int button, int action, int mods )
|
||||
{
|
||||
if (button != GLFW_MOUSE_BUTTON_LEFT)
|
||||
return;
|
||||
|
||||
if (action == GLFW_PRESS)
|
||||
{
|
||||
override_pos = GL_TRUE;
|
||||
set_ball_pos(cursor_x, cursor_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
override_pos = GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void cursor_position_callback( GLFWwindow* window, double x, double y )
|
||||
{
|
||||
cursor_x = (float) x;
|
||||
cursor_y = (float) y;
|
||||
|
||||
if ( override_pos )
|
||||
set_ball_pos(cursor_x, cursor_y);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Draw the Boing ball.
|
||||
*
|
||||
* The Boing ball is sphere in which each facet is a rectangle.
|
||||
* Facet colors alternate between red and white.
|
||||
* The ball is built by stacking latitudinal circles. Each circle is composed
|
||||
* of a widely-separated set of points, so that each facet is noticably large.
|
||||
*****************************************************************************/
|
||||
void DrawBoingBall( void )
|
||||
{
|
||||
GLfloat lon_deg; /* degree of longitude */
|
||||
double dt_total, dt2;
|
||||
|
||||
glPushMatrix();
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
|
||||
/*
|
||||
* Another relative Z translation to separate objects.
|
||||
*/
|
||||
glTranslatef( 0.0, 0.0, DIST_BALL );
|
||||
|
||||
/* Update ball position and rotation (iterate if necessary) */
|
||||
dt_total = dt;
|
||||
while( dt_total > 0.0 )
|
||||
{
|
||||
dt2 = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total;
|
||||
dt_total -= dt2;
|
||||
BounceBall( dt2 );
|
||||
deg_rot_y = TruncateDeg( deg_rot_y + deg_rot_y_inc*((float)dt2*ANIMATION_SPEED) );
|
||||
}
|
||||
|
||||
/* Set ball position */
|
||||
glTranslatef( ball_x, ball_y, 0.0 );
|
||||
|
||||
/*
|
||||
* Offset the shadow.
|
||||
*/
|
||||
if ( drawBallHow == DRAW_BALL_SHADOW )
|
||||
{
|
||||
glTranslatef( SHADOW_OFFSET_X,
|
||||
SHADOW_OFFSET_Y,
|
||||
SHADOW_OFFSET_Z );
|
||||
}
|
||||
|
||||
/*
|
||||
* Tilt the ball.
|
||||
*/
|
||||
glRotatef( -20.0, 0.0, 0.0, 1.0 );
|
||||
|
||||
/*
|
||||
* Continually rotate ball around Y axis.
|
||||
*/
|
||||
glRotatef( deg_rot_y, 0.0, 1.0, 0.0 );
|
||||
|
||||
/*
|
||||
* Set OpenGL state for Boing ball.
|
||||
*/
|
||||
glCullFace( GL_FRONT );
|
||||
glEnable( GL_CULL_FACE );
|
||||
glEnable( GL_NORMALIZE );
|
||||
|
||||
/*
|
||||
* Build a faceted latitude slice of the Boing ball,
|
||||
* stepping same-sized vertical bands of the sphere.
|
||||
*/
|
||||
for ( lon_deg = 0;
|
||||
lon_deg < 180;
|
||||
lon_deg += STEP_LONGITUDE )
|
||||
{
|
||||
/*
|
||||
* Draw a latitude circle at this longitude.
|
||||
*/
|
||||
DrawBoingBallBand( lon_deg,
|
||||
lon_deg + STEP_LONGITUDE );
|
||||
}
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Bounce the ball.
|
||||
*****************************************************************************/
|
||||
void BounceBall( double delta_t )
|
||||
{
|
||||
GLfloat sign;
|
||||
GLfloat deg;
|
||||
|
||||
if ( override_pos )
|
||||
return;
|
||||
|
||||
/* Bounce on walls */
|
||||
if ( ball_x > (BOUNCE_WIDTH/2 + WALL_R_OFFSET ) )
|
||||
{
|
||||
ball_x_inc = -0.5f - 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX;
|
||||
deg_rot_y_inc = -deg_rot_y_inc;
|
||||
}
|
||||
if ( ball_x < -(BOUNCE_HEIGHT/2 + WALL_L_OFFSET) )
|
||||
{
|
||||
ball_x_inc = 0.5f + 0.75f * (GLfloat)rand() / (GLfloat)RAND_MAX;
|
||||
deg_rot_y_inc = -deg_rot_y_inc;
|
||||
}
|
||||
|
||||
/* Bounce on floor / roof */
|
||||
if ( ball_y > BOUNCE_HEIGHT/2 )
|
||||
{
|
||||
ball_y_inc = -0.75f - 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX;
|
||||
}
|
||||
if ( ball_y < -BOUNCE_HEIGHT/2*0.85 )
|
||||
{
|
||||
ball_y_inc = 0.75f + 1.f * (GLfloat)rand() / (GLfloat)RAND_MAX;
|
||||
}
|
||||
|
||||
/* Update ball position */
|
||||
ball_x += ball_x_inc * ((float)delta_t*ANIMATION_SPEED);
|
||||
ball_y += ball_y_inc * ((float)delta_t*ANIMATION_SPEED);
|
||||
|
||||
/*
|
||||
* Simulate the effects of gravity on Y movement.
|
||||
*/
|
||||
if ( ball_y_inc < 0 ) sign = -1.0; else sign = 1.0;
|
||||
|
||||
deg = (ball_y + BOUNCE_HEIGHT/2) * 90 / BOUNCE_HEIGHT;
|
||||
if ( deg > 80 ) deg = 80;
|
||||
if ( deg < 10 ) deg = 10;
|
||||
|
||||
ball_y_inc = sign * 4.f * (float) sin_deg( deg );
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Draw a faceted latitude band of the Boing ball.
|
||||
*
|
||||
* Parms: long_lo, long_hi
|
||||
* Low and high longitudes of slice, resp.
|
||||
*****************************************************************************/
|
||||
void DrawBoingBallBand( GLfloat long_lo,
|
||||
GLfloat long_hi )
|
||||
{
|
||||
vertex_t vert_ne; /* "ne" means south-east, so on */
|
||||
vertex_t vert_nw;
|
||||
vertex_t vert_sw;
|
||||
vertex_t vert_se;
|
||||
vertex_t vert_norm;
|
||||
GLfloat lat_deg;
|
||||
static int colorToggle = 0;
|
||||
|
||||
/*
|
||||
* Iterate thru the points of a latitude circle.
|
||||
* A latitude circle is a 2D set of X,Z points.
|
||||
*/
|
||||
for ( lat_deg = 0;
|
||||
lat_deg <= (360 - STEP_LATITUDE);
|
||||
lat_deg += STEP_LATITUDE )
|
||||
{
|
||||
/*
|
||||
* Color this polygon with red or white.
|
||||
*/
|
||||
if ( colorToggle )
|
||||
glColor3f( 0.8f, 0.1f, 0.1f );
|
||||
else
|
||||
glColor3f( 0.95f, 0.95f, 0.95f );
|
||||
#if 0
|
||||
if ( lat_deg >= 180 )
|
||||
if ( colorToggle )
|
||||
glColor3f( 0.1f, 0.8f, 0.1f );
|
||||
else
|
||||
glColor3f( 0.5f, 0.5f, 0.95f );
|
||||
#endif
|
||||
colorToggle = ! colorToggle;
|
||||
|
||||
/*
|
||||
* Change color if drawing shadow.
|
||||
*/
|
||||
if ( drawBallHow == DRAW_BALL_SHADOW )
|
||||
glColor3f( 0.35f, 0.35f, 0.35f );
|
||||
|
||||
/*
|
||||
* Assign each Y.
|
||||
*/
|
||||
vert_ne.y = vert_nw.y = (float) cos_deg(long_hi) * RADIUS;
|
||||
vert_sw.y = vert_se.y = (float) cos_deg(long_lo) * RADIUS;
|
||||
|
||||
/*
|
||||
* Assign each X,Z with sin,cos values scaled by latitude radius indexed by longitude.
|
||||
* Eg, long=0 and long=180 are at the poles, so zero scale is sin(longitude),
|
||||
* while long=90 (sin(90)=1) is at equator.
|
||||
*/
|
||||
vert_ne.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
|
||||
vert_se.x = (float) cos_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo ));
|
||||
vert_nw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
|
||||
vert_sw.x = (float) cos_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo ));
|
||||
|
||||
vert_ne.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
|
||||
vert_se.z = (float) sin_deg( lat_deg ) * (RADIUS * (float) sin_deg( long_lo ));
|
||||
vert_nw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo + STEP_LONGITUDE ));
|
||||
vert_sw.z = (float) sin_deg( lat_deg + STEP_LATITUDE ) * (RADIUS * (float) sin_deg( long_lo ));
|
||||
|
||||
/*
|
||||
* Draw the facet.
|
||||
*/
|
||||
glBegin( GL_POLYGON );
|
||||
|
||||
CrossProduct( vert_ne, vert_nw, vert_sw, &vert_norm );
|
||||
glNormal3f( vert_norm.x, vert_norm.y, vert_norm.z );
|
||||
|
||||
glVertex3f( vert_ne.x, vert_ne.y, vert_ne.z );
|
||||
glVertex3f( vert_nw.x, vert_nw.y, vert_nw.z );
|
||||
glVertex3f( vert_sw.x, vert_sw.y, vert_sw.z );
|
||||
glVertex3f( vert_se.x, vert_se.y, vert_se.z );
|
||||
|
||||
glEnd();
|
||||
|
||||
#if BOING_DEBUG
|
||||
printf( "----------------------------------------------------------- \n" );
|
||||
printf( "lat = %f long_lo = %f long_hi = %f \n", lat_deg, long_lo, long_hi );
|
||||
printf( "vert_ne x = %.8f y = %.8f z = %.8f \n", vert_ne.x, vert_ne.y, vert_ne.z );
|
||||
printf( "vert_nw x = %.8f y = %.8f z = %.8f \n", vert_nw.x, vert_nw.y, vert_nw.z );
|
||||
printf( "vert_se x = %.8f y = %.8f z = %.8f \n", vert_se.x, vert_se.y, vert_se.z );
|
||||
printf( "vert_sw x = %.8f y = %.8f z = %.8f \n", vert_sw.x, vert_sw.y, vert_sw.z );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Toggle color so that next band will opposite red/white colors than this one.
|
||||
*/
|
||||
colorToggle = ! colorToggle;
|
||||
|
||||
/*
|
||||
* This circular band is done.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Draw the purple grid of lines, behind the Boing ball.
|
||||
* When the Workbench is dropped to the bottom, Boing shows 12 rows.
|
||||
*****************************************************************************/
|
||||
void DrawGrid( void )
|
||||
{
|
||||
int row, col;
|
||||
const int rowTotal = 12; /* must be divisible by 2 */
|
||||
const int colTotal = rowTotal; /* must be same as rowTotal */
|
||||
const GLfloat widthLine = 2.0; /* should be divisible by 2 */
|
||||
const GLfloat sizeCell = GRID_SIZE / rowTotal;
|
||||
const GLfloat z_offset = -40.0;
|
||||
GLfloat xl, xr;
|
||||
GLfloat yt, yb;
|
||||
|
||||
glPushMatrix();
|
||||
glDisable( GL_CULL_FACE );
|
||||
|
||||
/*
|
||||
* Another relative Z translation to separate objects.
|
||||
*/
|
||||
glTranslatef( 0.0, 0.0, DIST_BALL );
|
||||
|
||||
/*
|
||||
* Draw vertical lines (as skinny 3D rectangles).
|
||||
*/
|
||||
for ( col = 0; col <= colTotal; col++ )
|
||||
{
|
||||
/*
|
||||
* Compute co-ords of line.
|
||||
*/
|
||||
xl = -GRID_SIZE / 2 + col * sizeCell;
|
||||
xr = xl + widthLine;
|
||||
|
||||
yt = GRID_SIZE / 2;
|
||||
yb = -GRID_SIZE / 2 - widthLine;
|
||||
|
||||
glBegin( GL_POLYGON );
|
||||
|
||||
glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */
|
||||
|
||||
glVertex3f( xr, yt, z_offset ); /* NE */
|
||||
glVertex3f( xl, yt, z_offset ); /* NW */
|
||||
glVertex3f( xl, yb, z_offset ); /* SW */
|
||||
glVertex3f( xr, yb, z_offset ); /* SE */
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
/*
|
||||
* Draw horizontal lines (as skinny 3D rectangles).
|
||||
*/
|
||||
for ( row = 0; row <= rowTotal; row++ )
|
||||
{
|
||||
/*
|
||||
* Compute co-ords of line.
|
||||
*/
|
||||
yt = GRID_SIZE / 2 - row * sizeCell;
|
||||
yb = yt - widthLine;
|
||||
|
||||
xl = -GRID_SIZE / 2;
|
||||
xr = GRID_SIZE / 2 + widthLine;
|
||||
|
||||
glBegin( GL_POLYGON );
|
||||
|
||||
glColor3f( 0.6f, 0.1f, 0.6f ); /* purple */
|
||||
|
||||
glVertex3f( xr, yt, z_offset ); /* NE */
|
||||
glVertex3f( xl, yt, z_offset ); /* NW */
|
||||
glVertex3f( xl, yb, z_offset ); /* SW */
|
||||
glVertex3f( xr, yb, z_offset ); /* SE */
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*======================================================================*
|
||||
* main()
|
||||
*======================================================================*/
|
||||
|
||||
int main( void )
|
||||
{
|
||||
GLFWwindow* window;
|
||||
|
||||
/* Init GLFW */
|
||||
if( !glfwInit() )
|
||||
exit( EXIT_FAILURE );
|
||||
|
||||
glfwWindowHint(GLFW_DEPTH_BITS, 16);
|
||||
|
||||
window = glfwCreateWindow( 400, 400, "Boing (classic Amiga demo)", NULL, NULL );
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
glfwSetFramebufferSizeCallback(window, reshape);
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
glfwSetMouseButtonCallback(window, mouse_button_callback);
|
||||
glfwSetCursorPosCallback(window, cursor_position_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
reshape(window, width, height);
|
||||
|
||||
glfwSetTime( 0.0 );
|
||||
|
||||
init();
|
||||
|
||||
/* Main loop */
|
||||
for (;;)
|
||||
{
|
||||
/* Timing */
|
||||
t = glfwGetTime();
|
||||
dt = t - t_old;
|
||||
t_old = t;
|
||||
|
||||
/* Draw one frame */
|
||||
display();
|
||||
|
||||
/* Swap buffers */
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
|
||||
/* Check if we are still running */
|
||||
if (glfwWindowShouldClose(window))
|
||||
break;
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
|
372
examples/common/glfw/examples/gears.c
Normal file
372
examples/common/glfw/examples/gears.c
Normal file
|
@ -0,0 +1,372 @@
|
|||
/*
|
||||
* 3-D gear wheels. This program is in the public domain.
|
||||
*
|
||||
* Command line options:
|
||||
* -info print GL implementation information
|
||||
* -exit automatically exit after 30 seconds
|
||||
*
|
||||
*
|
||||
* Brian Paul
|
||||
*
|
||||
*
|
||||
* Marcus Geelnard:
|
||||
* - Conversion to GLFW
|
||||
* - Time based rendering (frame rate independent)
|
||||
* - Slightly modified camera that should work better for stereo viewing
|
||||
*
|
||||
*
|
||||
* Camilla Berglund:
|
||||
* - Removed FPS counter (this is not a benchmark)
|
||||
* - Added a few comments
|
||||
* - Enabled vsync
|
||||
*/
|
||||
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.141592654
|
||||
#endif
|
||||
|
||||
/* If non-zero, the program exits after that many seconds
|
||||
*/
|
||||
static int autoexit = 0;
|
||||
|
||||
/**
|
||||
|
||||
Draw a gear wheel. You'll probably want to call this function when
|
||||
building a display list since we do a lot of trig here.
|
||||
|
||||
Input: inner_radius - radius of hole at center
|
||||
outer_radius - radius at center of teeth
|
||||
width - width of gear teeth - number of teeth
|
||||
tooth_depth - depth of tooth
|
||||
|
||||
**/
|
||||
|
||||
static void
|
||||
gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
|
||||
GLint teeth, GLfloat tooth_depth)
|
||||
{
|
||||
GLint i;
|
||||
GLfloat r0, r1, r2;
|
||||
GLfloat angle, da;
|
||||
GLfloat u, v, len;
|
||||
|
||||
r0 = inner_radius;
|
||||
r1 = outer_radius - tooth_depth / 2.f;
|
||||
r2 = outer_radius + tooth_depth / 2.f;
|
||||
|
||||
da = 2.f * (float) M_PI / teeth / 4.f;
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
|
||||
glNormal3f(0.f, 0.f, 1.f);
|
||||
|
||||
/* draw front face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.f * (float) M_PI / teeth;
|
||||
glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f);
|
||||
glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f);
|
||||
if (i < teeth) {
|
||||
glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f);
|
||||
glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw front sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.f * (float) M_PI / teeth / 4.f;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.f * (float) M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f);
|
||||
glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f);
|
||||
glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f);
|
||||
glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
glNormal3f(0.0, 0.0, -1.0);
|
||||
|
||||
/* draw back face */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.f * (float) M_PI / teeth;
|
||||
glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f);
|
||||
glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f);
|
||||
if (i < teeth) {
|
||||
glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f);
|
||||
glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw back sides of teeth */
|
||||
glBegin(GL_QUADS);
|
||||
da = 2.f * (float) M_PI / teeth / 4.f;
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.f * (float) M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f);
|
||||
glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f);
|
||||
glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f);
|
||||
glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
/* draw outward faces of teeth */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i < teeth; i++) {
|
||||
angle = i * 2.f * (float) M_PI / teeth;
|
||||
|
||||
glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), width * 0.5f);
|
||||
glVertex3f(r1 * (float) cos(angle), r1 * (float) sin(angle), -width * 0.5f);
|
||||
u = r2 * (float) cos(angle + da) - r1 * (float) cos(angle);
|
||||
v = r2 * (float) sin(angle + da) - r1 * (float) sin(angle);
|
||||
len = (float) sqrt(u * u + v * v);
|
||||
u /= len;
|
||||
v /= len;
|
||||
glNormal3f(v, -u, 0.0);
|
||||
glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), width * 0.5f);
|
||||
glVertex3f(r2 * (float) cos(angle + da), r2 * (float) sin(angle + da), -width * 0.5f);
|
||||
glNormal3f((float) cos(angle), (float) sin(angle), 0.f);
|
||||
glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), width * 0.5f);
|
||||
glVertex3f(r2 * (float) cos(angle + 2 * da), r2 * (float) sin(angle + 2 * da), -width * 0.5f);
|
||||
u = r1 * (float) cos(angle + 3 * da) - r2 * (float) cos(angle + 2 * da);
|
||||
v = r1 * (float) sin(angle + 3 * da) - r2 * (float) sin(angle + 2 * da);
|
||||
glNormal3f(v, -u, 0.f);
|
||||
glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), width * 0.5f);
|
||||
glVertex3f(r1 * (float) cos(angle + 3 * da), r1 * (float) sin(angle + 3 * da), -width * 0.5f);
|
||||
glNormal3f((float) cos(angle), (float) sin(angle), 0.f);
|
||||
}
|
||||
|
||||
glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), width * 0.5f);
|
||||
glVertex3f(r1 * (float) cos(0), r1 * (float) sin(0), -width * 0.5f);
|
||||
|
||||
glEnd();
|
||||
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
/* draw inside radius cylinder */
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (i = 0; i <= teeth; i++) {
|
||||
angle = i * 2.f * (float) M_PI / teeth;
|
||||
glNormal3f(-(float) cos(angle), -(float) sin(angle), 0.f);
|
||||
glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), -width * 0.5f);
|
||||
glVertex3f(r0 * (float) cos(angle), r0 * (float) sin(angle), width * 0.5f);
|
||||
}
|
||||
glEnd();
|
||||
|
||||
}
|
||||
|
||||
|
||||
static GLfloat view_rotx = 20.f, view_roty = 30.f, view_rotz = 0.f;
|
||||
static GLint gear1, gear2, gear3;
|
||||
static GLfloat angle = 0.f;
|
||||
|
||||
/* OpenGL draw function & timing */
|
||||
static void draw(void)
|
||||
{
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glPushMatrix();
|
||||
glRotatef(view_rotx, 1.0, 0.0, 0.0);
|
||||
glRotatef(view_roty, 0.0, 1.0, 0.0);
|
||||
glRotatef(view_rotz, 0.0, 0.0, 1.0);
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.0, -2.0, 0.0);
|
||||
glRotatef(angle, 0.0, 0.0, 1.0);
|
||||
glCallList(gear1);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(3.1f, -2.f, 0.f);
|
||||
glRotatef(-2.f * angle - 9.f, 0.f, 0.f, 1.f);
|
||||
glCallList(gear2);
|
||||
glPopMatrix();
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef(-3.1f, 4.2f, 0.f);
|
||||
glRotatef(-2.f * angle - 25.f, 0.f, 0.f, 1.f);
|
||||
glCallList(gear3);
|
||||
glPopMatrix();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
/* update animation parameters */
|
||||
static void animate(void)
|
||||
{
|
||||
angle = 100.f * (float) glfwGetTime();
|
||||
}
|
||||
|
||||
|
||||
/* change view angle, exit upon ESC */
|
||||
void key( GLFWwindow* window, int k, int s, int action, int mods )
|
||||
{
|
||||
if( action != GLFW_PRESS ) return;
|
||||
|
||||
switch (k) {
|
||||
case GLFW_KEY_Z:
|
||||
if( mods & GLFW_MOD_SHIFT )
|
||||
view_rotz -= 5.0;
|
||||
else
|
||||
view_rotz += 5.0;
|
||||
break;
|
||||
case GLFW_KEY_ESCAPE:
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
break;
|
||||
case GLFW_KEY_UP:
|
||||
view_rotx += 5.0;
|
||||
break;
|
||||
case GLFW_KEY_DOWN:
|
||||
view_rotx -= 5.0;
|
||||
break;
|
||||
case GLFW_KEY_LEFT:
|
||||
view_roty += 5.0;
|
||||
break;
|
||||
case GLFW_KEY_RIGHT:
|
||||
view_roty -= 5.0;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* new window size */
|
||||
void reshape( GLFWwindow* window, int width, int height )
|
||||
{
|
||||
GLfloat h = (GLfloat) height / (GLfloat) width;
|
||||
GLfloat xmax, znear, zfar;
|
||||
|
||||
znear = 5.0f;
|
||||
zfar = 30.0f;
|
||||
xmax = znear * 0.5f;
|
||||
|
||||
glViewport( 0, 0, (GLint) width, (GLint) height );
|
||||
glMatrixMode( GL_PROJECTION );
|
||||
glLoadIdentity();
|
||||
glFrustum( -xmax, xmax, -xmax*h, xmax*h, znear, zfar );
|
||||
glMatrixMode( GL_MODELVIEW );
|
||||
glLoadIdentity();
|
||||
glTranslatef( 0.0, 0.0, -20.0 );
|
||||
}
|
||||
|
||||
|
||||
/* program & OpenGL initialization */
|
||||
static void init(int argc, char *argv[])
|
||||
{
|
||||
static GLfloat pos[4] = {5.f, 5.f, 10.f, 0.f};
|
||||
static GLfloat red[4] = {0.8f, 0.1f, 0.f, 1.f};
|
||||
static GLfloat green[4] = {0.f, 0.8f, 0.2f, 1.f};
|
||||
static GLfloat blue[4] = {0.2f, 0.2f, 1.f, 1.f};
|
||||
GLint i;
|
||||
|
||||
glLightfv(GL_LIGHT0, GL_POSITION, pos);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
/* make the gears */
|
||||
gear1 = glGenLists(1);
|
||||
glNewList(gear1, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
|
||||
gear(1.f, 4.f, 1.f, 20, 0.7f);
|
||||
glEndList();
|
||||
|
||||
gear2 = glGenLists(1);
|
||||
glNewList(gear2, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
|
||||
gear(0.5f, 2.f, 2.f, 10, 0.7f);
|
||||
glEndList();
|
||||
|
||||
gear3 = glGenLists(1);
|
||||
glNewList(gear3, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
|
||||
gear(1.3f, 2.f, 0.5f, 10, 0.7f);
|
||||
glEndList();
|
||||
|
||||
glEnable(GL_NORMALIZE);
|
||||
|
||||
for ( i=1; i<argc; i++ ) {
|
||||
if (strcmp(argv[i], "-info")==0) {
|
||||
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
|
||||
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
|
||||
printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
|
||||
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
|
||||
}
|
||||
else if ( strcmp(argv[i], "-exit")==0) {
|
||||
autoexit = 30;
|
||||
printf("Auto Exit after %i seconds.\n", autoexit );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* program entry */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
GLFWwindow* window;
|
||||
int width, height;
|
||||
|
||||
if( !glfwInit() )
|
||||
{
|
||||
fprintf( stderr, "Failed to initialize GLFW\n" );
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
glfwWindowHint(GLFW_DEPTH_BITS, 16);
|
||||
|
||||
window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL );
|
||||
if (!window)
|
||||
{
|
||||
fprintf( stderr, "Failed to open GLFW window\n" );
|
||||
glfwTerminate();
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
// Set callback functions
|
||||
glfwSetFramebufferSizeCallback(window, reshape);
|
||||
glfwSetKeyCallback(window, key);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
reshape(window, width, height);
|
||||
|
||||
// Parse command-line options
|
||||
init(argc, argv);
|
||||
|
||||
// Main loop
|
||||
while( !glfwWindowShouldClose(window) )
|
||||
{
|
||||
// Draw gears
|
||||
draw();
|
||||
|
||||
// Update animation
|
||||
animate();
|
||||
|
||||
// Swap buffers
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
// Terminate GLFW
|
||||
glfwTerminate();
|
||||
|
||||
// Exit program
|
||||
exit( EXIT_SUCCESS );
|
||||
}
|
||||
|
509
examples/common/glfw/examples/heightmap.c
Normal file
509
examples/common/glfw/examples/heightmap.c
Normal file
|
@ -0,0 +1,509 @@
|
|||
//========================================================================
|
||||
// Heightmap example program using OpenGL 3 core profile
|
||||
// Copyright (c) 2010 Olivier Delannoy
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
/* Map height updates */
|
||||
#define MAX_CIRCLE_SIZE (5.0f)
|
||||
#define MAX_DISPLACEMENT (1.0f)
|
||||
#define DISPLACEMENT_SIGN_LIMIT (0.3f)
|
||||
#define MAX_ITER (200)
|
||||
#define NUM_ITER_AT_A_TIME (1)
|
||||
|
||||
/* Map general information */
|
||||
#define MAP_SIZE (10.0f)
|
||||
#define MAP_NUM_VERTICES (80)
|
||||
#define MAP_NUM_TOTAL_VERTICES (MAP_NUM_VERTICES*MAP_NUM_VERTICES)
|
||||
#define MAP_NUM_LINES (3* (MAP_NUM_VERTICES - 1) * (MAP_NUM_VERTICES - 1) + \
|
||||
2 * (MAP_NUM_VERTICES - 1))
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Default shader programs
|
||||
*********************************************************************/
|
||||
|
||||
static const char* vertex_shader_text =
|
||||
"#version 150\n"
|
||||
"uniform mat4 project;\n"
|
||||
"uniform mat4 modelview;\n"
|
||||
"in float x;\n"
|
||||
"in float y;\n"
|
||||
"in float z;\n"
|
||||
"\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" gl_Position = project * modelview * vec4(x, y, z, 1.0);\n"
|
||||
"}\n";
|
||||
|
||||
static const char* fragment_shader_text =
|
||||
"#version 150\n"
|
||||
"out vec4 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
" color = vec4(0.2, 1.0, 0.2, 1.0); \n"
|
||||
"}\n";
|
||||
|
||||
/**********************************************************************
|
||||
* Values for shader uniforms
|
||||
*********************************************************************/
|
||||
|
||||
/* Frustum configuration */
|
||||
static GLfloat view_angle = 45.0f;
|
||||
static GLfloat aspect_ratio = 4.0f/3.0f;
|
||||
static GLfloat z_near = 1.0f;
|
||||
static GLfloat z_far = 100.f;
|
||||
|
||||
/* Projection matrix */
|
||||
static GLfloat projection_matrix[16] = {
|
||||
1.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f
|
||||
};
|
||||
|
||||
/* Model view matrix */
|
||||
static GLfloat modelview_matrix[16] = {
|
||||
1.0f, 0.0f, 0.0f, 0.0f,
|
||||
0.0f, 1.0f, 0.0f, 0.0f,
|
||||
0.0f, 0.0f, 1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f
|
||||
};
|
||||
|
||||
/**********************************************************************
|
||||
* Heightmap vertex and index data
|
||||
*********************************************************************/
|
||||
|
||||
static GLfloat map_vertices[3][MAP_NUM_TOTAL_VERTICES];
|
||||
static GLuint map_line_indices[2*MAP_NUM_LINES];
|
||||
|
||||
/* Store uniform location for the shaders
|
||||
* Those values are setup as part of the process of creating
|
||||
* the shader program. They should not be used before creating
|
||||
* the program.
|
||||
*/
|
||||
static GLuint mesh;
|
||||
static GLuint mesh_vbo[4];
|
||||
|
||||
/**********************************************************************
|
||||
* OpenGL helper functions
|
||||
*********************************************************************/
|
||||
|
||||
/* Creates a shader object of the specified type using the specified text
|
||||
*/
|
||||
static GLuint make_shader(GLenum type, const char* text)
|
||||
{
|
||||
GLuint shader;
|
||||
GLint shader_ok;
|
||||
GLsizei log_length;
|
||||
char info_log[8192];
|
||||
|
||||
shader = glCreateShader(type);
|
||||
if (shader != 0)
|
||||
{
|
||||
glShaderSource(shader, 1, (const GLchar**)&text, NULL);
|
||||
glCompileShader(shader);
|
||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &shader_ok);
|
||||
if (shader_ok != GL_TRUE)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Failed to compile %s shader\n", (type == GL_FRAGMENT_SHADER) ? "fragment" : "vertex" );
|
||||
glGetShaderInfoLog(shader, 8192, &log_length,info_log);
|
||||
fprintf(stderr, "ERROR: \n%s\n\n", info_log);
|
||||
glDeleteShader(shader);
|
||||
shader = 0;
|
||||
}
|
||||
}
|
||||
return shader;
|
||||
}
|
||||
|
||||
/* Creates a program object using the specified vertex and fragment text
|
||||
*/
|
||||
static GLuint make_shader_program(const char* vs_text, const char* fs_text)
|
||||
{
|
||||
GLuint program = 0u;
|
||||
GLint program_ok;
|
||||
GLuint vertex_shader = 0u;
|
||||
GLuint fragment_shader = 0u;
|
||||
GLsizei log_length;
|
||||
char info_log[8192];
|
||||
|
||||
vertex_shader = make_shader(GL_VERTEX_SHADER, vs_text);
|
||||
if (vertex_shader != 0u)
|
||||
{
|
||||
fragment_shader = make_shader(GL_FRAGMENT_SHADER, fs_text);
|
||||
if (fragment_shader != 0u)
|
||||
{
|
||||
/* make the program that connect the two shader and link it */
|
||||
program = glCreateProgram();
|
||||
if (program != 0u)
|
||||
{
|
||||
/* attach both shader and link */
|
||||
glAttachShader(program, vertex_shader);
|
||||
glAttachShader(program, fragment_shader);
|
||||
glLinkProgram(program);
|
||||
glGetProgramiv(program, GL_LINK_STATUS, &program_ok);
|
||||
|
||||
if (program_ok != GL_TRUE)
|
||||
{
|
||||
fprintf(stderr, "ERROR, failed to link shader program\n");
|
||||
glGetProgramInfoLog(program, 8192, &log_length, info_log);
|
||||
fprintf(stderr, "ERROR: \n%s\n\n", info_log);
|
||||
glDeleteProgram(program);
|
||||
glDeleteShader(fragment_shader);
|
||||
glDeleteShader(vertex_shader);
|
||||
program = 0u;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to load fragment shader\n");
|
||||
glDeleteShader(vertex_shader);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "ERROR: Unable to load vertex shader\n");
|
||||
}
|
||||
return program;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* Geometry creation functions
|
||||
*********************************************************************/
|
||||
|
||||
/* Generate vertices and indices for the heightmap
|
||||
*/
|
||||
static void init_map(void)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int k;
|
||||
GLfloat step = MAP_SIZE / (MAP_NUM_VERTICES - 1);
|
||||
GLfloat x = 0.0f;
|
||||
GLfloat z = 0.0f;
|
||||
/* Create a flat grid */
|
||||
k = 0;
|
||||
for (i = 0 ; i < MAP_NUM_VERTICES ; ++i)
|
||||
{
|
||||
for (j = 0 ; j < MAP_NUM_VERTICES ; ++j)
|
||||
{
|
||||
map_vertices[0][k] = x;
|
||||
map_vertices[1][k] = 0.0f;
|
||||
map_vertices[2][k] = z;
|
||||
z += step;
|
||||
++k;
|
||||
}
|
||||
x += step;
|
||||
z = 0.0f;
|
||||
}
|
||||
#if DEBUG_ENABLED
|
||||
for (i = 0 ; i < MAP_NUM_TOTAL_VERTICES ; ++i)
|
||||
{
|
||||
printf ("Vertice %d (%f, %f, %f)\n",
|
||||
i, map_vertices[0][i], map_vertices[1][i], map_vertices[2][i]);
|
||||
|
||||
}
|
||||
#endif
|
||||
/* create indices */
|
||||
/* line fan based on i
|
||||
* i+1
|
||||
* | / i + n + 1
|
||||
* | /
|
||||
* |/
|
||||
* i --- i + n
|
||||
*/
|
||||
|
||||
/* close the top of the square */
|
||||
k = 0;
|
||||
for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i)
|
||||
{
|
||||
map_line_indices[k++] = (i + 1) * MAP_NUM_VERTICES -1;
|
||||
map_line_indices[k++] = (i + 2) * MAP_NUM_VERTICES -1;
|
||||
}
|
||||
/* close the right of the square */
|
||||
for (i = 0 ; i < MAP_NUM_VERTICES -1 ; ++i)
|
||||
{
|
||||
map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i;
|
||||
map_line_indices[k++] = (MAP_NUM_VERTICES - 1) * MAP_NUM_VERTICES + i + 1;
|
||||
}
|
||||
|
||||
for (i = 0 ; i < (MAP_NUM_VERTICES - 1) ; ++i)
|
||||
{
|
||||
for (j = 0 ; j < (MAP_NUM_VERTICES - 1) ; ++j)
|
||||
{
|
||||
int ref = i * (MAP_NUM_VERTICES) + j;
|
||||
map_line_indices[k++] = ref;
|
||||
map_line_indices[k++] = ref + 1;
|
||||
|
||||
map_line_indices[k++] = ref;
|
||||
map_line_indices[k++] = ref + MAP_NUM_VERTICES;
|
||||
|
||||
map_line_indices[k++] = ref;
|
||||
map_line_indices[k++] = ref + MAP_NUM_VERTICES + 1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
for (k = 0 ; k < 2 * MAP_NUM_LINES ; k += 2)
|
||||
{
|
||||
int beg, end;
|
||||
beg = map_line_indices[k];
|
||||
end = map_line_indices[k+1];
|
||||
printf ("Line %d: %d -> %d (%f, %f, %f) -> (%f, %f, %f)\n",
|
||||
k / 2, beg, end,
|
||||
map_vertices[0][beg], map_vertices[1][beg], map_vertices[2][beg],
|
||||
map_vertices[0][end], map_vertices[1][end], map_vertices[2][end]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void generate_heightmap__circle(float* center_x, float* center_y,
|
||||
float* size, float* displacement)
|
||||
{
|
||||
float sign;
|
||||
/* random value for element in between [0-1.0] */
|
||||
*center_x = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
|
||||
*center_y = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
|
||||
*size = (MAX_CIRCLE_SIZE * rand()) / (1.0f * RAND_MAX);
|
||||
sign = (1.0f * rand()) / (1.0f * RAND_MAX);
|
||||
sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f;
|
||||
*displacement = (sign * (MAX_DISPLACEMENT * rand())) / (1.0f * RAND_MAX);
|
||||
}
|
||||
|
||||
/* Run the specified number of iterations of the generation process for the
|
||||
* heightmap
|
||||
*/
|
||||
static void update_map(int num_iter)
|
||||
{
|
||||
assert(num_iter > 0);
|
||||
while(num_iter)
|
||||
{
|
||||
/* center of the circle */
|
||||
float center_x;
|
||||
float center_z;
|
||||
float circle_size;
|
||||
float disp;
|
||||
size_t ii;
|
||||
generate_heightmap__circle(¢er_x, ¢er_z, &circle_size, &disp);
|
||||
disp = disp / 2.0f;
|
||||
for (ii = 0u ; ii < MAP_NUM_TOTAL_VERTICES ; ++ii)
|
||||
{
|
||||
GLfloat dx = center_x - map_vertices[0][ii];
|
||||
GLfloat dz = center_z - map_vertices[2][ii];
|
||||
GLfloat pd = (2.0f * sqrtf((dx * dx) + (dz * dz))) / circle_size;
|
||||
if (fabs(pd) <= 1.0f)
|
||||
{
|
||||
/* tx,tz is within the circle */
|
||||
GLfloat new_height = disp + (float) (cos(pd*3.14f)*disp);
|
||||
map_vertices[1][ii] += new_height;
|
||||
}
|
||||
}
|
||||
--num_iter;
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* OpenGL helper functions
|
||||
*********************************************************************/
|
||||
|
||||
/* Create VBO, IBO and VAO objects for the heightmap geometry and bind them to
|
||||
* the specified program object
|
||||
*/
|
||||
static void make_mesh(GLuint program)
|
||||
{
|
||||
GLuint attrloc;
|
||||
|
||||
glGenVertexArrays(1, &mesh);
|
||||
glGenBuffers(4, mesh_vbo);
|
||||
glBindVertexArray(mesh);
|
||||
/* Prepare the data for drawing through a buffer inidices */
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, mesh_vbo[3]);
|
||||
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLuint)* MAP_NUM_LINES * 2, map_line_indices, GL_STATIC_DRAW);
|
||||
|
||||
/* Prepare the attributes for rendering */
|
||||
attrloc = glGetAttribLocation(program, "x");
|
||||
glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[0]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[0][0], GL_STATIC_DRAW);
|
||||
glEnableVertexAttribArray(attrloc);
|
||||
glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
attrloc = glGetAttribLocation(program, "z");
|
||||
glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[2]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[2][0], GL_STATIC_DRAW);
|
||||
glEnableVertexAttribArray(attrloc);
|
||||
glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
|
||||
attrloc = glGetAttribLocation(program, "y");
|
||||
glBindBuffer(GL_ARRAY_BUFFER, mesh_vbo[1]);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0], GL_DYNAMIC_DRAW);
|
||||
glEnableVertexAttribArray(attrloc);
|
||||
glVertexAttribPointer(attrloc, 1, GL_FLOAT, GL_FALSE, 0, 0);
|
||||
}
|
||||
|
||||
/* Update VBO vertices from source data
|
||||
*/
|
||||
static void update_mesh(void)
|
||||
{
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLfloat) * MAP_NUM_TOTAL_VERTICES, &map_vertices[1][0]);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* GLFW callback functions
|
||||
*********************************************************************/
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
switch(key)
|
||||
{
|
||||
case GLFW_KEY_ESCAPE:
|
||||
/* Exit program on Escape */
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GLFWwindow* window;
|
||||
int iter;
|
||||
double dt;
|
||||
double last_update_time;
|
||||
int frame;
|
||||
float f;
|
||||
GLint uloc_modelview;
|
||||
GLint uloc_project;
|
||||
|
||||
GLuint shader_program;
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
|
||||
window = glfwCreateWindow(800, 600, "GLFW OpenGL3 Heightmap demo", NULL, NULL);
|
||||
if (! window )
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Register events callback */
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||
|
||||
/* Prepare opengl resources for rendering */
|
||||
shader_program = make_shader_program(vertex_shader_text, fragment_shader_text);
|
||||
|
||||
if (shader_program == 0u)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glUseProgram(shader_program);
|
||||
uloc_project = glGetUniformLocation(shader_program, "project");
|
||||
uloc_modelview = glGetUniformLocation(shader_program, "modelview");
|
||||
|
||||
/* Compute the projection matrix */
|
||||
f = 1.0f / tanf(view_angle / 2.0f);
|
||||
projection_matrix[0] = f / aspect_ratio;
|
||||
projection_matrix[5] = f;
|
||||
projection_matrix[10] = (z_far + z_near)/ (z_near - z_far);
|
||||
projection_matrix[11] = -1.0f;
|
||||
projection_matrix[14] = 2.0f * (z_far * z_near) / (z_near - z_far);
|
||||
glUniformMatrix4fv(uloc_project, 1, GL_FALSE, projection_matrix);
|
||||
|
||||
/* Set the camera position */
|
||||
modelview_matrix[12] = -5.0f;
|
||||
modelview_matrix[13] = -5.0f;
|
||||
modelview_matrix[14] = -20.0f;
|
||||
glUniformMatrix4fv(uloc_modelview, 1, GL_FALSE, modelview_matrix);
|
||||
|
||||
/* Create mesh data */
|
||||
init_map();
|
||||
make_mesh(shader_program);
|
||||
|
||||
/* Create vao + vbo to store the mesh */
|
||||
/* Create the vbo to store all the information for the grid and the height */
|
||||
|
||||
/* setup the scene ready for rendering */
|
||||
glViewport(0, 0, 800, 600);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
/* main loop */
|
||||
frame = 0;
|
||||
iter = 0;
|
||||
last_update_time = glfwGetTime();
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
++frame;
|
||||
/* render the next frame */
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glDrawElements(GL_LINES, 2* MAP_NUM_LINES , GL_UNSIGNED_INT, 0);
|
||||
|
||||
/* display and process events through callbacks */
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
/* Check the frame rate and update the heightmap if needed */
|
||||
dt = glfwGetTime();
|
||||
if ((dt - last_update_time) > 0.2)
|
||||
{
|
||||
/* generate the next iteration of the heightmap */
|
||||
if (iter < MAX_ITER)
|
||||
{
|
||||
update_map(NUM_ITER_AT_A_TIME);
|
||||
update_mesh();
|
||||
iter += NUM_ITER_AT_A_TIME;
|
||||
}
|
||||
last_update_time = dt;
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
1061
examples/common/glfw/examples/particles.c
Normal file
1061
examples/common/glfw/examples/particles.c
Normal file
File diff suppressed because it is too large
Load Diff
102
examples/common/glfw/examples/simple.c
Normal file
102
examples/common/glfw/examples/simple.c
Normal file
|
@ -0,0 +1,102 @@
|
|||
//========================================================================
|
||||
// Simple GLFW example
|
||||
// Copyright (c) Camilla Berglund <elmindreda@elmindreda.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.
|
||||
//
|
||||
//========================================================================
|
||||
//! [code]
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fputs(description, stderr);
|
||||
}
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
GLFWwindow* window;
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
float ratio;
|
||||
int width, height;
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
ratio = width / (float) height;
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
glLoadIdentity();
|
||||
glRotatef((float) glfwGetTime() * 50.f, 0.f, 0.f, 1.f);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glColor3f(1.f, 0.f, 0.f);
|
||||
glVertex3f(-0.6f, -0.4f, 0.f);
|
||||
glColor3f(0.f, 1.f, 0.f);
|
||||
glVertex3f(0.6f, -0.4f, 0.f);
|
||||
glColor3f(0.f, 0.f, 1.f);
|
||||
glVertex3f(0.f, 0.6f, 0.f);
|
||||
glEnd();
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwDestroyWindow(window);
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
//! [code]
|
511
examples/common/glfw/examples/splitview.c
Normal file
511
examples/common/glfw/examples/splitview.c
Normal file
|
@ -0,0 +1,511 @@
|
|||
//========================================================================
|
||||
// This is an example program for the GLFW library
|
||||
//
|
||||
// The program uses a "split window" view, rendering four views of the
|
||||
// same scene in one window (e.g. uesful for 3D modelling software). This
|
||||
// demo uses scissors to separete the four different rendering areas from
|
||||
// each other.
|
||||
//
|
||||
// (If the code seems a little bit strange here and there, it may be
|
||||
// because I am not a friend of orthogonal projections)
|
||||
//========================================================================
|
||||
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Global variables
|
||||
//========================================================================
|
||||
|
||||
// Mouse position
|
||||
static double xpos = 0, ypos = 0;
|
||||
|
||||
// Window size
|
||||
static int width, height;
|
||||
|
||||
// Active view: 0 = none, 1 = upper left, 2 = upper right, 3 = lower left,
|
||||
// 4 = lower right
|
||||
static int active_view = 0;
|
||||
|
||||
// Rotation around each axis
|
||||
static int rot_x = 0, rot_y = 0, rot_z = 0;
|
||||
|
||||
// Do redraw?
|
||||
static int do_redraw = 1;
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Draw a solid torus (use a display list for the model)
|
||||
//========================================================================
|
||||
|
||||
#define TORUS_MAJOR 1.5
|
||||
#define TORUS_MINOR 0.5
|
||||
#define TORUS_MAJOR_RES 32
|
||||
#define TORUS_MINOR_RES 32
|
||||
|
||||
static void drawTorus(void)
|
||||
{
|
||||
static GLuint torus_list = 0;
|
||||
int i, j, k;
|
||||
double s, t, x, y, z, nx, ny, nz, scale, twopi;
|
||||
|
||||
if (!torus_list)
|
||||
{
|
||||
// Start recording displaylist
|
||||
torus_list = glGenLists(1);
|
||||
glNewList(torus_list, GL_COMPILE_AND_EXECUTE);
|
||||
|
||||
// Draw torus
|
||||
twopi = 2.0 * M_PI;
|
||||
for (i = 0; i < TORUS_MINOR_RES; i++)
|
||||
{
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (j = 0; j <= TORUS_MAJOR_RES; j++)
|
||||
{
|
||||
for (k = 1; k >= 0; k--)
|
||||
{
|
||||
s = (i + k) % TORUS_MINOR_RES + 0.5;
|
||||
t = j % TORUS_MAJOR_RES;
|
||||
|
||||
// Calculate point on surface
|
||||
x = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * cos(t * twopi / TORUS_MAJOR_RES);
|
||||
y = TORUS_MINOR * sin(s * twopi / TORUS_MINOR_RES);
|
||||
z = (TORUS_MAJOR + TORUS_MINOR * cos(s * twopi / TORUS_MINOR_RES)) * sin(t * twopi / TORUS_MAJOR_RES);
|
||||
|
||||
// Calculate surface normal
|
||||
nx = x - TORUS_MAJOR * cos(t * twopi / TORUS_MAJOR_RES);
|
||||
ny = y;
|
||||
nz = z - TORUS_MAJOR * sin(t * twopi / TORUS_MAJOR_RES);
|
||||
scale = 1.0 / sqrt(nx*nx + ny*ny + nz*nz);
|
||||
nx *= scale;
|
||||
ny *= scale;
|
||||
nz *= scale;
|
||||
|
||||
glNormal3f((float) nx, (float) ny, (float) nz);
|
||||
glVertex3f((float) x, (float) y, (float) z);
|
||||
}
|
||||
}
|
||||
|
||||
glEnd();
|
||||
}
|
||||
|
||||
// Stop recording displaylist
|
||||
glEndList();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Playback displaylist
|
||||
glCallList(torus_list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Draw the scene (a rotating torus)
|
||||
//========================================================================
|
||||
|
||||
static void drawScene(void)
|
||||
{
|
||||
const GLfloat model_diffuse[4] = {1.0f, 0.8f, 0.8f, 1.0f};
|
||||
const GLfloat model_specular[4] = {0.6f, 0.6f, 0.6f, 1.0f};
|
||||
const GLfloat model_shininess = 20.0f;
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
// Rotate the object
|
||||
glRotatef((GLfloat) rot_x * 0.5f, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef((GLfloat) rot_y * 0.5f, 0.0f, 1.0f, 0.0f);
|
||||
glRotatef((GLfloat) rot_z * 0.5f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Set model color (used for orthogonal views, lighting disabled)
|
||||
glColor4fv(model_diffuse);
|
||||
|
||||
// Set model material (used for perspective view, lighting enabled)
|
||||
glMaterialfv(GL_FRONT, GL_DIFFUSE, model_diffuse);
|
||||
glMaterialfv(GL_FRONT, GL_SPECULAR, model_specular);
|
||||
glMaterialf(GL_FRONT, GL_SHININESS, model_shininess);
|
||||
|
||||
// Draw torus
|
||||
drawTorus();
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Draw a 2D grid (used for orthogonal views)
|
||||
//========================================================================
|
||||
|
||||
static void drawGrid(float scale, int steps)
|
||||
{
|
||||
int i;
|
||||
float x, y;
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
// Set background to some dark bluish grey
|
||||
glClearColor(0.05f, 0.05f, 0.2f, 0.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// Setup modelview matrix (flat XY view)
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0, 0.0, 1.0,
|
||||
0.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0);
|
||||
|
||||
// We don't want to update the Z-buffer
|
||||
glDepthMask(GL_FALSE);
|
||||
|
||||
// Set grid color
|
||||
glColor3f(0.0f, 0.5f, 0.5f);
|
||||
|
||||
glBegin(GL_LINES);
|
||||
|
||||
// Horizontal lines
|
||||
x = scale * 0.5f * (float) (steps - 1);
|
||||
y = -scale * 0.5f * (float) (steps - 1);
|
||||
for (i = 0; i < steps; i++)
|
||||
{
|
||||
glVertex3f(-x, y, 0.0f);
|
||||
glVertex3f(x, y, 0.0f);
|
||||
y += scale;
|
||||
}
|
||||
|
||||
// Vertical lines
|
||||
x = -scale * 0.5f * (float) (steps - 1);
|
||||
y = scale * 0.5f * (float) (steps - 1);
|
||||
for (i = 0; i < steps; i++)
|
||||
{
|
||||
glVertex3f(x, -y, 0.0f);
|
||||
glVertex3f(x, y, 0.0f);
|
||||
x += scale;
|
||||
}
|
||||
|
||||
glEnd();
|
||||
|
||||
// Enable Z-buffer writing again
|
||||
glDepthMask(GL_TRUE);
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Draw all views
|
||||
//========================================================================
|
||||
|
||||
static void drawAllViews(void)
|
||||
{
|
||||
const GLfloat light_position[4] = {0.0f, 8.0f, 8.0f, 1.0f};
|
||||
const GLfloat light_diffuse[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
const GLfloat light_specular[4] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
const GLfloat light_ambient[4] = {0.2f, 0.2f, 0.3f, 1.0f};
|
||||
double aspect;
|
||||
|
||||
// Calculate aspect of window
|
||||
if (height > 0)
|
||||
aspect = (double) width / (double) height;
|
||||
else
|
||||
aspect = 1.0;
|
||||
|
||||
// Clear screen
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// Enable scissor test
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
// Enable depth test
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
|
||||
// ** ORTHOGONAL VIEWS **
|
||||
|
||||
// For orthogonal views, use wireframe rendering
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
|
||||
// Enable line anti-aliasing
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
// Setup orthogonal projection matrix
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(-3.0 * aspect, 3.0 * aspect, -3.0, 3.0, 1.0, 50.0);
|
||||
|
||||
// Upper left view (TOP VIEW)
|
||||
glViewport(0, height / 2, width / 2, height / 2);
|
||||
glScissor(0, height / 2, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0f, 10.0f, 1e-3f, // Eye-position (above)
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
drawGrid(0.5, 12);
|
||||
drawScene();
|
||||
|
||||
// Lower left view (FRONT VIEW)
|
||||
glViewport(0, 0, width / 2, height / 2);
|
||||
glScissor(0, 0, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(0.0f, 0.0f, 10.0f, // Eye-position (in front of)
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
drawGrid(0.5, 12);
|
||||
drawScene();
|
||||
|
||||
// Lower right view (SIDE VIEW)
|
||||
glViewport(width / 2, 0, width / 2, height / 2);
|
||||
glScissor(width / 2, 0, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(10.0f, 0.0f, 0.0f, // Eye-position (to the right)
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
drawGrid(0.5, 12);
|
||||
drawScene();
|
||||
|
||||
// Disable line anti-aliasing
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
// ** PERSPECTIVE VIEW **
|
||||
|
||||
// For perspective view, use solid rendering
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
|
||||
// Enable face culling (faster rendering)
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_BACK);
|
||||
glFrontFace(GL_CW);
|
||||
|
||||
// Setup perspective projection matrix
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(65.0f, aspect, 1.0f, 50.0f);
|
||||
|
||||
// Upper right view (PERSPECTIVE VIEW)
|
||||
glViewport(width / 2, height / 2, width / 2, height / 2);
|
||||
glScissor(width / 2, height / 2, width / 2, height / 2);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
gluLookAt(3.0f, 1.5f, 3.0f, // Eye-position
|
||||
0.0f, 0.0f, 0.0f, // View-point
|
||||
0.0f, 1.0f, 0.0f); // Up-vector
|
||||
|
||||
// Configure and enable light source 1
|
||||
glLightfv(GL_LIGHT1, GL_POSITION, light_position);
|
||||
glLightfv(GL_LIGHT1, GL_AMBIENT, light_ambient);
|
||||
glLightfv(GL_LIGHT1, GL_DIFFUSE, light_diffuse);
|
||||
glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular);
|
||||
glEnable(GL_LIGHT1);
|
||||
glEnable(GL_LIGHTING);
|
||||
|
||||
// Draw scene
|
||||
drawScene();
|
||||
|
||||
// Disable lighting
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
// Disable face culling
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
// Disable depth test
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
// Disable scissor test
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
|
||||
// Draw a border around the active view
|
||||
if (active_view > 0 && active_view != 2)
|
||||
{
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0.0, 2.0, 0.0, 2.0, 0.0, 1.0);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef((GLfloat) ((active_view - 1) & 1), (GLfloat) (1 - (active_view - 1) / 2), 0.0f);
|
||||
|
||||
glColor3f(1.0f, 1.0f, 0.6f);
|
||||
|
||||
glBegin(GL_LINE_STRIP);
|
||||
glVertex2i(0, 0);
|
||||
glVertex2i(1, 0);
|
||||
glVertex2i(1, 1);
|
||||
glVertex2i(0, 1);
|
||||
glVertex2i(0, 0);
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Framebuffer size callback function
|
||||
//========================================================================
|
||||
|
||||
static void framebufferSizeFun(GLFWwindow* window, int w, int h)
|
||||
{
|
||||
width = w;
|
||||
height = h > 0 ? h : 1;
|
||||
do_redraw = 1;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Window refresh callback function
|
||||
//========================================================================
|
||||
|
||||
static void windowRefreshFun(GLFWwindow* window)
|
||||
{
|
||||
do_redraw = 1;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Mouse position callback function
|
||||
//========================================================================
|
||||
|
||||
static void cursorPosFun(GLFWwindow* window, double x, double y)
|
||||
{
|
||||
// Depending on which view was selected, rotate around different axes
|
||||
switch (active_view)
|
||||
{
|
||||
case 1:
|
||||
rot_x += (int) (y - ypos);
|
||||
rot_z += (int) (x - xpos);
|
||||
do_redraw = 1;
|
||||
break;
|
||||
case 3:
|
||||
rot_x += (int) (y - ypos);
|
||||
rot_y += (int) (x - xpos);
|
||||
do_redraw = 1;
|
||||
break;
|
||||
case 4:
|
||||
rot_y += (int) (x - xpos);
|
||||
rot_z += (int) (y - ypos);
|
||||
do_redraw = 1;
|
||||
break;
|
||||
default:
|
||||
// Do nothing for perspective view, or if no view is selected
|
||||
break;
|
||||
}
|
||||
|
||||
// Remember cursor position
|
||||
xpos = x;
|
||||
ypos = y;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Mouse button callback function
|
||||
//========================================================================
|
||||
|
||||
static void mouseButtonFun(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
if ((button == GLFW_MOUSE_BUTTON_LEFT) && action == GLFW_PRESS)
|
||||
{
|
||||
// Detect which of the four views was clicked
|
||||
active_view = 1;
|
||||
if (xpos >= width / 2)
|
||||
active_view += 1;
|
||||
if (ypos >= height / 2)
|
||||
active_view += 2;
|
||||
}
|
||||
else if (button == GLFW_MOUSE_BUTTON_LEFT)
|
||||
{
|
||||
// Deselect any previously selected view
|
||||
active_view = 0;
|
||||
}
|
||||
|
||||
do_redraw = 1;
|
||||
}
|
||||
|
||||
static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// main
|
||||
//========================================================================
|
||||
|
||||
int main(void)
|
||||
{
|
||||
GLFWwindow* window;
|
||||
|
||||
// Initialise GLFW
|
||||
if (!glfwInit())
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Open OpenGL window
|
||||
window = glfwCreateWindow(500, 500, "Split view demo", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
fprintf(stderr, "Failed to open GLFW window\n");
|
||||
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Set callback functions
|
||||
glfwSetFramebufferSizeCallback(window, framebufferSizeFun);
|
||||
glfwSetWindowRefreshCallback(window, windowRefreshFun);
|
||||
glfwSetCursorPosCallback(window, cursorPosFun);
|
||||
glfwSetMouseButtonCallback(window, mouseButtonFun);
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
|
||||
// Enable vsync
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
framebufferSizeFun(window, width, height);
|
||||
|
||||
// Main loop
|
||||
for (;;)
|
||||
{
|
||||
// Only redraw if we need to
|
||||
if (do_redraw)
|
||||
{
|
||||
// Draw all views
|
||||
drawAllViews();
|
||||
|
||||
// Swap buffers
|
||||
glfwSwapBuffers(window);
|
||||
|
||||
do_redraw = 0;
|
||||
}
|
||||
|
||||
// Wait for new events
|
||||
glfwWaitEvents();
|
||||
|
||||
// Check if the window should be closed
|
||||
if (glfwWindowShouldClose(window))
|
||||
break;
|
||||
}
|
||||
|
||||
// Close OpenGL window and terminate GLFW
|
||||
glfwTerminate();
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
452
examples/common/glfw/examples/wave.c
Normal file
452
examples/common/glfw/examples/wave.c
Normal file
|
@ -0,0 +1,452 @@
|
|||
/*****************************************************************************
|
||||
* Wave Simulation in OpenGL
|
||||
* (C) 2002 Jakob Thomsen
|
||||
* http://home.in.tum.de/~thomsen
|
||||
* Modified for GLFW by Sylvain Hellegouarch - sh@programmationworld.com
|
||||
* Modified for variable frame rate by Marcus Geelnard
|
||||
* 2003-Jan-31: Minor cleanups and speedups / MG
|
||||
* 2010-10-24: Formatting and cleanup - Camilla Berglund
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897932384626433832795
|
||||
#endif
|
||||
|
||||
// Maximum delta T to allow for differential calculations
|
||||
#define MAX_DELTA_T 0.01
|
||||
|
||||
// Animation speed (10.0 looks good)
|
||||
#define ANIMATION_SPEED 10.0
|
||||
|
||||
GLfloat alpha = 210.f, beta = -70.f;
|
||||
GLfloat zoom = 2.f;
|
||||
|
||||
double cursorX;
|
||||
double cursorY;
|
||||
|
||||
struct Vertex
|
||||
{
|
||||
GLfloat x, y, z;
|
||||
GLfloat r, g, b;
|
||||
};
|
||||
|
||||
#define GRIDW 50
|
||||
#define GRIDH 50
|
||||
#define VERTEXNUM (GRIDW*GRIDH)
|
||||
|
||||
#define QUADW (GRIDW - 1)
|
||||
#define QUADH (GRIDH - 1)
|
||||
#define QUADNUM (QUADW*QUADH)
|
||||
|
||||
GLuint quad[4 * QUADNUM];
|
||||
struct Vertex vertex[VERTEXNUM];
|
||||
|
||||
/* The grid will look like this:
|
||||
*
|
||||
* 3 4 5
|
||||
* *---*---*
|
||||
* | | |
|
||||
* | 0 | 1 |
|
||||
* | | |
|
||||
* *---*---*
|
||||
* 0 1 2
|
||||
*/
|
||||
|
||||
//========================================================================
|
||||
// Initialize grid geometry
|
||||
//========================================================================
|
||||
|
||||
void init_vertices(void)
|
||||
{
|
||||
int x, y, p;
|
||||
|
||||
// Place the vertices in a grid
|
||||
for (y = 0; y < GRIDH; y++)
|
||||
{
|
||||
for (x = 0; x < GRIDW; x++)
|
||||
{
|
||||
p = y * GRIDW + x;
|
||||
|
||||
vertex[p].x = (GLfloat) (x - GRIDW / 2) / (GLfloat) (GRIDW / 2);
|
||||
vertex[p].y = (GLfloat) (y - GRIDH / 2) / (GLfloat) (GRIDH / 2);
|
||||
vertex[p].z = 0;
|
||||
|
||||
if ((x % 4 < 2) ^ (y % 4 < 2))
|
||||
vertex[p].r = 0.0;
|
||||
else
|
||||
vertex[p].r = 1.0;
|
||||
|
||||
vertex[p].g = (GLfloat) y / (GLfloat) GRIDH;
|
||||
vertex[p].b = 1.f - ((GLfloat) x / (GLfloat) GRIDW + (GLfloat) y / (GLfloat) GRIDH) / 2.f;
|
||||
}
|
||||
}
|
||||
|
||||
for (y = 0; y < QUADH; y++)
|
||||
{
|
||||
for (x = 0; x < QUADW; x++)
|
||||
{
|
||||
p = 4 * (y * QUADW + x);
|
||||
|
||||
quad[p + 0] = y * GRIDW + x; // Some point
|
||||
quad[p + 1] = y * GRIDW + x + 1; // Neighbor at the right side
|
||||
quad[p + 2] = (y + 1) * GRIDW + x + 1; // Upper right neighbor
|
||||
quad[p + 3] = (y + 1) * GRIDW + x; // Upper neighbor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double dt;
|
||||
double p[GRIDW][GRIDH];
|
||||
double vx[GRIDW][GRIDH], vy[GRIDW][GRIDH];
|
||||
double ax[GRIDW][GRIDH], ay[GRIDW][GRIDH];
|
||||
|
||||
//========================================================================
|
||||
// Initialize grid
|
||||
//========================================================================
|
||||
|
||||
void init_grid(void)
|
||||
{
|
||||
int x, y;
|
||||
double dx, dy, d;
|
||||
|
||||
for (y = 0; y < GRIDH; y++)
|
||||
{
|
||||
for (x = 0; x < GRIDW; x++)
|
||||
{
|
||||
dx = (double) (x - GRIDW / 2);
|
||||
dy = (double) (y - GRIDH / 2);
|
||||
d = sqrt(dx * dx + dy * dy);
|
||||
if (d < 0.1 * (double) (GRIDW / 2))
|
||||
{
|
||||
d = d * 10.0;
|
||||
p[x][y] = -cos(d * (M_PI / (double)(GRIDW * 4))) * 100.0;
|
||||
}
|
||||
else
|
||||
p[x][y] = 0.0;
|
||||
|
||||
vx[x][y] = 0.0;
|
||||
vy[x][y] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Draw scene
|
||||
//========================================================================
|
||||
|
||||
void draw_scene(GLFWwindow* window)
|
||||
{
|
||||
// Clear the color and depth buffers
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// We don't want to modify the projection matrix
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
// Move back
|
||||
glTranslatef(0.0, 0.0, -zoom);
|
||||
// Rotate the view
|
||||
glRotatef(beta, 1.0, 0.0, 0.0);
|
||||
glRotatef(alpha, 0.0, 0.0, 1.0);
|
||||
|
||||
glDrawElements(GL_QUADS, 4 * QUADNUM, GL_UNSIGNED_INT, quad);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Initialize Miscellaneous OpenGL state
|
||||
//========================================================================
|
||||
|
||||
void init_opengl(void)
|
||||
{
|
||||
// Use Gouraud (smooth) shading
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
// Switch on the z-buffer
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glVertexPointer(3, GL_FLOAT, sizeof(struct Vertex), vertex);
|
||||
glColorPointer(3, GL_FLOAT, sizeof(struct Vertex), &vertex[0].r); // Pointer to the first color
|
||||
|
||||
glPointSize(2.0);
|
||||
|
||||
// Background color is black
|
||||
glClearColor(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Modify the height of each vertex according to the pressure
|
||||
//========================================================================
|
||||
|
||||
void adjust_grid(void)
|
||||
{
|
||||
int pos;
|
||||
int x, y;
|
||||
|
||||
for (y = 0; y < GRIDH; y++)
|
||||
{
|
||||
for (x = 0; x < GRIDW; x++)
|
||||
{
|
||||
pos = y * GRIDW + x;
|
||||
vertex[pos].z = (float) (p[x][y] * (1.0 / 50.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Calculate wave propagation
|
||||
//========================================================================
|
||||
|
||||
void calc_grid(void)
|
||||
{
|
||||
int x, y, x2, y2;
|
||||
double time_step = dt * ANIMATION_SPEED;
|
||||
|
||||
// Compute accelerations
|
||||
for (x = 0; x < GRIDW; x++)
|
||||
{
|
||||
x2 = (x + 1) % GRIDW;
|
||||
for(y = 0; y < GRIDH; y++)
|
||||
ax[x][y] = p[x][y] - p[x2][y];
|
||||
}
|
||||
|
||||
for (y = 0; y < GRIDH; y++)
|
||||
{
|
||||
y2 = (y + 1) % GRIDH;
|
||||
for(x = 0; x < GRIDW; x++)
|
||||
ay[x][y] = p[x][y] - p[x][y2];
|
||||
}
|
||||
|
||||
// Compute speeds
|
||||
for (x = 0; x < GRIDW; x++)
|
||||
{
|
||||
for (y = 0; y < GRIDH; y++)
|
||||
{
|
||||
vx[x][y] = vx[x][y] + ax[x][y] * time_step;
|
||||
vy[x][y] = vy[x][y] + ay[x][y] * time_step;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute pressure
|
||||
for (x = 1; x < GRIDW; x++)
|
||||
{
|
||||
x2 = x - 1;
|
||||
for (y = 1; y < GRIDH; y++)
|
||||
{
|
||||
y2 = y - 1;
|
||||
p[x][y] = p[x][y] + (vx[x2][y] - vx[x][y] + vy[x][y2] - vy[x][y]) * time_step;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Print errors
|
||||
//========================================================================
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Handle key strokes
|
||||
//========================================================================
|
||||
|
||||
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
if (action != GLFW_PRESS)
|
||||
return;
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case GLFW_KEY_ESCAPE:
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
break;
|
||||
case GLFW_KEY_SPACE:
|
||||
init_grid();
|
||||
break;
|
||||
case GLFW_KEY_LEFT:
|
||||
alpha += 5;
|
||||
break;
|
||||
case GLFW_KEY_RIGHT:
|
||||
alpha -= 5;
|
||||
break;
|
||||
case GLFW_KEY_UP:
|
||||
beta -= 5;
|
||||
break;
|
||||
case GLFW_KEY_DOWN:
|
||||
beta += 5;
|
||||
break;
|
||||
case GLFW_KEY_PAGE_UP:
|
||||
zoom -= 0.25f;
|
||||
if (zoom < 0.f)
|
||||
zoom = 0.f;
|
||||
break;
|
||||
case GLFW_KEY_PAGE_DOWN:
|
||||
zoom += 0.25f;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Callback function for mouse button events
|
||||
//========================================================================
|
||||
|
||||
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||
{
|
||||
if (button != GLFW_MOUSE_BUTTON_LEFT)
|
||||
return;
|
||||
|
||||
if (action == GLFW_PRESS)
|
||||
{
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
|
||||
glfwGetCursorPos(window, &cursorX, &cursorY);
|
||||
}
|
||||
else
|
||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Callback function for cursor motion events
|
||||
//========================================================================
|
||||
|
||||
void cursor_position_callback(GLFWwindow* window, double x, double y)
|
||||
{
|
||||
if (glfwGetInputMode(window, GLFW_CURSOR) == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
alpha += (GLfloat) (x - cursorX) / 10.f;
|
||||
beta += (GLfloat) (y - cursorY) / 10.f;
|
||||
|
||||
cursorX = x;
|
||||
cursorY = y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Callback function for scroll events
|
||||
//========================================================================
|
||||
|
||||
void scroll_callback(GLFWwindow* window, double x, double y)
|
||||
{
|
||||
zoom += (float) y / 4.f;
|
||||
if (zoom < 0)
|
||||
zoom = 0;
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// Callback function for framebuffer resize events
|
||||
//========================================================================
|
||||
|
||||
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
|
||||
{
|
||||
float ratio = 1.f;
|
||||
|
||||
if (height > 0)
|
||||
ratio = (float) width / (float) height;
|
||||
|
||||
// Setup viewport
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
// Change to the projection matrix and set our viewing volume
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(60.0, ratio, 1.0, 1024.0);
|
||||
}
|
||||
|
||||
|
||||
//========================================================================
|
||||
// main
|
||||
//========================================================================
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
GLFWwindow* window;
|
||||
double t, dt_total, t_old;
|
||||
int width, height;
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
window = glfwCreateWindow(640, 480, "Wave Simulation", NULL, NULL);
|
||||
if (!window)
|
||||
{
|
||||
glfwTerminate();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
|
||||
glfwSetMouseButtonCallback(window, mouse_button_callback);
|
||||
glfwSetCursorPosCallback(window, cursor_position_callback);
|
||||
glfwSetScrollCallback(window, scroll_callback);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwGetFramebufferSize(window, &width, &height);
|
||||
framebuffer_size_callback(window, width, height);
|
||||
|
||||
// Initialize OpenGL
|
||||
init_opengl();
|
||||
|
||||
// Initialize simulation
|
||||
init_vertices();
|
||||
init_grid();
|
||||
adjust_grid();
|
||||
|
||||
// Initialize timer
|
||||
t_old = glfwGetTime() - 0.01;
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
t = glfwGetTime();
|
||||
dt_total = t - t_old;
|
||||
t_old = t;
|
||||
|
||||
// Safety - iterate if dt_total is too large
|
||||
while (dt_total > 0.f)
|
||||
{
|
||||
// Select iteration time step
|
||||
dt = dt_total > MAX_DELTA_T ? MAX_DELTA_T : dt_total;
|
||||
dt_total -= dt;
|
||||
|
||||
// Calculate wave propagation
|
||||
calc_grid();
|
||||
}
|
||||
|
||||
// Compute height of each vertex
|
||||
adjust_grid();
|
||||
|
||||
// Draw wave grid to OpenGL display
|
||||
draw_scene(window);
|
||||
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
3355
examples/common/glfw/include/GLFW/glfw3.h
Normal file
3355
examples/common/glfw/include/GLFW/glfw3.h
Normal file
File diff suppressed because it is too large
Load Diff
356
examples/common/glfw/include/GLFW/glfw3native.h
Normal file
356
examples/common/glfw/include/GLFW/glfw3native.h
Normal file
|
@ -0,0 +1,356 @@
|
|||
/*************************************************************************
|
||||
* GLFW 3.1 - www.glfw.org
|
||||
* A library for OpenGL, window and input
|
||||
*------------------------------------------------------------------------
|
||||
* Copyright (c) 2002-2006 Marcus Geelnard
|
||||
* Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.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 _glfw3_native_h_
|
||||
#define _glfw3_native_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Doxygen documentation
|
||||
*************************************************************************/
|
||||
|
||||
/*! @defgroup native Native access
|
||||
*
|
||||
* **By using the native access functions you assert that you know what you're
|
||||
* doing and how to fix problems caused by using them. If you don't, you
|
||||
* shouldn't be using them.**
|
||||
*
|
||||
* Before the inclusion of @ref glfw3native.h, you must define exactly one
|
||||
* window system API macro and exactly one context creation API macro. Failure
|
||||
* to do this will cause a compile-time error.
|
||||
*
|
||||
* The available window API macros are:
|
||||
* * `GLFW_EXPOSE_NATIVE_WIN32`
|
||||
* * `GLFW_EXPOSE_NATIVE_COCOA`
|
||||
* * `GLFW_EXPOSE_NATIVE_X11`
|
||||
*
|
||||
* The available context API macros are:
|
||||
* * `GLFW_EXPOSE_NATIVE_WGL`
|
||||
* * `GLFW_EXPOSE_NATIVE_NSGL`
|
||||
* * `GLFW_EXPOSE_NATIVE_GLX`
|
||||
* * `GLFW_EXPOSE_NATIVE_EGL`
|
||||
*
|
||||
* These macros select which of the native access functions that are declared
|
||||
* and which platform-specific headers to include. It is then up your (by
|
||||
* definition platform-specific) code to handle which of these should be
|
||||
* defined.
|
||||
*/
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* System headers and types
|
||||
*************************************************************************/
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
||||
// This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
|
||||
// example to allow applications to correctly declare a GL_ARB_debug_output
|
||||
// callback) but windows.h assumes no one will define APIENTRY before it does
|
||||
#undef APIENTRY
|
||||
#include <windows.h>
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#if defined(__OBJC__)
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#else
|
||||
typedef void* id;
|
||||
#endif
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_X11)
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/Xrandr.h>
|
||||
#else
|
||||
#error "No window API selected"
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||
/* WGL is declared by windows.h */
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||
/* NSGL is declared by Cocoa.h */
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||
#include <GL/glx.h>
|
||||
#elif defined(GLFW_EXPOSE_NATIVE_EGL)
|
||||
#include <EGL/egl.h>
|
||||
#else
|
||||
#error "No context API selected"
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Functions
|
||||
*************************************************************************/
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WIN32)
|
||||
/*! @brief Returns the adapter device name of the specified monitor.
|
||||
*
|
||||
* @return The UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`)
|
||||
* of the specified monitor, or `NULL` if an [error](@ref error_handling)
|
||||
* occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the display device name of the specified monitor.
|
||||
*
|
||||
* @return The UTF-8 encoded display device name (for example
|
||||
* `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `HWND` of the specified window.
|
||||
*
|
||||
* @return The `HWND` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_WGL)
|
||||
/*! @brief Returns the `HGLRC` of the specified window.
|
||||
*
|
||||
* @return The `HGLRC` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_COCOA)
|
||||
/*! @brief Returns the `CGDirectDisplayID` of the specified monitor.
|
||||
*
|
||||
* @return The `CGDirectDisplayID` of the specified monitor, or
|
||||
* `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `NSWindow` of the specified window.
|
||||
*
|
||||
* @return The `NSWindow` of the specified window, or `nil` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
|
||||
/*! @brief Returns the `NSOpenGLContext` of the specified window.
|
||||
*
|
||||
* @return The `NSOpenGLContext` of the specified window, or `nil` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_X11)
|
||||
/*! @brief Returns the `Display` used by GLFW.
|
||||
*
|
||||
* @return The `Display` used by GLFW, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI Display* glfwGetX11Display(void);
|
||||
|
||||
/*! @brief Returns the `RRCrtc` of the specified monitor.
|
||||
*
|
||||
* @return The `RRCrtc` of the specified monitor, or `None` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `RROutput` of the specified monitor.
|
||||
*
|
||||
* @return The `RROutput` of the specified monitor, or `None` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.1.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
|
||||
|
||||
/*! @brief Returns the `Window` of the specified window.
|
||||
*
|
||||
* @return The `Window` of the specified window, or `None` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_GLX)
|
||||
/*! @brief Returns the `GLXContext` of the specified window.
|
||||
*
|
||||
* @return The `GLXContext` of the specified window, or `NULL` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#if defined(GLFW_EXPOSE_NATIVE_EGL)
|
||||
/*! @brief Returns the `EGLDisplay` used by GLFW.
|
||||
*
|
||||
* @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
|
||||
|
||||
/*! @brief Returns the `EGLContext` of the specified window.
|
||||
*
|
||||
* @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
|
||||
|
||||
/*! @brief Returns the `EGLSurface` of the specified window.
|
||||
*
|
||||
* @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
|
||||
* [error](@ref error_handling) occurred.
|
||||
*
|
||||
* @par Thread Safety
|
||||
* This function may be called from any thread. Access is not synchronized.
|
||||
*
|
||||
* @par History
|
||||
* Added in GLFW 3.0.
|
||||
*
|
||||
* @ingroup native
|
||||
*/
|
||||
GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _glfw3_native_h_ */
|
||||
|
95
examples/common/glfw/src/CMakeLists.txt
Normal file
95
examples/common/glfw/src/CMakeLists.txt
Normal file
|
@ -0,0 +1,95 @@
|
|||
|
||||
include_directories("${GLFW_SOURCE_DIR}/src"
|
||||
"${GLFW_BINARY_DIR}/src"
|
||||
${glfw_INCLUDE_DIRS})
|
||||
|
||||
add_definitions(-D_GLFW_USE_CONFIG_H)
|
||||
|
||||
set(common_HEADERS internal.h
|
||||
"${GLFW_BINARY_DIR}/src/glfw_config.h"
|
||||
"${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
|
||||
"${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h")
|
||||
set(common_SOURCES context.c init.c input.c monitor.c window.c)
|
||||
|
||||
if (_GLFW_COCOA)
|
||||
set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h iokit_joystick.h
|
||||
posix_tls.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_monitor.m
|
||||
cocoa_window.m iokit_joystick.m mach_time.c posix_tls.c)
|
||||
elseif (_GLFW_WIN32)
|
||||
set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_tls.h
|
||||
winmm_joystick.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_monitor.c win32_time.c
|
||||
win32_tls.c win32_window.c winmm_joystick.c)
|
||||
elseif (_GLFW_X11)
|
||||
set(glfw_HEADERS ${common_HEADERS} x11_platform.h xkb_unicode.h
|
||||
linux_joystick.h posix_time.h posix_tls.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} x11_init.c x11_monitor.c x11_window.c
|
||||
xkb_unicode.c linux_joystick.c posix_time.c posix_tls.c)
|
||||
elseif (_GLFW_WAYLAND)
|
||||
set(glfw_HEADERS ${common_HEADERS} wl_platform.h linux_joystick.h
|
||||
posix_time.h posix_tls.h xkb_unicode.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c
|
||||
linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c)
|
||||
elseif (_GLFW_MIR)
|
||||
set(glfw_HEADERS ${common_HEADERS} mir_platform.h linux_joystick.h
|
||||
posix_time.h posix_tls.h xkb_unicode.h)
|
||||
set(glfw_SOURCES ${common_SOURCES} mir_init.c mir_monitor.c mir_window.c
|
||||
linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c)
|
||||
endif()
|
||||
|
||||
if (_GLFW_EGL)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} egl_context.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} egl_context.c)
|
||||
elseif (_GLFW_NSGL)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} nsgl_context.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} nsgl_context.m)
|
||||
elseif (_GLFW_WGL)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} wgl_context.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} wgl_context.c)
|
||||
elseif (_GLFW_X11)
|
||||
list(APPEND glfw_HEADERS ${common_HEADERS} glx_context.h)
|
||||
list(APPEND glfw_SOURCES ${common_SOURCES} glx_context.c)
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
# For some reason, CMake doesn't know about .m
|
||||
set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
|
||||
endif()
|
||||
|
||||
add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
|
||||
set_target_properties(glfw PROPERTIES
|
||||
OUTPUT_NAME "${GLFW_LIB_NAME}"
|
||||
VERSION ${GLFW_VERSION}
|
||||
SOVERSION ${GLFW_VERSION_MAJOR}
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
FOLDER "GLFW3")
|
||||
|
||||
if (BUILD_SHARED_LIBS)
|
||||
if (WIN32)
|
||||
# The GLFW DLL needs a special compile-time macro and import library name
|
||||
set_target_properties(glfw PROPERTIES PREFIX "" IMPORT_PREFIX "")
|
||||
|
||||
if (MINGW)
|
||||
set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.a")
|
||||
else()
|
||||
set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
|
||||
endif()
|
||||
elseif (APPLE)
|
||||
# Append -fno-common to the compile flags to work around a bug in
|
||||
# Apple's GCC
|
||||
get_target_property(glfw_CFLAGS glfw COMPILE_FLAGS)
|
||||
if (NOT glfw_CFLAGS)
|
||||
set(glfw_CFLAGS "")
|
||||
endif()
|
||||
set_target_properties(glfw PROPERTIES
|
||||
COMPILE_FLAGS "${glfw_CFLAGS} -fno-common"
|
||||
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
|
||||
endif()
|
||||
target_link_libraries(glfw ${glfw_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if (GLFW_INSTALL)
|
||||
install(TARGETS glfw EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX})
|
||||
endif()
|
||||
|
272
examples/common/glfw/src/cocoa_init.m
Normal file
272
examples/common/glfw/src/cocoa_init.m
Normal file
|
@ -0,0 +1,272 @@
|
|||
//========================================================================
|
||||
// GLFW 3.1 OS X - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.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.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
#include <sys/param.h> // For MAXPATHLEN
|
||||
|
||||
|
||||
#if defined(_GLFW_USE_CHDIR)
|
||||
|
||||
// Change to our application bundle's resources directory, if present
|
||||
//
|
||||
static void changeToResourcesDirectory(void)
|
||||
{
|
||||
char resourcesPath[MAXPATHLEN];
|
||||
|
||||
CFBundleRef bundle = CFBundleGetMainBundle();
|
||||
if (!bundle)
|
||||
return;
|
||||
|
||||
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(bundle);
|
||||
|
||||
CFStringRef last = CFURLCopyLastPathComponent(resourcesURL);
|
||||
if (CFStringCompare(CFSTR("Resources"), last, 0) != kCFCompareEqualTo)
|
||||
{
|
||||
CFRelease(last);
|
||||
CFRelease(resourcesURL);
|
||||
return;
|
||||
}
|
||||
|
||||
CFRelease(last);
|
||||
|
||||
if (!CFURLGetFileSystemRepresentation(resourcesURL,
|
||||
true,
|
||||
(UInt8*) resourcesPath,
|
||||
MAXPATHLEN))
|
||||
{
|
||||
CFRelease(resourcesURL);
|
||||
return;
|
||||
}
|
||||
|
||||
CFRelease(resourcesURL);
|
||||
|
||||
chdir(resourcesPath);
|
||||
}
|
||||
|
||||
#endif /* _GLFW_USE_CHDIR */
|
||||
|
||||
// Create key code translation tables
|
||||
//
|
||||
static void createKeyTables(void)
|
||||
{
|
||||
memset(_glfw.ns.publicKeys, -1, sizeof(_glfw.ns.publicKeys));
|
||||
|
||||
_glfw.ns.publicKeys[0x1D] = GLFW_KEY_0;
|
||||
_glfw.ns.publicKeys[0x12] = GLFW_KEY_1;
|
||||
_glfw.ns.publicKeys[0x13] = GLFW_KEY_2;
|
||||
_glfw.ns.publicKeys[0x14] = GLFW_KEY_3;
|
||||
_glfw.ns.publicKeys[0x15] = GLFW_KEY_4;
|
||||
_glfw.ns.publicKeys[0x17] = GLFW_KEY_5;
|
||||
_glfw.ns.publicKeys[0x16] = GLFW_KEY_6;
|
||||
_glfw.ns.publicKeys[0x1A] = GLFW_KEY_7;
|
||||
_glfw.ns.publicKeys[0x1C] = GLFW_KEY_8;
|
||||
_glfw.ns.publicKeys[0x19] = GLFW_KEY_9;
|
||||
_glfw.ns.publicKeys[0x00] = GLFW_KEY_A;
|
||||
_glfw.ns.publicKeys[0x0B] = GLFW_KEY_B;
|
||||
_glfw.ns.publicKeys[0x08] = GLFW_KEY_C;
|
||||
_glfw.ns.publicKeys[0x02] = GLFW_KEY_D;
|
||||
_glfw.ns.publicKeys[0x0E] = GLFW_KEY_E;
|
||||
_glfw.ns.publicKeys[0x03] = GLFW_KEY_F;
|
||||
_glfw.ns.publicKeys[0x05] = GLFW_KEY_G;
|
||||
_glfw.ns.publicKeys[0x04] = GLFW_KEY_H;
|
||||
_glfw.ns.publicKeys[0x22] = GLFW_KEY_I;
|
||||
_glfw.ns.publicKeys[0x26] = GLFW_KEY_J;
|
||||
_glfw.ns.publicKeys[0x28] = GLFW_KEY_K;
|
||||
_glfw.ns.publicKeys[0x25] = GLFW_KEY_L;
|
||||
_glfw.ns.publicKeys[0x2E] = GLFW_KEY_M;
|
||||
_glfw.ns.publicKeys[0x2D] = GLFW_KEY_N;
|
||||
_glfw.ns.publicKeys[0x1F] = GLFW_KEY_O;
|
||||
_glfw.ns.publicKeys[0x23] = GLFW_KEY_P;
|
||||
_glfw.ns.publicKeys[0x0C] = GLFW_KEY_Q;
|
||||
_glfw.ns.publicKeys[0x0F] = GLFW_KEY_R;
|
||||
_glfw.ns.publicKeys[0x01] = GLFW_KEY_S;
|
||||
_glfw.ns.publicKeys[0x11] = GLFW_KEY_T;
|
||||
_glfw.ns.publicKeys[0x20] = GLFW_KEY_U;
|
||||
_glfw.ns.publicKeys[0x09] = GLFW_KEY_V;
|
||||
_glfw.ns.publicKeys[0x0D] = GLFW_KEY_W;
|
||||
_glfw.ns.publicKeys[0x07] = GLFW_KEY_X;
|
||||
_glfw.ns.publicKeys[0x10] = GLFW_KEY_Y;
|
||||
_glfw.ns.publicKeys[0x06] = GLFW_KEY_Z;
|
||||
|
||||
_glfw.ns.publicKeys[0x27] = GLFW_KEY_APOSTROPHE;
|
||||
_glfw.ns.publicKeys[0x2A] = GLFW_KEY_BACKSLASH;
|
||||
_glfw.ns.publicKeys[0x2B] = GLFW_KEY_COMMA;
|
||||
_glfw.ns.publicKeys[0x18] = GLFW_KEY_EQUAL;
|
||||
_glfw.ns.publicKeys[0x32] = GLFW_KEY_GRAVE_ACCENT;
|
||||
_glfw.ns.publicKeys[0x21] = GLFW_KEY_LEFT_BRACKET;
|
||||
_glfw.ns.publicKeys[0x1B] = GLFW_KEY_MINUS;
|
||||
_glfw.ns.publicKeys[0x2F] = GLFW_KEY_PERIOD;
|
||||
_glfw.ns.publicKeys[0x1E] = GLFW_KEY_RIGHT_BRACKET;
|
||||
_glfw.ns.publicKeys[0x29] = GLFW_KEY_SEMICOLON;
|
||||
_glfw.ns.publicKeys[0x2C] = GLFW_KEY_SLASH;
|
||||
_glfw.ns.publicKeys[0x0A] = GLFW_KEY_WORLD_1;
|
||||
|
||||
_glfw.ns.publicKeys[0x33] = GLFW_KEY_BACKSPACE;
|
||||
_glfw.ns.publicKeys[0x39] = GLFW_KEY_CAPS_LOCK;
|
||||
_glfw.ns.publicKeys[0x75] = GLFW_KEY_DELETE;
|
||||
_glfw.ns.publicKeys[0x7D] = GLFW_KEY_DOWN;
|
||||
_glfw.ns.publicKeys[0x77] = GLFW_KEY_END;
|
||||
_glfw.ns.publicKeys[0x24] = GLFW_KEY_ENTER;
|
||||
_glfw.ns.publicKeys[0x35] = GLFW_KEY_ESCAPE;
|
||||
_glfw.ns.publicKeys[0x7A] = GLFW_KEY_F1;
|
||||
_glfw.ns.publicKeys[0x78] = GLFW_KEY_F2;
|
||||
_glfw.ns.publicKeys[0x63] = GLFW_KEY_F3;
|
||||
_glfw.ns.publicKeys[0x76] = GLFW_KEY_F4;
|
||||
_glfw.ns.publicKeys[0x60] = GLFW_KEY_F5;
|
||||
_glfw.ns.publicKeys[0x61] = GLFW_KEY_F6;
|
||||
_glfw.ns.publicKeys[0x62] = GLFW_KEY_F7;
|
||||
_glfw.ns.publicKeys[0x64] = GLFW_KEY_F8;
|
||||
_glfw.ns.publicKeys[0x65] = GLFW_KEY_F9;
|
||||
_glfw.ns.publicKeys[0x6D] = GLFW_KEY_F10;
|
||||
_glfw.ns.publicKeys[0x67] = GLFW_KEY_F11;
|
||||
_glfw.ns.publicKeys[0x6F] = GLFW_KEY_F12;
|
||||
_glfw.ns.publicKeys[0x69] = GLFW_KEY_F13;
|
||||
_glfw.ns.publicKeys[0x6B] = GLFW_KEY_F14;
|
||||
_glfw.ns.publicKeys[0x71] = GLFW_KEY_F15;
|
||||
_glfw.ns.publicKeys[0x6A] = GLFW_KEY_F16;
|
||||
_glfw.ns.publicKeys[0x40] = GLFW_KEY_F17;
|
||||
_glfw.ns.publicKeys[0x4F] = GLFW_KEY_F18;
|
||||
_glfw.ns.publicKeys[0x50] = GLFW_KEY_F19;
|
||||
_glfw.ns.publicKeys[0x5A] = GLFW_KEY_F20;
|
||||
_glfw.ns.publicKeys[0x73] = GLFW_KEY_HOME;
|
||||
_glfw.ns.publicKeys[0x72] = GLFW_KEY_INSERT;
|
||||
_glfw.ns.publicKeys[0x7B] = GLFW_KEY_LEFT;
|
||||
_glfw.ns.publicKeys[0x3A] = GLFW_KEY_LEFT_ALT;
|
||||
_glfw.ns.publicKeys[0x3B] = GLFW_KEY_LEFT_CONTROL;
|
||||
_glfw.ns.publicKeys[0x38] = GLFW_KEY_LEFT_SHIFT;
|
||||
_glfw.ns.publicKeys[0x37] = GLFW_KEY_LEFT_SUPER;
|
||||
_glfw.ns.publicKeys[0x6E] = GLFW_KEY_MENU;
|
||||
_glfw.ns.publicKeys[0x47] = GLFW_KEY_NUM_LOCK;
|
||||
_glfw.ns.publicKeys[0x79] = GLFW_KEY_PAGE_DOWN;
|
||||
_glfw.ns.publicKeys[0x74] = GLFW_KEY_PAGE_UP;
|
||||
_glfw.ns.publicKeys[0x7C] = GLFW_KEY_RIGHT;
|
||||
_glfw.ns.publicKeys[0x3D] = GLFW_KEY_RIGHT_ALT;
|
||||
_glfw.ns.publicKeys[0x3E] = GLFW_KEY_RIGHT_CONTROL;
|
||||
_glfw.ns.publicKeys[0x3C] = GLFW_KEY_RIGHT_SHIFT;
|
||||
_glfw.ns.publicKeys[0x36] = GLFW_KEY_RIGHT_SUPER;
|
||||
_glfw.ns.publicKeys[0x31] = GLFW_KEY_SPACE;
|
||||
_glfw.ns.publicKeys[0x30] = GLFW_KEY_TAB;
|
||||
_glfw.ns.publicKeys[0x7E] = GLFW_KEY_UP;
|
||||
|
||||
_glfw.ns.publicKeys[0x52] = GLFW_KEY_KP_0;
|
||||
_glfw.ns.publicKeys[0x53] = GLFW_KEY_KP_1;
|
||||
_glfw.ns.publicKeys[0x54] = GLFW_KEY_KP_2;
|
||||
_glfw.ns.publicKeys[0x55] = GLFW_KEY_KP_3;
|
||||
_glfw.ns.publicKeys[0x56] = GLFW_KEY_KP_4;
|
||||
_glfw.ns.publicKeys[0x57] = GLFW_KEY_KP_5;
|
||||
_glfw.ns.publicKeys[0x58] = GLFW_KEY_KP_6;
|
||||
_glfw.ns.publicKeys[0x59] = GLFW_KEY_KP_7;
|
||||
_glfw.ns.publicKeys[0x5B] = GLFW_KEY_KP_8;
|
||||
_glfw.ns.publicKeys[0x5C] = GLFW_KEY_KP_9;
|
||||
_glfw.ns.publicKeys[0x45] = GLFW_KEY_KP_ADD;
|
||||
_glfw.ns.publicKeys[0x41] = GLFW_KEY_KP_DECIMAL;
|
||||
_glfw.ns.publicKeys[0x4B] = GLFW_KEY_KP_DIVIDE;
|
||||
_glfw.ns.publicKeys[0x4C] = GLFW_KEY_KP_ENTER;
|
||||
_glfw.ns.publicKeys[0x51] = GLFW_KEY_KP_EQUAL;
|
||||
_glfw.ns.publicKeys[0x43] = GLFW_KEY_KP_MULTIPLY;
|
||||
_glfw.ns.publicKeys[0x4E] = GLFW_KEY_KP_SUBTRACT;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int _glfwPlatformInit(void)
|
||||
{
|
||||
_glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
#if defined(_GLFW_USE_CHDIR)
|
||||
changeToResourcesDirectory();
|
||||
#endif
|
||||
|
||||
createKeyTables();
|
||||
|
||||
_glfw.ns.eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
|
||||
if (!_glfw.ns.eventSource)
|
||||
return GL_FALSE;
|
||||
|
||||
CGEventSourceSetLocalEventsSuppressionInterval(_glfw.ns.eventSource, 0.0);
|
||||
|
||||
if (!_glfwInitContextAPI())
|
||||
return GL_FALSE;
|
||||
|
||||
_glfwInitTimer();
|
||||
_glfwInitJoysticks();
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
void _glfwPlatformTerminate(void)
|
||||
{
|
||||
if (_glfw.ns.eventSource)
|
||||
{
|
||||
CFRelease(_glfw.ns.eventSource);
|
||||
_glfw.ns.eventSource = NULL;
|
||||
}
|
||||
|
||||
if (_glfw.ns.delegate)
|
||||
{
|
||||
[NSApp setDelegate:nil];
|
||||
[_glfw.ns.delegate release];
|
||||
_glfw.ns.delegate = nil;
|
||||
}
|
||||
|
||||
[_glfw.ns.autoreleasePool release];
|
||||
_glfw.ns.autoreleasePool = nil;
|
||||
|
||||
[_glfw.ns.cursor release];
|
||||
_glfw.ns.cursor = nil;
|
||||
|
||||
free(_glfw.ns.clipboardString);
|
||||
|
||||
_glfwTerminateJoysticks();
|
||||
_glfwTerminateContextAPI();
|
||||
}
|
||||
|
||||
const char* _glfwPlatformGetVersionString(void)
|
||||
{
|
||||
const char* version = _GLFW_VERSION_NUMBER " Cocoa"
|
||||
#if defined(_GLFW_NSGL)
|
||||
" NSGL"
|
||||
#endif
|
||||
#if defined(_GLFW_USE_CHDIR)
|
||||
" chdir"
|
||||
#endif
|
||||
#if defined(_GLFW_USE_MENUBAR)
|
||||
" menubar"
|
||||
#endif
|
||||
#if defined(_GLFW_USE_RETINA)
|
||||
" retina"
|
||||
#endif
|
||||
#if defined(_GLFW_BUILD_DLL)
|
||||
" dynamic"
|
||||
#endif
|
||||
;
|
||||
|
||||
return version;
|
||||
}
|
||||
|
439
examples/common/glfw/src/cocoa_monitor.m
Normal file
439
examples/common/glfw/src/cocoa_monitor.m
Normal file
|
@ -0,0 +1,439 @@
|
|||
//========================================================================
|
||||
// GLFW 3.1 OS X - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2002-2006 Marcus Geelnard
|
||||
// Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.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.
|
||||
//
|
||||
//========================================================================
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include <IOKit/graphics/IOGraphicsLib.h>
|
||||
#include <IOKit/graphics/IOGraphicsLib.h>
|
||||
#include <CoreVideo/CVBase.h>
|
||||
#include <CoreVideo/CVDisplayLink.h>
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
|
||||
|
||||
// Get the name of the specified display
|
||||
//
|
||||
static char* getDisplayName(CGDirectDisplayID displayID)
|
||||
{
|
||||
char* name;
|
||||
CFDictionaryRef info, names;
|
||||
CFStringRef value;
|
||||
CFIndex size;
|
||||
|
||||
// NOTE: This uses a deprecated function because Apple has
|
||||
// (as of January 2015) not provided any alternative
|
||||
info = IODisplayCreateInfoDictionary(CGDisplayIOServicePort(displayID),
|
||||
kIODisplayOnlyPreferredName);
|
||||
names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName));
|
||||
|
||||
if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
|
||||
(const void**) &value))
|
||||
{
|
||||
// This may happen if a desktop Mac is running headless
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Failed to retrieve display name");
|
||||
|
||||
CFRelease(info);
|
||||
return strdup("Unknown");
|
||||
}
|
||||
|
||||
size = CFStringGetMaximumSizeForEncoding(CFStringGetLength(value),
|
||||
kCFStringEncodingUTF8);
|
||||
name = calloc(size + 1, sizeof(char));
|
||||
CFStringGetCString(value, name, size, kCFStringEncodingUTF8);
|
||||
|
||||
CFRelease(info);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
// Check whether the display mode should be included in enumeration
|
||||
//
|
||||
static GLboolean modeIsGood(CGDisplayModeRef mode)
|
||||
{
|
||||
uint32_t flags = CGDisplayModeGetIOFlags(mode);
|
||||
if (!(flags & kDisplayModeValidFlag) || !(flags & kDisplayModeSafeFlag))
|
||||
return GL_FALSE;
|
||||
|
||||
if (flags & kDisplayModeInterlacedFlag)
|
||||
return GL_FALSE;
|
||||
|
||||
if (flags & kDisplayModeStretchedFlag)
|
||||
return GL_FALSE;
|
||||
|
||||
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
|
||||
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) &&
|
||||
CFStringCompare(format, CFSTR(IO32BitDirectPixels), 0))
|
||||
{
|
||||
CFRelease(format);
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
CFRelease(format);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
// Convert Core Graphics display mode to GLFW video mode
|
||||
//
|
||||
static GLFWvidmode vidmodeFromCGDisplayMode(CGDisplayModeRef mode,
|
||||
CVDisplayLinkRef link)
|
||||
{
|
||||
GLFWvidmode result;
|
||||
result.width = (int) CGDisplayModeGetWidth(mode);
|
||||
result.height = (int) CGDisplayModeGetHeight(mode);
|
||||
result.refreshRate = (int) CGDisplayModeGetRefreshRate(mode);
|
||||
|
||||
if (result.refreshRate == 0)
|
||||
{
|
||||
const CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link);
|
||||
if (!(time.flags & kCVTimeIsIndefinite))
|
||||
result.refreshRate = (int) (time.timeScale / (double) time.timeValue);
|
||||
}
|
||||
|
||||
CFStringRef format = CGDisplayModeCopyPixelEncoding(mode);
|
||||
|
||||
if (CFStringCompare(format, CFSTR(IO16BitDirectPixels), 0) == 0)
|
||||
{
|
||||
result.redBits = 5;
|
||||
result.greenBits = 5;
|
||||
result.blueBits = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.redBits = 8;
|
||||
result.greenBits = 8;
|
||||
result.blueBits = 8;
|
||||
}
|
||||
|
||||
CFRelease(format);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Starts reservation for display fading
|
||||
//
|
||||
static CGDisplayFadeReservationToken beginFadeReservation(void)
|
||||
{
|
||||
CGDisplayFadeReservationToken token = kCGDisplayFadeReservationInvalidToken;
|
||||
|
||||
if (CGAcquireDisplayFadeReservation(5, &token) == kCGErrorSuccess)
|
||||
CGDisplayFade(token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE);
|
||||
|
||||
return token;
|
||||
}
|
||||
|
||||
// Ends reservation for display fading
|
||||
//
|
||||
static void endFadeReservation(CGDisplayFadeReservationToken token)
|
||||
{
|
||||
if (token != kCGDisplayFadeReservationInvalidToken)
|
||||
{
|
||||
CGDisplayFade(token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
|
||||
CGReleaseDisplayFadeReservation(token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Change the current video mode
|
||||
//
|
||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
|
||||
{
|
||||
CFArrayRef modes;
|
||||
CFIndex count, i;
|
||||
CVDisplayLinkRef link;
|
||||
CGDisplayModeRef native = NULL;
|
||||
GLFWvidmode current;
|
||||
const GLFWvidmode* best;
|
||||
|
||||
best = _glfwChooseVideoMode(monitor, desired);
|
||||
_glfwPlatformGetVideoMode(monitor, ¤t);
|
||||
if (_glfwCompareVideoModes(¤t, best) == 0)
|
||||
return GL_TRUE;
|
||||
|
||||
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
|
||||
|
||||
modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
|
||||
count = CFArrayGetCount(modes);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
|
||||
if (!modeIsGood(dm))
|
||||
continue;
|
||||
|
||||
const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link);
|
||||
if (_glfwCompareVideoModes(best, &mode) == 0)
|
||||
{
|
||||
native = dm;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (native)
|
||||
{
|
||||
if (monitor->ns.previousMode == NULL)
|
||||
monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||
|
||||
CGDisplayFadeReservationToken token = beginFadeReservation();
|
||||
CGDisplaySetDisplayMode(monitor->ns.displayID, native, NULL);
|
||||
endFadeReservation(token);
|
||||
}
|
||||
|
||||
CFRelease(modes);
|
||||
CVDisplayLinkRelease(link);
|
||||
|
||||
if (!native)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Cocoa: Monitor mode list changed");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
// Restore the previously saved (original) video mode
|
||||
//
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||
{
|
||||
if (monitor->ns.previousMode)
|
||||
{
|
||||
CGDisplayFadeReservationToken token = beginFadeReservation();
|
||||
CGDisplaySetDisplayMode(monitor->ns.displayID,
|
||||
monitor->ns.previousMode, NULL);
|
||||
endFadeReservation(token);
|
||||
|
||||
CGDisplayModeRelease(monitor->ns.previousMode);
|
||||
monitor->ns.previousMode = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW platform API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
_GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
{
|
||||
uint32_t i, found = 0, displayCount;
|
||||
_GLFWmonitor** monitors;
|
||||
CGDirectDisplayID* displays;
|
||||
|
||||
*count = 0;
|
||||
|
||||
CGGetOnlineDisplayList(0, NULL, &displayCount);
|
||||
|
||||
displays = calloc(displayCount, sizeof(CGDirectDisplayID));
|
||||
monitors = calloc(displayCount, sizeof(_GLFWmonitor*));
|
||||
|
||||
CGGetOnlineDisplayList(displayCount, displays, &displayCount);
|
||||
|
||||
NSArray* screens = [NSScreen screens];
|
||||
|
||||
for (i = 0; i < displayCount; i++)
|
||||
{
|
||||
int j;
|
||||
|
||||
if (CGDisplayIsAsleep(displays[i]))
|
||||
continue;
|
||||
|
||||
CGDirectDisplayID screenDisplayID = CGDisplayMirrorsDisplay(displays[i]);
|
||||
if (screenDisplayID == kCGNullDirectDisplay)
|
||||
screenDisplayID = displays[i];
|
||||
|
||||
const CGSize size = CGDisplayScreenSize(displays[i]);
|
||||
char* name = getDisplayName(displays[i]);
|
||||
|
||||
monitors[found] = _glfwAllocMonitor(name, size.width, size.height);
|
||||
monitors[found]->ns.displayID = displays[i];
|
||||
|
||||
free(name);
|
||||
|
||||
for (j = 0; j < [screens count]; j++)
|
||||
{
|
||||
NSScreen* screen = [screens objectAtIndex:j];
|
||||
NSDictionary* dictionary = [screen deviceDescription];
|
||||
NSNumber* number = [dictionary objectForKey:@"NSScreenNumber"];
|
||||
|
||||
if ([number unsignedIntegerValue] == screenDisplayID)
|
||||
{
|
||||
monitors[found]->ns.screen = screen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (monitors[found]->ns.screen)
|
||||
found++;
|
||||
else
|
||||
{
|
||||
_glfwFreeMonitor(monitors[found]);
|
||||
monitors[found] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
free(displays);
|
||||
|
||||
*count = found;
|
||||
return monitors;
|
||||
}
|
||||
|
||||
GLboolean _glfwPlatformIsSameMonitor(_GLFWmonitor* first, _GLFWmonitor* second)
|
||||
{
|
||||
return first->ns.displayID == second->ns.displayID;
|
||||
}
|
||||
|
||||
void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
||||
{
|
||||
const CGRect bounds = CGDisplayBounds(monitor->ns.displayID);
|
||||
|
||||
if (xpos)
|
||||
*xpos = (int) bounds.origin.x;
|
||||
if (ypos)
|
||||
*ypos = (int) bounds.origin.y;
|
||||
}
|
||||
|
||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* found)
|
||||
{
|
||||
CFArrayRef modes;
|
||||
CFIndex count, i, j;
|
||||
GLFWvidmode* result;
|
||||
CVDisplayLinkRef link;
|
||||
|
||||
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
|
||||
|
||||
modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
|
||||
count = CFArrayGetCount(modes);
|
||||
|
||||
result = calloc(count, sizeof(GLFWvidmode));
|
||||
*found = 0;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
CGDisplayModeRef dm = (CGDisplayModeRef) CFArrayGetValueAtIndex(modes, i);
|
||||
if (!modeIsGood(dm))
|
||||
continue;
|
||||
|
||||
const GLFWvidmode mode = vidmodeFromCGDisplayMode(dm, link);
|
||||
|
||||
for (j = 0; j < *found; j++)
|
||||
{
|
||||
if (_glfwCompareVideoModes(result + j, &mode) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < *found)
|
||||
{
|
||||
// This is a duplicate, so skip it
|
||||
continue;
|
||||
}
|
||||
|
||||
result[*found] = mode;
|
||||
(*found)++;
|
||||
}
|
||||
|
||||
CFRelease(modes);
|
||||
|
||||
CVDisplayLinkRelease(link);
|
||||
return result;
|
||||
}
|
||||
|
||||
void _glfwPlatformGetVideoMode(_GLFWmonitor* monitor, GLFWvidmode *mode)
|
||||
{
|
||||
CGDisplayModeRef displayMode;
|
||||
CVDisplayLinkRef link;
|
||||
|
||||
CVDisplayLinkCreateWithCGDisplay(monitor->ns.displayID, &link);
|
||||
|
||||
displayMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||
*mode = vidmodeFromCGDisplayMode(displayMode, link);
|
||||
CGDisplayModeRelease(displayMode);
|
||||
|
||||
CVDisplayLinkRelease(link);
|
||||
}
|
||||
|
||||
void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
||||
{
|
||||
uint32_t i, size = CGDisplayGammaTableCapacity(monitor->ns.displayID);
|
||||
CGGammaValue* values = calloc(size * 3, sizeof(CGGammaValue));
|
||||
|
||||
CGGetDisplayTransferByTable(monitor->ns.displayID,
|
||||
size,
|
||||
values,
|
||||
values + size,
|
||||
values + size * 2,
|
||||
&size);
|
||||
|
||||
_glfwAllocGammaArrays(ramp, size);
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
ramp->red[i] = (unsigned short) (values[i] * 65535);
|
||||
ramp->green[i] = (unsigned short) (values[i + size] * 65535);
|
||||
ramp->blue[i] = (unsigned short) (values[i + size * 2] * 65535);
|
||||
}
|
||||
|
||||
free(values);
|
||||
}
|
||||
|
||||
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
||||
{
|
||||
int i;
|
||||
CGGammaValue* values = calloc(ramp->size * 3, sizeof(CGGammaValue));
|
||||
|
||||
for (i = 0; i < ramp->size; i++)
|
||||
{
|
||||
values[i] = ramp->red[i] / 65535.f;
|
||||
values[i + ramp->size] = ramp->green[i] / 65535.f;
|
||||
values[i + ramp->size * 2] = ramp->blue[i] / 65535.f;
|
||||
}
|
||||
|
||||
CGSetDisplayTransferByTable(monitor->ns.displayID,
|
||||
ramp->size,
|
||||
values,
|
||||
values + ramp->size,
|
||||
values + ramp->size * 2);
|
||||
|
||||
free(values);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW native API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* handle)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(kCGNullDirectDisplay);
|
||||
return monitor->ns.displayID;
|
||||
}
|
||||
|
124
examples/common/glfw/src/cocoa_platform.h
Normal file
124
examples/common/glfw/src/cocoa_platform.h
Normal file
|
@ -0,0 +1,124 @@
|
|||
//========================================================================
|
||||
// GLFW 3.1 OS X - www.glfw.org
|
||||
//------------------------------------------------------------------------
|
||||
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.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 _cocoa_platform_h_
|
||||
#define _cocoa_platform_h_
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__OBJC__)
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#else
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
typedef void* id;
|
||||
#endif
|
||||
|
||||
#include "posix_tls.h"
|
||||
|
||||
#if defined(_GLFW_NSGL)
|
||||
#include "nsgl_context.h"
|
||||
#else
|
||||
#error "No supported context creation API selected"
|
||||
#endif
|
||||
|
||||
#include "iokit_joystick.h"
|
||||
|
||||
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns
|
||||
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns
|
||||
#define _GLFW_PLATFORM_LIBRARY_TIME_STATE _GLFWtimeNS ns_time
|
||||
#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorNS ns
|
||||
#define _GLFW_PLATFORM_CURSOR_STATE _GLFWcursorNS ns
|
||||
|
||||
|
||||
// Cocoa-specific per-window data
|
||||
//
|
||||
typedef struct _GLFWwindowNS
|
||||
{
|
||||
id object;
|
||||
id delegate;
|
||||
id view;
|
||||
unsigned int modifierFlags;
|
||||
|
||||
// The total sum of the distances the cursor has been warped
|
||||
// since the last cursor motion event was processed
|
||||
// This is kept to counteract Cocoa doing the same internally
|
||||
double warpDeltaX, warpDeltaY;
|
||||
|
||||
} _GLFWwindowNS;
|
||||
|
||||
|
||||
// Cocoa-specific global data
|
||||
//
|
||||
typedef struct _GLFWlibraryNS
|
||||
{
|
||||
CGEventSourceRef eventSource;
|
||||
id delegate;
|
||||
id autoreleasePool;
|
||||
id cursor;
|
||||
|
||||
short int publicKeys[256];
|
||||
char* clipboardString;
|
||||
|
||||
} _GLFWlibraryNS;
|
||||
|
||||
|
||||
// Cocoa-specific per-monitor data
|
||||
//
|
||||
typedef struct _GLFWmonitorNS
|
||||
{
|
||||
CGDirectDisplayID displayID;
|
||||
CGDisplayModeRef previousMode;
|
||||
id screen;
|
||||
|
||||
} _GLFWmonitorNS;
|
||||
|
||||
|
||||
// Cocoa-specific per-cursor data
|
||||
//
|
||||
typedef struct _GLFWcursorNS
|
||||
{
|
||||
id object;
|
||||
|
||||
} _GLFWcursorNS;
|
||||
|
||||
|
||||
// Cocoa-specific global timer data
|
||||
//
|
||||
typedef struct _GLFWtimeNS
|
||||
{
|
||||
double base;
|
||||
double resolution;
|
||||
|
||||
} _GLFWtimeNS;
|
||||
|
||||
|
||||
void _glfwInitTimer(void);
|
||||
|
||||
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
|
||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
|
||||
|
||||
#endif // _cocoa_platform_h_
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user