FreeBASIC  0.91.0
gfx_driver_opengl.c File Reference
#include "../fb_gfx.h"
#include "fb_gfx_win32.h"
#include "../fb_gfx_gl.h"
Include dependency graph for gfx_driver_opengl.c:

Go to the source code of this file.

Data Structures

struct  FB_WGL
 

Macros

#define WGL_ARB_pixel_format
 
#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
 
#define WGL_SAMPLE_BUFFERS_ARB   0x2041
 
#define WGL_SAMPLES_ARB   0x2042
 

Typedefs

typedef HGLRC(APIENTRY * WGLCREATECONTEXT )(HDC)
 
typedef BOOL(APIENTRY * WGLMAKECURRENT )(HDC, HGLRC)
 
typedef BOOL(APIENTRY * WGLDELETECONTEXT )(HGLRC)
 
typedef PROC(APIENTRY * WGLGETPROCADDRESS )(LPCSTR)
 
typedef PCHAR(APIENTRY * WGLGETEXTENSIONSTRINGARB )(HDC)
 
typedef BOOL(APIENTRY * WGLCHOOSEPIXELFORMATARB )(HDC, const int *, const FLOAT *, int, int *, int *)
 
typedef struct FB_WGL FB_WGL
 

Functions

static int driver_init (char *title, int w, int h, int depth, int refresh_rate, int flags)
 
static void driver_exit (void)
 
static void driver_lock (void)
 
static void driver_unlock (void)
 
static void driver_flip (void)
 
static int * driver_fetch_modes (int depth, int *size)
 
static void driver_poll_events (void)
 
static int opengl_init (void)
 
static void opengl_exit (void)
 
void * fb_hGL_GetProcAddress (const char *proc)
 
static int GL_init (PIXELFORMATDESCRIPTOR *pfd)
 
static void opengl_paint (void)
 

Variables

GFXDRIVER fb_gfxDriverOpenGL
 
static FB_DYLIB library
 
static FB_WGL fb_wgl
 
static HGLRC hglrc
 
static HDC hdc
 

Macro Definition Documentation

#define WGL_ACCELERATION_ARB   0x2003

Definition at line 15 of file gfx_driver_opengl.c.

#define WGL_ACCUM_ALPHA_BITS_ARB   0x2021

Definition at line 49 of file gfx_driver_opengl.c.

#define WGL_ACCUM_BITS_ARB   0x201D

Definition at line 45 of file gfx_driver_opengl.c.

#define WGL_ACCUM_BLUE_BITS_ARB   0x2020

Definition at line 48 of file gfx_driver_opengl.c.

#define WGL_ACCUM_GREEN_BITS_ARB   0x201F

Definition at line 47 of file gfx_driver_opengl.c.

#define WGL_ACCUM_RED_BITS_ARB   0x201E

Definition at line 46 of file gfx_driver_opengl.c.

#define WGL_ALPHA_BITS_ARB   0x201B

Definition at line 43 of file gfx_driver_opengl.c.

#define WGL_ALPHA_SHIFT_ARB   0x201C

Definition at line 44 of file gfx_driver_opengl.c.

#define WGL_ARB_pixel_format

Definition at line 10 of file gfx_driver_opengl.c.

#define WGL_AUX_BUFFERS_ARB   0x2024

Definition at line 52 of file gfx_driver_opengl.c.

#define WGL_BLUE_BITS_ARB   0x2019

Definition at line 41 of file gfx_driver_opengl.c.

#define WGL_BLUE_SHIFT_ARB   0x201A

Definition at line 42 of file gfx_driver_opengl.c.

#define WGL_COLOR_BITS_ARB   0x2014

Definition at line 36 of file gfx_driver_opengl.c.

#define WGL_DEPTH_BITS_ARB   0x2022

Definition at line 50 of file gfx_driver_opengl.c.

#define WGL_DOUBLE_BUFFER_ARB   0x2011

