add readme

main
Allen Webster 2023-09-29 18:09:40 -07:00
commit d70845d23c
50 changed files with 42983 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
build/*
*.exe
*.pdb
*.exp
*.lib
*.obj
*.dll

15
build.bat Normal file
View File

@ -0,0 +1,15 @@
@echo off
set core_name=app
set exe_name=appWin32
set build_options= -DBUILD_WIN32=1
set compile_flags= -nologo /Zi /FC /I ../source/
set common_link_flags= opengl32.lib -opt:ref -incremental:no
set platform_link_flags= gdi32.lib user32.lib winmm.lib comdlg32.lib %common_link_flags%
if not exist build mkdir build
pushd build
start /b /wait "" "cl.exe" %build_options% %compile_flags% ../source/win32/win32_main.c /link %platform_link_flags% /out:%exe_name%.exe
start /b /wait "" "cl.exe" %build_options% %compile_flags% ../source/app.c /LD /link %common_link_flags% /out:%core_name%.dll
copy ..\data\* . >NUL
popd

BIN
data/liberation-mono.ttf Normal file

Binary file not shown.

57
project.4coder Normal file
View File

@ -0,0 +1,57 @@
version(1);
project_name = "Application Template";
patterns =
{
"*.c",
"*.cpp",
"*.ds",
"*.h",
"*.bat",
"*.sh",
"*.4coder",
};
blacklist_patterns =
{
".*",
};
load_paths =
{
{
{ {"."}, .recursive = true, .relative = true }, .os = "win"
},
};
command_list =
{
{
.name = "build",
.out = "*compilation*",
.footer_panel = true,
.save_dirty_files = true,
.cursor_at_end = false,
.cmd =
{
{ "build.bat", .os = "win" },
},
},
{
.name = "run",
.out = "*compilation*",
.footer_panel = true,
.save_dirty_files = true,
.cursor_at_end = false,
.cmd =
{
{ "run.bat", .os = "win" },
},
},
};
fkey_command[1] = "build";
fkey_command[3] = "run";

10
readme.md Normal file
View File

@ -0,0 +1,10 @@
# Splink
An entry for the Handmade Network Lisp Jam of 2020.
What if a programming environment had built in error containment structures and code organizational properties like slices? For the jam I decided to explore that with a lisp editor and interpreter environment.
# Credits
The base layer for this application was forked from Ryan Fleury's app template.

4
run.bat Normal file
View File

@ -0,0 +1,4 @@
@echo off
pushd build
appWin32.exe
popd

1254
source/app.c Normal file

File diff suppressed because it is too large Load Diff

125
source/app.h Normal file
View File

@ -0,0 +1,125 @@
/* date = July 2nd 2020 11:52 pm */
#ifndef APP_H
#define APP_H
////////////////////////////////
// NOTE(allen): Floating Window
typedef struct APP_FloatingWindowResult APP_FloatingWindowResult;
struct APP_FloatingWindowResult{
Rect rect;
};
typedef void APP_FloatingWindowCallbackType(void *ptr, APP_FloatingWindowResult *result);
////////////////////////////////
// NOTE(allen): Variables
typedef enum{
APP_MouseLayer_Null,
APP_MouseLayer_Main,
APP_MouseLayer_FloatingWindow,
} APP_MouseLayer;
typedef enum{
APP_BtnCtx_Null,
APP_BtnCtx_ToolBox,
APP_BtnCtx_ListerOptions,
APP_BtnCtx_Lister,
APP_BtnCtx_ViewButtons,
APP_BtnCtx_Tabs,
} APP_MouseLayer;
typedef u32 APP_ListerFlags;
enum{
APP_ListerFlag_Spaces = (1 << 0),
APP_ListerFlag_Pages = (1 << 1),
APP_ListerFlag_Tests = (1 << 2),
APP_ListerFlag_Invalids = (1 << 3),
APP_ListerFlag_Definitions = (1 << 4),
};
typedef struct APP_Variables APP_Variables;
struct APP_Variables{
M_Arena arena_;
M_Arena *arena;
R_Font font;
v2 mouse_p;
v2 window_dim;
f32 frame_time;
////////////////////////////////
// NOTE(allen): Engine State
u64 frame_indx;
M_Arena frame_arena[2];
STR_Hash string_hash;
STR_Index keyword_table[C_BuiltInIndex_COUNT];
C_CellMemory cells;
C_CellBucket static_bucket;
C_Statics statics;
C_CellBucket global_defines_bucket;
C_CellBucket eval_bucket;
C_Cell *spaces_env;
E_Definition *free_definition;
E_Space *free_space;
E_Space *first_space_ordered;
E_Space *last_space_ordered;
E_Space *first_space;
E_Space *last_space;
E_Space *first_invalid_space;
E_Space *last_invalid_space;
u64 identifier_available_count;
STR_Index identifier_available[8];
E_Tile *free_tile;
E_View *free_view;
E_View *first_view;
E_View *last_view;
E_View *active_view;
E_EditorState *active_editor;
E_Tile *active_tile;
E_View *change_view;
E_Tile *snap_to_tile;
////////////////////////////////
// NOTE(allen): UI
UI_Id active_mouse_layer;
UI_Id current_mouse_layer;
UI_Id owner_of_floating_window;
void *floating_window_ptr;
APP_FloatingWindowCallbackType *floating_window_callback;
Rect floating_window_last_frame_rect;
UI_Id last_frame_owner_of_floating_window;
void *last_frame_floating_window_ptr;
String8 tool_tip_string;
APP_ListerFlags lister_flags;
C_Token panel_filter_memory;
E_TokenBuffer panel_filter_buffer;
E_EditorState panel_filter;
f32 panel_scroll_y;
////////////////////////////////
// NOTE(allen): Frame Data
E_EditorState *neighbor_editors[2];
};
#endif //APP_H

