41 changed files with 6898 additions and 191 deletions
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
#version 120 |
||||
|
||||
uniform sampler2D sampler; |
||||
|
||||
varying vec2 tex_coord0; |
||||
|
||||
void main() |
||||
{ |
||||
gl_FragColor = |
||||
texture2D (sampler, tex_coord0); |
||||
gl_FragColor = vec4 (1.0, 0.0, 0.0, 1.0); |
||||
} |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
#version 430 |
||||
|
||||
/* this is the currently bound texture */ |
||||
uniform sampler2D sampler; |
||||
|
||||
/* tex coordinate passed from vertex shader */ |
||||
varying vec2 tex_coord0; |
||||
|
||||
/* equivalent to gl_FragColor */ |
||||
out vec4 out_color; |
||||
|
||||
void main() |
||||
{ |
||||
out_color = |
||||
texture2D (sampler, tex_coord0); |
||||
} |
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
#version 430 |
||||
|
||||
/* screen size we can use to convert the coordinates |
||||
* from screen space to [-1...1] */ |
||||
uniform vec2 screen; |
||||
|
||||
/* angle to rotate by, or 0 to not rotate */ |
||||
uniform float angle; |
||||
|
||||
/* vertex position in screen coordinates */ |
||||
attribute vec2 position; |
||||
|
||||
/* texture coordinate in ([0...1],[0...1]) */ |
||||
attribute vec2 tex_coord; |
||||
|
||||
/* tex coordinate to pass to fragment shader */ |
||||
varying vec2 tex_coord0; |
||||
|
||||
mat2 rotation2d(float angle) { |
||||
float s = sin(angle); |
||||
float c = cos(angle); |
||||
|
||||
return mat2( |
||||
c, -s, |
||||
s, c |
||||
); |
||||
} |
||||
|
||||
vec2 rotate(vec2 v, float angle) { |
||||
return rotation2d(angle) * v; |
||||
} |
||||
|
||||
void main() |
||||
{ |
||||
tex_coord0 = tex_coord; |
||||
|
||||
/* rotate if necessary */ |
||||
vec2 mypos = position.xy; |
||||
if (angle > 0.1 || angle < -0.1) |
||||
{ |
||||
mypos = rotate (vec2 (0, 0), angle); |
||||
mypos = mypos + position.xy; |
||||
} |
||||
|
||||
/* convert to shader coordinates [-1...1] on each |
||||
* axis */ |
||||
gl_Position = |
||||
vec4 ( |
||||
(mypos.x / screen.x) * 2 - 1.0, |
||||
(mypos.y / screen.y) * 2 - 1.0, |
||||
0.0, 1.0);; |
||||
} |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org> |
||||
# |
||||
# This file is part of Ion |
||||
# |
||||
# Ion is free software: you can redistribute it and/or modify |
||||
# it under the terms of the GNU Affero General Public License as published by |
||||
# the Free Software Foundation, either version 3 of the License, or |
||||
# (at your option) any later version. |
||||
# |
||||
# Ion is distributed in the hope that it will be useful, |
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
# GNU Affero General Public License for more details. |
||||
# |
||||
# You should have received a copy of the GNU Affero General Public License |
||||
# along with Ion. If not, see <https://www.gnu.org/licenses/>. |
||||
|
||||
install_data ( |
||||
join_paths ('glsl', 'unchanged.vert'), |
||||
install_dir: glsldir) |
||||
install_data ( |
||||
join_paths ('glsl', 'unchanged.frag'), |
||||
install_dir: glsldir) |
@ -0,0 +1,290 @@
@@ -0,0 +1,290 @@
|
||||
#ifndef __khrplatform_h_ |
||||
#define __khrplatform_h_ |
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2018 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.
|
||||
* |
||||
* The master copy of khrplatform.h is maintained in the Khronos EGL |
||||
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||
* The last semantic modification to khrplatform.h was at commit ID: |
||||
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692 |
||||
* |
||||
* Adopters may modify this file to suit their platform. Adopters are |
||||
* 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 filing pull requests or issues on |
||||
* the EGL Registry repository linked above. |
||||
* |
||||
* |
||||
* 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; |
||||
*/ |
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC) |
||||
# define KHRONOS_STATIC 1 |
||||
#endif |
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL |
||||
*------------------------------------------------------------------------- |
||||
* This precedes the return type of the function in the function prototype. |
||||
*/ |
||||
#if defined(KHRONOS_STATIC) |
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */ |
||||
# define KHRONOS_APICALL |
||||
#elif defined(_WIN32) |
||||
# define KHRONOS_APICALL __declspec(dllimport) |
||||
#elif defined (__SYMBIAN32__) |
||||
# define KHRONOS_APICALL IMPORT_C |
||||
#elif defined(__ANDROID__) |
||||
# define KHRONOS_APICALL __attribute__((visibility("default"))) |
||||
#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(KHRONOS_STATIC) |
||||
/* 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_ */ |
@ -0,0 +1,434 @@
@@ -0,0 +1,434 @@
|
||||
/*
|
||||
|
||||
GLX loader generated by glad 0.1.33 on Fri Nov 29 01:47:21 2019. |
||||
|
||||
Language/Generator: C/C++ |
||||
Specification: glx |
||||
APIs: glx=1.4 |
||||
Profile: - |
||||
Extensions: |
||||
|
||||
Loader: True |
||||
Local files: False |
||||
Omit khrplatform: False |
||||
Reproducible: False |
||||
|
||||
Commandline: |
||||
--api="glx=1.4" --generator="c" --spec="glx" --extensions="" |
||||
Online: |
||||
https://glad.dav1d.de/#language=c&specification=glx&loader=on&api=glx%3D1.4
|
||||
*/ |
||||
|
||||
|
||||
#include <X11/X.h> |
||||
#include <X11/Xlib.h> |
||||
#include <X11/Xutil.h> |
||||
#include <glad/glad.h> |
||||
|
||||
#ifndef __glad_glxext_h_ |
||||
|
||||
#ifdef __glxext_h_ |
||||
#error GLX header already included, remove this include, glad already provides it |
||||
#endif |
||||
|
||||
#define __glad_glxext_h_ |
||||
#define __glxext_h_ |
||||
|
||||
#ifndef APIENTRY |
||||
#define APIENTRY |
||||
#endif |
||||
#ifndef APIENTRYP |
||||
#define APIENTRYP APIENTRY * |
||||
#endif |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
typedef void* (* GLADloadproc)(const char *name); |
||||
|
||||
#ifndef GLAPI |
||||
# if defined(GLAD_GLAPI_EXPORT) |
||||
# if defined(_WIN32) || defined(__CYGWIN__) |
||||
# if defined(GLAD_GLAPI_EXPORT_BUILD) |
||||
# if defined(__GNUC__) |
||||
# define GLAPI __attribute__ ((dllexport)) extern |
||||
# else |
||||
# define GLAPI __declspec(dllexport) extern |
||||
# endif |
||||
# else |
||||
# if defined(__GNUC__) |
||||
# define GLAPI __attribute__ ((dllimport)) extern |
||||
# else |
||||
# define GLAPI __declspec(dllimport) extern |
||||
# endif |
||||
# endif |
||||
# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) |
||||
# define GLAPI __attribute__ ((visibility ("default"))) extern |
||||
# else |
||||
# define GLAPI extern |
||||
# endif |
||||
# else |
||||
# define GLAPI extern |
||||
# endif |
||||
#endif |
||||
|
||||
GLAPI int gladLoadGLX(Display *dpy, int screen); |
||||
|
||||
GLAPI int gladLoadGLXLoader(GLADloadproc, Display *dpy, int screen); |
||||
|
||||
#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 XID GLXFBConfigID; |
||||
typedef struct __GLXFBConfigRec *GLXFBConfig; |
||||
typedef XID GLXContextID; |
||||
typedef struct __GLXcontextRec *GLXContext; |
||||
typedef XID GLXPixmap; |
||||
typedef XID GLXDrawable; |
||||
typedef XID GLXWindow; |
||||
typedef XID GLXPbuffer; |
||||
typedef void (APIENTRY *__GLXextFuncPtr)(void); |
||||
typedef XID GLXVideoCaptureDeviceNV; |
||||
typedef unsigned int GLXVideoDeviceNV; |
||||
typedef XID GLXVideoSourceSGIX; |
||||
typedef XID GLXFBConfigIDSGIX; |
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; |
||||
typedef XID GLXPbufferSGIX; |
||||
typedef struct { |
||||
int event_type; /* GLX_DAMAGED or GLX_SAVED */ |
||||
int draw_type; /* GLX_WINDOW or GLX_PBUFFER */ |
||||
unsigned long serial; /* # of last request processed by server */ |
||||
Bool send_event; /* true if this came for SendEvent request */ |
||||
Display *display; /* display the event was read from */ |
||||
GLXDrawable drawable; /* XID of Drawable */ |
||||
unsigned int buffer_mask; /* mask indicating which buffers are affected */ |
||||
unsigned int aux_buffer; /* which aux buffer was affected */ |
||||
int x, y; |
||||
int width, height; |
||||
int count; /* if nonzero, at least this many more */ |
||||
} GLXPbufferClobberEvent; |
||||
typedef struct { |
||||
int type; |
||||
unsigned long serial; /* # of last request processed by server */ |
||||
Bool send_event; /* true if this came from a SendEvent request */ |
||||
Display *display; /* Display the event was read from */ |
||||
GLXDrawable drawable; /* drawable on which event was requested in event mask */ |
||||
int event_type; |
||||
int64_t ust; |
||||
int64_t msc; |
||||
int64_t sbc; |
||||
} GLXBufferSwapComplete; |
||||
typedef union __GLXEvent { |
||||
GLXPbufferClobberEvent glxpbufferclobber; |
||||
GLXBufferSwapComplete glxbufferswapcomplete; |
||||
long pad[24]; |
||||
} GLXEvent; |
||||
typedef struct { |
||||
int type; |
||||
unsigned long serial; |
||||
Bool send_event; |
||||
Display *display; |
||||
int extension; |
||||
int evtype; |
||||
GLXDrawable window; |
||||
Bool stereo_tree; |
||||
} GLXStereoNotifyEventEXT; |
||||
typedef struct { |
||||
int type; |
||||
unsigned long serial; /* # of last request processed by server */ |
||||
Bool send_event; /* true if this came for SendEvent request */ |
||||
Display *display; /* display the event was read from */ |
||||
GLXDrawable drawable; /* i.d. of Drawable */ |
||||
int event_type; /* GLX_DAMAGED_SGIX or GLX_SAVED_SGIX */ |
||||
int draw_type; /* GLX_WINDOW_SGIX or GLX_PBUFFER_SGIX */ |
||||
unsigned int mask; /* mask indicating which buffers are affected*/ |
||||
int x, y; |
||||
int width, height; |
||||
int count; /* if nonzero, at least this many more */ |
||||
} GLXBufferClobberEventSGIX; |
||||
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_EXTENSION_NAME "GLX" |
||||
#define GLX_PbufferClobber 0 |
||||
#define GLX_BufferSwapComplete 1 |
||||
#define __GLX_NUMBER_EVENTS 17 |
||||
#define GLX_BAD_SCREEN 1 |
||||
#define GLX_BAD_ATTRIBUTE 2 |
||||
#define GLX_NO_EXTENSION 3 |
||||
#define GLX_BAD_VISUAL 4 |
||||
#define GLX_BAD_CONTEXT 5 |
||||
#define GLX_BAD_VALUE 6 |
||||
#define GLX_BAD_ENUM 7 |
||||
#define GLX_USE_GL 1 |
||||
#define GLX_BUFFER_SIZE 2 |
||||
#define GLX_LEVEL 3 |
||||
#define GLX_RGBA 4 |
||||
#define GLX_DOUBLEBUFFER 5 |
||||
#define GLX_STEREO 6 |
||||
#define GLX_AUX_BUFFERS 7 |
||||
#define GLX_RED_SIZE 8 |
||||
#define GLX_GREEN_SIZE 9 |
||||
#define GLX_BLUE_SIZE 10 |
||||
#define GLX_ALPHA_SIZE 11 |
||||
#define GLX_DEPTH_SIZE 12 |
||||
#define GLX_STENCIL_SIZE 13 |
||||
#define GLX_ACCUM_RED_SIZE 14 |
||||
#define GLX_ACCUM_GREEN_SIZE 15 |
||||
#define GLX_ACCUM_BLUE_SIZE 16 |
||||
#define GLX_ACCUM_ALPHA_SIZE 17 |
||||
#define GLX_VENDOR 0x1 |
||||
#define GLX_VERSION 0x2 |
||||
#define GLX_EXTENSIONS 0x3 |
||||
#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 |
||||
#define GLX_SAMPLE_BUFFERS 100000 |
||||
#define GLX_SAMPLES 100001 |
||||
#ifndef GLX_VERSION_1_0 |
||||
#define GLX_VERSION_1_0 1 |
||||
GLAPI int GLAD_GLX_VERSION_1_0; |
||||
typedef XVisualInfo * (APIENTRYP PFNGLXCHOOSEVISUALPROC)(Display *dpy, int screen, int *attribList); |
||||
GLAPI PFNGLXCHOOSEVISUALPROC glad_glXChooseVisual; |
||||
#define glXChooseVisual glad_glXChooseVisual |
||||
typedef GLXContext (APIENTRYP PFNGLXCREATECONTEXTPROC)(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); |
||||
GLAPI PFNGLXCREATECONTEXTPROC glad_glXCreateContext; |
||||
#define glXCreateContext glad_glXCreateContext |
||||
typedef void (APIENTRYP PFNGLXDESTROYCONTEXTPROC)(Display *dpy, GLXContext ctx); |
||||
GLAPI PFNGLXDESTROYCONTEXTPROC glad_glXDestroyContext; |
||||
#define glXDestroyContext glad_glXDestroyContext |
||||
typedef Bool (APIENTRYP PFNGLXMAKECURRENTPROC)(Display *dpy, GLXDrawable drawable, GLXContext ctx); |
||||
GLAPI PFNGLXMAKECURRENTPROC glad_glXMakeCurrent; |
||||
#define glXMakeCurrent glad_glXMakeCurrent |
||||
typedef void (APIENTRYP PFNGLXCOPYCONTEXTPROC)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask); |
||||
GLAPI PFNGLXCOPYCONTEXTPROC glad_glXCopyContext; |
||||
#define glXCopyContext glad_glXCopyContext |
||||
typedef void (APIENTRYP PFNGLXSWAPBUFFERSPROC)(Display *dpy, GLXDrawable drawable); |
||||
GLAPI PFNGLXSWAPBUFFERSPROC glad_glXSwapBuffers; |
||||
#define glXSwapBuffers glad_glXSwapBuffers |
||||
typedef GLXPixmap (APIENTRYP PFNGLXCREATEGLXPIXMAPPROC)(Display *dpy, XVisualInfo *visual, Pixmap pixmap); |
||||
GLAPI PFNGLXCREATEGLXPIXMAPPROC glad_glXCreateGLXPixmap; |
||||
#define glXCreateGLXPixmap glad_glXCreateGLXPixmap |
||||
typedef void (APIENTRYP PFNGLXDESTROYGLXPIXMAPPROC)(Display *dpy, GLXPixmap pixmap); |
||||
GLAPI PFNGLXDESTROYGLXPIXMAPPROC glad_glXDestroyGLXPixmap; |
||||
#define glXDestroyGLXPixmap glad_glXDestroyGLXPixmap |
||||
typedef Bool (APIENTRYP PFNGLXQUERYEXTENSIONPROC)(Display *dpy, int *errorb, int *event); |
||||
GLAPI PFNGLXQUERYEXTENSIONPROC glad_glXQueryExtension; |
||||
#define glXQueryExtension glad_glXQueryExtension |
||||
typedef Bool (APIENTRYP PFNGLXQUERYVERSIONPROC)(Display *dpy, int *maj, int *min); |
||||
GLAPI PFNGLXQUERYVERSIONPROC glad_glXQueryVersion; |
||||
#define glXQueryVersion glad_glXQueryVersion |
||||
typedef Bool (APIENTRYP PFNGLXISDIRECTPROC)(Display *dpy, GLXContext ctx); |
||||
GLAPI PFNGLXISDIRECTPROC glad_glXIsDirect; |
||||
#define glXIsDirect glad_glXIsDirect |
||||
typedef int (APIENTRYP PFNGLXGETCONFIGPROC)(Display *dpy, XVisualInfo *visual, int attrib, int *value); |
||||
GLAPI PFNGLXGETCONFIGPROC glad_glXGetConfig; |
||||
#define glXGetConfig glad_glXGetConfig |
||||
typedef GLXContext (APIENTRYP PFNGLXGETCURRENTCONTEXTPROC)(void); |
||||
GLAPI PFNGLXGETCURRENTCONTEXTPROC glad_glXGetCurrentContext; |
||||
#define glXGetCurrentContext glad_glXGetCurrentContext |
||||
typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTDRAWABLEPROC)(void); |
||||
GLAPI PFNGLXGETCURRENTDRAWABLEPROC glad_glXGetCurrentDrawable; |
||||
#define glXGetCurrentDrawable glad_glXGetCurrentDrawable |
||||
typedef void (APIENTRYP PFNGLXWAITGLPROC)(void); |
||||
GLAPI PFNGLXWAITGLPROC glad_glXWaitGL; |
||||
#define glXWaitGL glad_glXWaitGL |
||||
typedef void (APIENTRYP PFNGLXWAITXPROC)(void); |
||||
GLAPI PFNGLXWAITXPROC glad_glXWaitX; |
||||
#define glXWaitX glad_glXWaitX |
||||
typedef void (APIENTRYP PFNGLXUSEXFONTPROC)(Font font, int first, int count, int list); |
||||
GLAPI PFNGLXUSEXFONTPROC glad_glXUseXFont; |
||||
#define glXUseXFont glad_glXUseXFont |
||||
#endif |
||||
#ifndef GLX_VERSION_1_1 |
||||
#define GLX_VERSION_1_1 1 |
||||
GLAPI int GLAD_GLX_VERSION_1_1; |
||||
typedef const char * (APIENTRYP PFNGLXQUERYEXTENSIONSSTRINGPROC)(Display *dpy, int screen); |
||||
GLAPI PFNGLXQUERYEXTENSIONSSTRINGPROC glad_glXQueryExtensionsString; |
||||
#define glXQueryExtensionsString glad_glXQueryExtensionsString |
||||
typedef const char * (APIENTRYP PFNGLXQUERYSERVERSTRINGPROC)(Display *dpy, int screen, int name); |
||||
GLAPI PFNGLXQUERYSERVERSTRINGPROC glad_glXQueryServerString; |
||||
#define glXQueryServerString glad_glXQueryServerString |
||||
typedef const char * (APIENTRYP PFNGLXGETCLIENTSTRINGPROC)(Display *dpy, int name); |
||||
GLAPI PFNGLXGETCLIENTSTRINGPROC glad_glXGetClientString; |
||||
#define glXGetClientString glad_glXGetClientString |
||||
#endif |
||||
#ifndef GLX_VERSION_1_2 |
||||
#define GLX_VERSION_1_2 1 |
||||
GLAPI int GLAD_GLX_VERSION_1_2; |
||||
typedef Display * (APIENTRYP PFNGLXGETCURRENTDISPLAYPROC)(void); |
||||
GLAPI PFNGLXGETCURRENTDISPLAYPROC glad_glXGetCurrentDisplay; |
||||
#define glXGetCurrentDisplay glad_glXGetCurrentDisplay |
||||
#endif |
||||
#ifndef GLX_VERSION_1_3 |
||||
#define GLX_VERSION_1_3 1 |
||||
GLAPI int GLAD_GLX_VERSION_1_3; |
||||
typedef GLXFBConfig * (APIENTRYP PFNGLXGETFBCONFIGSPROC)(Display *dpy, int screen, int *nelements); |
||||
GLAPI PFNGLXGETFBCONFIGSPROC glad_glXGetFBConfigs; |
||||
#define glXGetFBConfigs glad_glXGetFBConfigs |
||||
typedef GLXFBConfig * (APIENTRYP PFNGLXCHOOSEFBCONFIGPROC)(Display *dpy, int screen, const int *attrib_list, int *nelements); |
||||
GLAPI PFNGLXCHOOSEFBCONFIGPROC glad_glXChooseFBConfig; |
||||
#define glXChooseFBConfig glad_glXChooseFBConfig |
||||
typedef int (APIENTRYP PFNGLXGETFBCONFIGATTRIBPROC)(Display *dpy, GLXFBConfig config, int attribute, int *value); |
||||
GLAPI PFNGLXGETFBCONFIGATTRIBPROC glad_glXGetFBConfigAttrib; |
||||
#define glXGetFBConfigAttrib glad_glXGetFBConfigAttrib |
||||
typedef XVisualInfo * (APIENTRYP PFNGLXGETVISUALFROMFBCONFIGPROC)(Display *dpy, GLXFBConfig config); |
||||
GLAPI PFNGLXGETVISUALFROMFBCONFIGPROC glad_glXGetVisualFromFBConfig; |
||||
#define glXGetVisualFromFBConfig glad_glXGetVisualFromFBConfig |
||||
typedef GLXWindow (APIENTRYP PFNGLXCREATEWINDOWPROC)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); |
||||
GLAPI PFNGLXCREATEWINDOWPROC glad_glXCreateWindow; |
||||
#define glXCreateWindow glad_glXCreateWindow |
||||
typedef void (APIENTRYP PFNGLXDESTROYWINDOWPROC)(Display *dpy, GLXWindow win); |
||||
GLAPI PFNGLXDESTROYWINDOWPROC glad_glXDestroyWindow; |
||||
#define glXDestroyWindow glad_glXDestroyWindow |
||||
typedef GLXPixmap (APIENTRYP PFNGLXCREATEPIXMAPPROC)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); |
||||
GLAPI PFNGLXCREATEPIXMAPPROC glad_glXCreatePixmap; |
||||
#define glXCreatePixmap glad_glXCreatePixmap |
||||
typedef void (APIENTRYP PFNGLXDESTROYPIXMAPPROC)(Display *dpy, GLXPixmap pixmap); |
||||
GLAPI PFNGLXDESTROYPIXMAPPROC glad_glXDestroyPixmap; |
||||
#define glXDestroyPixmap glad_glXDestroyPixmap |
||||
typedef GLXPbuffer (APIENTRYP PFNGLXCREATEPBUFFERPROC)(Display *dpy, GLXFBConfig config, const int *attrib_list); |
||||
GLAPI PFNGLXCREATEPBUFFERPROC glad_glXCreatePbuffer; |
||||
#define glXCreatePbuffer glad_glXCreatePbuffer |
||||
typedef void (APIENTRYP PFNGLXDESTROYPBUFFERPROC)(Display *dpy, GLXPbuffer pbuf); |
||||
GLAPI PFNGLXDESTROYPBUFFERPROC glad_glXDestroyPbuffer; |
||||
#define glXDestroyPbuffer glad_glXDestroyPbuffer |
||||
typedef void (APIENTRYP PFNGLXQUERYDRAWABLEPROC)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); |
||||
GLAPI PFNGLXQUERYDRAWABLEPROC glad_glXQueryDrawable; |
||||
#define glXQueryDrawable glad_glXQueryDrawable |
||||
typedef GLXContext (APIENTRYP PFNGLXCREATENEWCONTEXTPROC)(Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); |
||||
GLAPI PFNGLXCREATENEWCONTEXTPROC glad_glXCreateNewContext; |
||||
#define glXCreateNewContext glad_glXCreateNewContext |
||||
typedef Bool (APIENTRYP PFNGLXMAKECONTEXTCURRENTPROC)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); |
||||
GLAPI PFNGLXMAKECONTEXTCURRENTPROC glad_glXMakeContextCurrent; |
||||
#define glXMakeContextCurrent glad_glXMakeContextCurrent |
||||
typedef GLXDrawable (APIENTRYP PFNGLXGETCURRENTREADDRAWABLEPROC)(void); |
||||
GLAPI PFNGLXGETCURRENTREADDRAWABLEPROC glad_glXGetCurrentReadDrawable; |
||||
#define glXGetCurrentReadDrawable glad_glXGetCurrentReadDrawable |
||||
typedef int (APIENTRYP PFNGLXQUERYCONTEXTPROC)(Display *dpy, GLXContext ctx, int attribute, int *value); |
||||
GLAPI PFNGLXQUERYCONTEXTPROC glad_glXQueryContext; |
||||
#define glXQueryContext glad_glXQueryContext |
||||
typedef void (APIENTRYP PFNGLXSELECTEVENTPROC)(Display *dpy, GLXDrawable draw, unsigned long event_mask); |
||||
GLAPI PFNGLXSELECTEVENTPROC glad_glXSelectEvent; |
||||
#define glXSelectEvent glad_glXSelectEvent |
||||
typedef void (APIENTRYP PFNGLXGETSELECTEDEVENTPROC)(Display *dpy, GLXDrawable draw, unsigned long *event_mask); |
||||
GLAPI PFNGLXGETSELECTEDEVENTPROC glad_glXGetSelectedEvent; |
||||
#define glXGetSelectedEvent glad_glXGetSelectedEvent |
||||
#endif |
||||
#ifndef GLX_VERSION_1_4 |
||||
#define GLX_VERSION_1_4 1 |
||||
GLAPI int GLAD_GLX_VERSION_1_4; |
||||
typedef __GLXextFuncPtr (APIENTRYP PFNGLXGETPROCADDRESSPROC)(const GLubyte *procName); |
||||
GLAPI PFNGLXGETPROCADDRESSPROC glad_glXGetProcAddress; |
||||
#define glXGetProcAddress glad_glXGetProcAddress |
||||
#endif |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif |
@ -0,0 +1,119 @@
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org> |
||||
* |
||||
* This file is part of Ion |
||||
* |
||||
* Ion is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU Affero General Public License as |
||||
* published by the Free Software Foundation, either version 3 of the |
||||
* License, or (at your option) any later version. |
||||
* |
||||
* Ion is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU Affero General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Affero Public License |
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/ |
||||
|
||||
/**
|
||||
* \file |
||||
* |
||||
* Drawable object. |
||||
*/ |
||||
|
||||
#ifndef __GUI_DRAWABLE_H__ |
||||
#define __GUI_DRAWABLE_H__ |
||||
|
||||
#include "gui/shader_manager.h" |
||||
#include "math/vector.h" |
||||
|
||||
typedef struct Texture Texture; |
||||
|
||||
/**
|
||||
* @addtogroup gui |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* Drawable element. |
||||
*/ |
||||
typedef struct IonDrawable |
||||
{ |
||||
/** Shader to use. */ |
||||
ShaderType shader_type; |
||||
|
||||
/** Texture to use. */ |
||||
Texture * texture; |
||||
|
||||
/**
|
||||
* Size of the drawable, independent of the |
||||
* texture. |
||||
* |
||||
* The texture will be stretched to this. |
||||
*/ |
||||
Vector2f size; |
||||
|
||||
/** GL vertex array object. */ |
||||
unsigned int vao; |
||||
|
||||
/** Vertices. */ |
||||
unsigned int vbo; |
||||
|
||||
/** Texture coordinates. */ |
||||
unsigned int tbo; |
||||
|
||||
/** Indices (elements). */ |
||||
unsigned int ebo; |
||||
|
||||
/** How many vertices we need to draw. */ |
||||
unsigned int draw_count; |
||||
|
||||
/** Set to 1 if the position is expected to
|
||||
* change often. */ |
||||
int dynamic_positions; |
||||
|
||||
/** Angle to rotate by or 0. */ |
||||
float angle; |
||||
|
||||
/** Position to start drawing at. */ |
||||
Vector2f position; |
||||
|
||||
/** Quad. */ |
||||
Vector2f vectors[4]; |
||||
|
||||
/** Texture coordinates for each vector. */ |
||||
Vector2f tex_coords[4]; |
||||
|
||||
/** Indices. */ |
||||
unsigned int indices[6]; |
||||
} IonDrawable; |
||||
|
||||
IonDrawable * |
||||
drawable_new_with_texture ( |
||||
ShaderType shader_type, |
||||
Texture * texture, |
||||
Vector2f * position, |
||||
Vector2f * size); |
||||
|
||||
void |
||||
drawable_update_position ( |
||||
IonDrawable * self, |
||||
Vector2f * position, |
||||
Vector2f * size); |
||||
|
||||
void |
||||
drawable_draw ( |
||||
IonDrawable * self); |
||||
|
||||
void |
||||
drawable_free ( |
||||
IonDrawable * self); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif |
@ -1,7 +0,0 @@
@@ -1,7 +0,0 @@
|
||||
#version 130 |
||||
|
||||
void main() |
||||
{ |
||||
//gl_FragColor = vec4(1.0f, 0.5f, 0.2f, 1.0f); |
||||
gl_FragColor = gl_Color; |
||||
} |
@ -1,8 +0,0 @@
@@ -1,8 +0,0 @@
|
||||
#version 130 |
||||
|
||||
void main() |
||||
{ |
||||
gl_Position = ftransform(); |
||||
gl_FrontColor = gl_Color; |
||||
//gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; |
||||
} |
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org> |
||||
* |
||||
* This file is part of Ion |
||||
* |
||||
* Ion is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU Affero General Public License as |
||||
* published by the Free Software Foundation, either version 3 of the |
||||
* License, or (at your option) any later version. |
||||
* |
||||
* Ion is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU Affero General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Affero Public License |
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/ |
||||
|
||||
#ifndef __GUI_MAIN_MENU_H__ |
||||
#define __GUI_MAIN_MENU_H__ |
||||
|
||||
typedef struct Texture Texture; |
||||
|
||||
/**
|
||||
* @addtogroup gui |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* A drawable logo, as part of a Skin. |
||||
*/ |
||||
typedef struct MainMenu |
||||
{ |
||||
} MainMenu; |
||||
|
||||
void |
||||
main_menu_draw ( |
||||
MainMenu * self); |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif |
@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Alexandros Theodotou <alex at zrythm dot org> |
||||
* |
||||
* This file is part of Ion |
||||
* |
||||
* Ion is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU Affero General Public License as |
||||
* published by the Free Software Foundation, either version 3 of the |
||||
* License, or (at your option) any later version. |
||||
* |
||||
* Ion is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU Affero General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Affero Public License |
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/ |
||||
|
||||
/**
|
||||
* \file |
||||
* |
||||
* Vectors. |
||||
*/ |
||||
|
||||
#ifndef __MATH_VECTOR_H__ |
||||
#define __MATH_VECTOR_H__ |
||||
|
||||
/**
|
||||
* @addtogroup math |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
/**
|
||||
* Vector. |
||||
*/ |
||||
typedef struct Vector2f |
||||
{ |
||||
float x; |
||||
float y; |
||||
} Vector2f; |
||||
|
||||
typedef struct Vector3f |
||||
{ |
||||
float x; |
||||
float y; |
||||
float z; |
||||
} Vector3f; |
||||
|
||||
/**
|
||||
* @} |
||||
*/ |
||||
|
||||
#endif |
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2019 Alexandros Theodotou <alex at zrythm dot org> |
||||
* |
||||
* This file is part of Zrythm |
||||
* |
||||
* Zrythm is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU Affero General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* Zrythm is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU Affero General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Affero General Public License |
||||
* along with Zrythm. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/ |
||||
|
||||
#ifndef __UTILS_MATH_H__ |
||||
#define __UTILS_MATH_H__ |
||||
|
||||
#include <float.h> |
||||
#include <math.h> |
||||
#include <stdint.h> |
||||
|
||||
#define MATH_FLOATS_EQUAL(a,b,epsilon) \ |
||||
(fabsf (a - b) < epsilon) |
||||
|
||||
/**
|
||||
* Checks if 2 floating points are equal. |
||||
* |
||||
* @param epsilon The allowed differene. |
||||
*/ |
||||
static inline int |
||||
math_floats_equal ( |
||||
const float a, |
||||
const float b, |
||||
const float epsilon) |
||||
{ |
||||
return fabsf (a - b) < epsilon; |
||||
} |
||||
|
||||
/**
|
||||
* Checks if 2 doubles are equal. |
||||
* |
||||
* @param epsilon The allowed differene. |
||||
*/ |
||||
static inline int |
||||
math_doubles_equal ( |
||||
const double a, |
||||
const double b, |
||||
const double epsilon) |
||||
{ |
||||
return fabs (a - b) < epsilon; |
||||
} |
||||
|
||||
#endif |