Definition at line 33 of file gfx_driver_opengl.c.

#define WGL_DRAW_TO_BITMAP_ARB   0x2002

Definition at line 14 of file gfx_driver_opengl.c.

#define WGL_DRAW_TO_WINDOW_ARB   0x2001

Definition at line 13 of file gfx_driver_opengl.c.

#define WGL_FULL_ACCELERATION_ARB   0x2027

Definition at line 55 of file gfx_driver_opengl.c.

#define WGL_GENERIC_ACCELERATION_ARB   0x2026

Definition at line 54 of file gfx_driver_opengl.c.

#define WGL_GREEN_BITS_ARB   0x2017

Definition at line 39 of file gfx_driver_opengl.c.

#define WGL_GREEN_SHIFT_ARB   0x2018

Definition at line 40 of file gfx_driver_opengl.c.

#define WGL_NEED_PALETTE_ARB   0x2004

Definition at line 16 of file gfx_driver_opengl.c.

#define WGL_NEED_SYSTEM_PALETTE_ARB   0x2005

Definition at line 17 of file gfx_driver_opengl.c.

#define WGL_NO_ACCELERATION_ARB   0x2025

Definition at line 53 of file gfx_driver_opengl.c.

#define WGL_NUMBER_OVERLAYS_ARB   0x2008

Definition at line 20 of file gfx_driver_opengl.c.

#define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000

Definition at line 12 of file gfx_driver_opengl.c.

#define WGL_NUMBER_UNDERLAYS_ARB   0x2009

Definition at line 21 of file gfx_driver_opengl.c.

#define WGL_PIXEL_TYPE_ARB   0x2013

Definition at line 35 of file gfx_driver_opengl.c.

#define WGL_RED_BITS_ARB   0x2015

Definition at line 37 of file gfx_driver_opengl.c.

#define WGL_RED_SHIFT_ARB   0x2016

Definition at line 38 of file gfx_driver_opengl.c.

#define WGL_SAMPLE_BUFFERS_ARB   0x2041

Definition at line 61 of file gfx_driver_opengl.c.

#define WGL_SAMPLES_ARB   0x2042

Definition at line 62 of file gfx_driver_opengl.c.

#define WGL_SHARE_ACCUM_ARB   0x200E

Definition at line 30 of file gfx_driver_opengl.c.

#define WGL_SHARE_DEPTH_ARB   0x200C

Definition at line 28 of file gfx_driver_opengl.c.

#define WGL_SHARE_STENCIL_ARB   0x200D

Definition at line 29 of file gfx_driver_opengl.c.

#define WGL_STENCIL_BITS_ARB   0x2023

Definition at line 51 of file gfx_driver_opengl.c.

#define WGL_STEREO_ARB   0x2012

Definition at line 34 of file gfx_driver_opengl.c.

#define WGL_SUPPORT_GDI_ARB   0x200F

Definition at line 31 of file gfx_driver_opengl.c.

#define WGL_SUPPORT_OPENGL_ARB   0x2010

Definition at line 32 of file gfx_driver_opengl.c.

#define WGL_SWAP_COPY_ARB   0x2029

Definition at line 57 of file gfx_driver_opengl.c.

#define WGL_SWAP_EXCHANGE_ARB   0x2028

Definition at line 56 of file gfx_driver_opengl.c.

#define WGL_SWAP_LAYER_BUFFERS_ARB   0x2006

Definition at line 18 of file gfx_driver_opengl.c.

#define WGL_SWAP_METHOD_ARB   0x2007

Definition at line 19 of file gfx_driver_opengl.c.

#define WGL_SWAP_UNDEFINED_ARB   0x202A

Definition at line 58 of file gfx_driver_opengl.c.

#define WGL_TRANSPARENT_ALPHA_VALUE_ARB   0x203A

Definition at line 26 of file gfx_driver_opengl.c.

#define WGL_TRANSPARENT_ARB   0x200A

Definition at line 22 of file gfx_driver_opengl.c.