185
source/app_core.c Normal file
View File

@ -0,0 +1,185 @@
////////////////////////////////
// NOTE(allen): App core
global APP_Variables *vars = 0;
internal M_Arena*
APP_GetFrameArena(void){
return(&vars->frame_arena[vars->frame_indx&1]);
}
internal STR_Hash*
APP_GetStringHash(void){
return(&vars->string_hash);
}
internal C_CellMemory*
APP_GetCellMemory(void){
return(&vars->cells);
}
internal E_EditorState*
APP_GetActiveEditor(void){
return(vars->active_editor);
}
internal E_Tile*
APP_GetActiveTile(void){
return(vars->active_tile);
}
internal void
APP_SetActiveView(E_View *view){
if (vars->active_view != view){
vars->active_tile = 0;
vars->active_editor = 0;
}
vars->active_view = view;
Assert(vars->active_view != 0);
}
internal void
APP_SetActiveEditor(E_EditorState *editor){
if (vars->active_editor != editor){
vars->active_tile = 0;
}
vars->active_editor = editor;
}
internal void
APP_SetActiveTile(E_Tile *tile){
if (vars->active_tile != tile){
b32 editor_in_tile = 0;
if (tile != 0){
for (u64 i = 0; i < ArrayCount(tile->editors); i += 1){
if (vars->active_editor == &tile->editors[i]){
editor_in_tile = 1;
break;
}
}
}
if (!editor_in_tile){
vars->active_editor = 0;
}
}
vars->active_tile = tile;
}
internal C_Statics*
APP_GetStatics(void){
return(&vars->statics);
}
internal C_CellBucket*
APP_GetEvalBucket(void){
return(&vars->eval_bucket);
}
internal void
APP_SignalSnapToTile(E_Tile *tile){
vars->snap_to_tile = tile;
}
internal void
APP_SignalViewChange(E_View *view){
if (view != 0){
vars->change_view = view;
}
}
internal E_View*
APP_GetGlobalView(E_Space *space){
E_View *result = 0;
for (E_View *view = vars->first_view;
view != 0;
view = view->next){
if (view->kind == E_ViewKind_Global && view->space == space){
result = view;
break;
}
}
return(result);
}
internal E_View*
APP_GetPageView(E_Definition *definition){
E_View *result = 0;
for (E_View *view = vars->first_view;
view != 0;
view = view->next){
if (view->kind == E_ViewKind_Page && view->definition == definition){
result = view;
break;
}
}
return(result);
}
internal E_Space*
APP_GetActiveSpace(void){
E_Space *result = 0;
E_View *view = vars->active_view;
if (view != 0){
result = view->space;
Assert(result != 0);
}
return(result);
}
internal void
APP_SignalSpaceNameAvailable(STR_Index name){
if (vars->identifier_available_count < ArrayCount(vars->identifier_available)){
vars->identifier_available[vars->identifier_available_count] = name;
}
vars->identifier_available_count += 1;
}
internal UI_Id
APP_OwnerOfFloatingWindow(void){
return(vars->owner_of_floating_window);
}
internal void
APP_TakeOwnershipOfFloatingWindow(UI_Id id){
vars->owner_of_floating_window = id;
}
internal void
APP_ZeroOwnershipOfFloatingWindow(void){
MemoryZeroStruct(&vars->owner_of_floating_window);
}
internal void*
APP_GetFloatingWindowPtr(void){
return(vars->floating_window_ptr);
}
internal void*
APP_GetLastFrameFloatingWindowPtr(void){
void *result = 0;
if (UI_IdEq(vars->last_frame_owner_of_floating_window, vars->owner_of_floating_window)){
result = vars->last_frame_floating_window_ptr;
}
return(result);
}
internal void
APP_SetFloatingWindowPtrAndCallback(void *ptr, APP_FloatingWindowCallbackType *callback){
vars->floating_window_ptr = ptr;
vars->floating_window_callback = callback;
}
internal b32
APP_MouseIsActive(void){
return(UI_IdEq(vars->active_mouse_layer, vars->current_mouse_layer));
}
internal void
APP_SetMouseLayer(UI_Id id){
vars->current_mouse_layer = id;
}
internal void
APP_SetToolTip(String8 string){
vars->tool_tip_string = string;
}

101
source/app_memory.c Normal file
View File

@ -0,0 +1,101 @@
// NOTE(allen): memory
#define M_ARENA_MAX Gigabytes(4)
#define M_ARENA_COMMIT_SIZE Kilobytes(4)
internal M_Arena
M_ArenaInitializeWithAlign(u64 auto_align)
{
M_Arena arena = {0};
arena.max = M_ARENA_MAX;
arena.base = os->Reserve(arena.max);
arena.alloc_position = 0;
arena.commit_position = 0;
arena.auto_align = auto_align;
return arena;
}
internal M_Arena
M_ArenaInitialize(void)
{
return(M_ArenaInitializeWithAlign(8));
}
internal void *
M_ArenaPush(M_Arena *arena, u64 size)
{
void *memory = 0;
if(arena->alloc_position + size > arena->commit_position)
{
u64 commit_size = size;
commit_size += M_ARENA_COMMIT_SIZE-1;
commit_size -= commit_size % M_ARENA_COMMIT_SIZE;
os->Commit((u8 *)arena->base + arena->commit_position, commit_size);
arena->commit_position += commit_size;
}
memory = (u8 *)arena->base + arena->alloc_position;
u64 p = arena->alloc_position + size;
arena->alloc_position = (p + arena->auto_align - 1)&(~(arena->auto_align - 1));
return memory;
}
internal void *
M_ArenaPushZero(M_Arena *arena, u64 size)
{
void *memory = M_ArenaPush(arena, size);
MemorySet(memory, 0, size);
return memory;
}
internal void
M_ArenaSetPosBack(M_Arena *arena, u64 pos)
{
if (pos <= arena->alloc_position)
{
arena->alloc_position = pos;
}
}
internal void
M_ArenaSetPosBackByPtr(M_Arena *arena, void *ptr)
{
u8 *uptr = (u8*)ptr;
u64 pos = (uptr - (u8*)arena->base);
if ((u8*)arena->base <= uptr)
{
M_ArenaSetPosBack(arena, pos);
}
}
internal void
M_ArenaPop(M_Arena *arena, u64 size)
{
size = ClampTop(size, arena->alloc_position);
arena->alloc_position -= size;
}
internal void
M_ArenaClear(M_Arena *arena)
{
M_ArenaPop(arena, arena->alloc_position);
}
internal void
M_ArenaRelease(M_Arena *arena)
{
os->Release(arena->base);
}
internal M_Temp
M_BeginTemp(M_Arena *arena)
{
M_Temp temp = {arena, arena->alloc_position};
return(temp);
}
internal void
M_EndTemp(M_Temp temp)
{
M_ArenaSetPosBack(temp.arena, temp.pos);
}

38
source/app_memory.h Normal file
View File