#define WGL_TRANSPARENT_BLUE_VALUE_ARB   0x2039

Definition at line 25 of file gfx_driver_opengl.c.

#define WGL_TRANSPARENT_GREEN_VALUE_ARB   0x2038

Definition at line 24 of file gfx_driver_opengl.c.

#define WGL_TRANSPARENT_INDEX_VALUE_ARB   0x203B

Definition at line 27 of file gfx_driver_opengl.c.

#define WGL_TRANSPARENT_RED_VALUE_ARB   0x2037

Definition at line 23 of file gfx_driver_opengl.c.

#define WGL_TYPE_COLORINDEX_ARB   0x202C

Definition at line 60 of file gfx_driver_opengl.c.

#define WGL_TYPE_RGBA_ARB   0x202B

Definition at line 59 of file gfx_driver_opengl.c.

Typedef Documentation

typedef struct FB_WGL FB_WGL
typedef BOOL(APIENTRY * WGLCHOOSEPIXELFORMATARB)(HDC, const int *, const FLOAT *, int, int *, int *)

Definition at line 100 of file gfx_driver_opengl.c.

typedef HGLRC(APIENTRY * WGLCREATECONTEXT)(HDC)

Definition at line 95 of file gfx_driver_opengl.c.

typedef BOOL(APIENTRY * WGLDELETECONTEXT)(HGLRC)

Definition at line 97 of file gfx_driver_opengl.c.

typedef PCHAR(APIENTRY * WGLGETEXTENSIONSTRINGARB)(HDC)

Definition at line 99 of file gfx_driver_opengl.c.

typedef PROC(APIENTRY * WGLGETPROCADDRESS)(LPCSTR)

Definition at line 98 of file gfx_driver_opengl.c.

typedef BOOL(APIENTRY * WGLMAKECURRENT)(HDC, HGLRC)

Definition at line 96 of file gfx_driver_opengl.c.

Function Documentation

static void driver_exit ( void  )
static

Definition at line 373 of file gfx_driver_opengl.c.

Here is the call graph for this function:

static int * driver_fetch_modes ( int  depth,
int *  size 
)
static

Definition at line 424 of file gfx_driver_opengl.c.

static void driver_flip ( void  )
static

Definition at line 400 of file gfx_driver_opengl.c.

static int driver_init ( char *  title,
int  w,
int  h,
int  depth,
int  refresh_rate,
int  flags 
)
static

Definition at line 252 of file gfx_driver_opengl.c.

Here is the call graph for this function:

static void driver_lock ( void  )
static

Definition at line 392 of file gfx_driver_opengl.c.

static void driver_poll_events ( void  )
static

Definition at line 405 of file gfx_driver_opengl.c.

Here is the call graph for this function:

static void driver_unlock ( void  )
static

Definition at line 396 of file gfx_driver_opengl.c.

void* fb_hGL_GetProcAddress ( const char *  proc)

Definition at line 116 of file gfx_driver_opengl.c.

Here is the caller graph for this function:

static int GL_init ( PIXELFORMATDESCRIPTOR *  pfd)
static

Definition at line 121 of file gfx_driver_opengl.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void opengl_exit ( void  )
static

Definition at line 245 of file gfx_driver_opengl.c.

Here is the caller graph for this function:

static int opengl_init ( void  )
static

Definition at line 167 of file gfx_driver_opengl.c.

Here is the caller graph for this function:

static void opengl_paint ( void  )
static

Definition at line 163 of file gfx_driver_opengl.c.

Here is the caller graph for this function:

Variable Documentation

FB_WGL fb_wgl
static

Definition at line 112 of file gfx_driver_opengl.c.

HDC hdc
static

Definition at line 114 of file gfx_driver_opengl.c.

HGLRC hglrc
static

Definition at line 113 of file gfx_driver_opengl.c.

FB_DYLIB library
static

Definition at line 111 of file gfx_driver_opengl.c.