@ -0,0 +1,38 @@
// NOTE(allen): memory
typedef struct M_Arena M_Arena;
struct M_Arena
{
void *base;
u64 max;
u64 alloc_position;
u64 commit_position;
u64 auto_align;
};
typedef struct M_Temp M_Temp;
struct M_Temp
{
M_Arena *arena;
u64 pos;
};
////////////////////////////////
#define PushArray(arena,T,c) ( (T*)(M_ArenaPush((arena),sizeof(T)*(c))) )
#define PushArrayZero(arena,T,c) ( (T*)(M_ArenaPushZero((arena),sizeof(T)*(c))) )
internal M_Arena M_ArenaInitializeWithAlign(u64 auto_align);
internal M_Arena M_ArenaInitialize(void);
internal void M_ArenaRelease(M_Arena *arena);
internal void* M_ArenaPush(M_Arena *arena, u64 size);
internal void* M_ArenaPushZero(M_Arena *arena, u64 size);
internal void M_ArenaSetPosBack(M_Arena *arena, u64 pos);
internal void M_ArenaSetPosBackByPtr(M_Arena *arena, void *ptr);
internal void M_ArenaPop(M_Arena *arena, u64 size);
internal void M_ArenaClear(M_Arena *arena);
internal M_Temp M_BeginTemp(M_Arena *arena);
internal void M_EndTemp(M_Temp temp);

1898
source/compute.c Normal file

File diff suppressed because it is too large Load Diff

229
source/compute.h Normal file
View File

@ -0,0 +1,229 @@
/* date = July 8th 2020 7:11 am */
#ifndef COMPUTE_H
#define COMPUTE_H
typedef enum{
C_TokenKind_NULL,
C_TokenKind_Space,
C_TokenKind_Newline,
C_TokenKind_Comment,
#define C_TokenKind_FIRST_HARD C_TokenKind_OpenParen
C_TokenKind_OpenParen,
C_TokenKind_CloseParen,
C_TokenKind_Quote,
C_TokenKind_Label,
#define C_TokenKind_LAST_HARD C_TokenKind_Label
C_TokenKind_COUNT,
} C_TokenKind;
typedef struct C_Token C_Token;
struct C_Token{
C_TokenKind kind;
STR_Index string;
};
typedef struct C_TokenArray C_TokenArray;
struct C_TokenArray{
C_Token *vals;
u64 count;
};
////////////////////////////////
typedef u64 C_Id;
typedef struct C_Deferred C_Deferred;
struct C_Deferred{
void *user_ptr;
struct C_Cell *env;
struct C_Cell *cell;
b32 doing_eval;
b32 finished_eval;
};
#define C_BUILT_IN_SIG(name) struct C_Cell* name(struct C_EvalCtx *ctx, struct C_Cell *cell, struct C_Cell **env)
typedef C_BUILT_IN_SIG(C_BuiltInFunctionType);
typedef enum{
C_CellKind_Nil,
C_CellKind_Constructed,
C_CellKind_F64,
C_CellKind_Id,
C_CellKind_Identifier,
// NOTE(allen): Used in eval but not emitted by parser
C_CellKind_BuiltIn,
C_CellKind_Environment,
C_CellKind_Function,
C_CellKind_Macro,
C_CellKind_FunctionV,
C_CellKind_MacroV,
C_CellKind_Register,
C_CellKind_Deferred,
C_CellKind_Space,
// NOTE(allen): Used in memory allocation strategy,
// a correctly functioning lisp eval should not encounter this.
// If it does it will be treated as Nil.
C_CellKind_BlockHeader,
} C_CellKind;
// NOTE(allen): Forming verbs (functions, macros, variadics):
// first_child -> constructed list of parameters
// -> identifier for variadics
// next -> expression forming body of function
// env -> environment inherited from enclosing scope
typedef struct C_Cell C_Cell;
struct C_Cell{
C_CellKind kind;
C_Cell *next;
union{
C_Cell *first_child;
C_BuiltInFunctionType *built_in;
};
union{
u64 x;
struct C_CellBucket *bucket;
void *space;
f64 f;
STR_Index identifier;
C_Cell *env;
C_Deferred *deferred;
C_Id id;
u64 depth_counter;
};
};
// NOTE(allen): We want fast divides on whatever size we pick here.
#define C_BLOCK_CAP 256
typedef struct C_CellMemory C_CellMemory;
struct C_CellMemory{
M_Arena arena;
C_Cell *cells;
C_Cell *free_block;
};
typedef struct C_CellBucket C_CellBucket;
struct C_CellBucket{
C_CellMemory *memory;
C_Cell *first_block;
C_Cell *last_block;
u64 cursor;
};
typedef struct C_ListBuilder C_ListBuilder;
struct C_ListBuilder{
C_Cell *f;
C_Cell **u;
u64 c;
};
////////////////////////////////
typedef struct C_ParseError C_ParseError;
struct C_ParseError{
String8 message;
C_Token *token;
};
typedef struct C_ParseCtx C_ParseCtx;
struct C_ParseCtx{
struct C_Statics *statics;
C_CellBucket *bucket;
C_Token *token;
C_Token *opl;
u64 error_count;
u64 error_max;
C_ParseError *errors;
};
////////////////////////////////
#define C_BuiltInXList(X) \
X("define", Define) \
X("function", Function) \
X("function...", FunctionV) \
X("macro", Macro) \
X("macro...", MacroV) \
X("write-reg", WriteRegister) \
X("read-reg", ReadRegister) \
X("get-thread-local-reg", GetUniqueRegister) \
X("block", Block) \
X("first", First) \
X("next", Next) \
X("push", Push) \
X("list", List) \
X("list-count", ListCount) \
X("id", Id) \
X("all-ids", AllIds) \
X("quote", Quote) \
X("eval", Eval) \
X("apply", Apply) \
X("far-eval", FarEval) \
X("kind", Kind) \
X("if", If) \
X("switch", Switch) \
X("loop", Loop) \
X("+1", Increment) \
X("-1", Decrement) \
X("+", Add) \
X("-", Sub) \
X("*", Mul) \
X("/", Div) \
X("%", Mod) \
X("^", Pow) \
X("<", Ls) \
X(">", Gr) \
X("<=", LsEq) \
X(">=", GrEq) \
X("==", Eq) \
X("!=", NotEq) \
X("not", Not) \
X("and", And) \
X("or", Or) \
X("ceil", Ceil) \
X("floor", Floor) \
X("round", Round)
typedef enum{
C_BuiltInIndex_Nil,
#define EnumMember(N,F) C_BuiltInIndex_##F,
C_BuiltInXList(EnumMember)
#undef EnumMember
C_BuiltInIndex_COUNT,
} C_BuiltInIndex;
typedef struct C_Statics C_Statics;
struct C_Statics{
union{
struct{
C_Cell *Nil;
#define StaticMember(N,F) C_Cell *F;
C_BuiltInXList(StaticMember)
#undef StaticMember
};
C_Cell *built_in[C_BuiltInIndex_COUNT];
};
C_Cell *env;
};
////////////////////////////////
typedef struct C_EvalCtx C_EvalCtx;
struct C_EvalCtx{
C_Statics *statics;
C_CellBucket *bucket;
C_Cell *id_env;
C_Cell *regs;
u64 max_depth;
u64 depth;
u64 loop_lim;
C_Id reg_id_counter;
};
#endif //COMPUTE_H

1169
source/definition.c Normal file

File diff suppressed because it is too large Load Diff

186
source/definition.h Normal file
View File

@ -0,0 +1,186 @@
/* date = July 7th 2020 7:47 am */
#ifndef DEFINITION_H
#define DEFINITION_H
typedef u32 E_DefinitionFlags;
enum{
E_DefinitionFlag_Invalid = (1 << 0),
E_DefinitionFlag_Page = (1 << 1),
E_DefinitionFlag_Test = (1 << 2),
};
typedef struct E_Definition E_Definition;
struct E_Definition{
// NOTE(allen): State
E_Definition *ordered_next;
E_Definition *ordered_prev;
E_Definition *next;
E_Definition *prev;
struct E_Space *space;
E_DefinitionFlags flags;
STR_Index last_name;
C_Id id;
b32 delete_me;
// NOTE(allen): Contents
C_Token name_token_buffer;
union{
struct{
E_TokenBuffer name;
E_TokenBuffer body;
};
E_TokenBuffer buffers[2];
};
// NOTE(allen): Compute
b32 invalid_name_field;
C_CellBucket bucket;
u64 error_count;
C_ParseError errors[20];
union{
struct{
C_Cell *name_cell;
C_Cell *body_cell;
};
C_Cell *cells[2];
};
C_Deferred deferred;
};
typedef struct E_Space E_Space;
struct E_Space{
E_Space *ordered_next;
E_Space *ordered_prev;
E_Space *next;
E_Space *prev;
b32 invalid;
STR_Index last_name;
C_Cell *defines_env;
C_Cell *id_env;
C_Cell *id_list;
u64 id_counter;
E_Definition *first_definition;
E_Definition *last_definition;
E_Definition *first_invalid_definition;
E_Definition *last_invalid_definition;
E_Definition *first_definition_ordered;
E_Definition *last_definition_ordered;
b32 delete_signal;
b32 init_error;
b32 dirty;
f32 last_save_time;
STR_Index save_path;
u64 identifier_available_count;
STR_Index identifier_available[8];
};
////////////////////////////////
typedef struct E_Tile E_Tile;
struct E_Tile{
E_Tile *next;
E_Tile *prev;
struct E_TileCache *tile_cache;
b32 free_me;
E_Definition *definition;
union{
struct{
E_EditorState name;
E_EditorState body;
};
E_EditorState editors[2];
};
R_Font *font;
};
typedef struct E_ViewCallbackIn E_ViewCallbackIn;
struct E_ViewCallbackIn{
E_Definition *definition;
};
typedef union E_ViewCallbackOut E_ViewCallbackOut;
union E_ViewCallbackOut{
E_Definition *definition;
String8 name;
};
#define VIEW_CALLBACK_SIG(name) void name(struct E_View *view, E_ViewCallbackIn *in, E_ViewCallbackOut *out)
typedef VIEW_CALLBACK_SIG(E_ViewCallback);
/* NOTE(allen): View v-table
** derive_from_source (void) (void)
** create_new_definition (void) (out->definition)
** look_at_definition (in->definition) (void)
** cleanup (void) (void)
** shutdown (void) (void)
** get_name (void) (out->name)
*/
typedef enum{
E_ViewKind_Null,
E_ViewKind_Global,
E_ViewKind_Page,
} E_ViewKind;
typedef struct E_View E_View;
struct E_View{
E_ViewKind kind;
E_View *prev;
E_View *next;
// NOTE(allen): v-table
E_ViewCallback *derive_from_source;
E_ViewCallback *create_new_definition;
E_ViewCallback *look_at_definition;
E_ViewCallback *cleanup;
E_ViewCallback *shutdown;
E_ViewCallback *get_name;
// NOTE(allen): Tiles
R_Font *font;
E_Tile *first_tile;
E_Tile *last_tile;
b32 free_children;
f32 scroll_y;
// NOTE(allen): Variables
E_Space *space;
String8 name;
E_Definition *definition;
b32 state_ahead_of_source;
};
////////////////////////////////
internal E_View* E_NewView(void);
internal void E_DeleteView(E_View *view);
internal void E_ViewDeriveFromSource(E_View *view);
internal E_Definition* E_ViewCreateNewDefinition(E_View *view);
internal void E_ViewLookAtDefinition(E_View *view, E_Definition *definition);
internal b32 E_ViewWillLookAtDefinition(E_View *view);
internal void E_ViewCleanup(E_View *view);
internal b32 E_ViewWillCloseDefinition(E_View *view);
internal void E_ViewShutdown(E_View *view);
internal String8 E_ViewGetName(E_View *view);
internal void E_InitGlobalView(E_View *view, R_Font *font, E_Space *space);
internal void E_InitPageView(E_View *view, R_Font *font, E_Definition *definition);
#endif //DEFINITION_H

12570
source/ext/glext.h Normal file

File diff suppressed because it is too large Load Diff

7471
source/ext/stb_image.h Normal file

File diff suppressed because it is too large Load Diff

3235
source/ext/stb_truetype.h Normal file

File diff suppressed because it is too large Load Diff

5453
source/ext/stb_vorbis.c Normal file

File diff suppressed because it is too large Load Diff

851
source/ext/wglext.h Normal file
View File

@ -0,0 +1,851 @@
#ifndef __wgl_wglext_h_
#define __wgl_wglext_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2013-2017 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
** https://github.com/KhronosGroup/OpenGL-Registry
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#define WGL_WGLEXT_VERSION 20180316
/* 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_no_error
#define WGL_ARB_create_context_no_error 1
#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3
#endif /* WGL_ARB_create_context_no_error */
#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_colorspace
#define WGL_EXT_colorspace 1
#define WGL_COLORSPACE_EXT 0x3087
#define WGL_COLORSPACE_SRGB_EXT 0x3089
#define WGL_COLORSPACE_LINEAR_EXT 0x308A
#endif /* WGL_EXT_colorspace */
#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);