Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions inc/fbgfx.bi
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ namespace FB
GFX_MULTISAMPLE = &h40000

'Constants for OpenGL 2D render
const as integer OGL_MANUAL_SYNC = 1, _
OGL_AUTO_SYNC = 2
const as integer OGL_2D_NONE = 0, _
OGL_2D_MANUAL_SYNC = 1, _
OGL_2D_AUTO_SYNC = 2

'' Constants accepted by ScreenControl
''
Expand Down Expand Up @@ -87,7 +88,9 @@ namespace FB
SET_GL_ACCUM_GREEN_BITS = 114 , _
SET_GL_ACCUM_BLUE_BITS = 115 , _
SET_GL_ACCUM_ALPHA_BITS = 116 , _
SET_GL_NUM_SAMPLES = 117
SET_GL_NUM_SAMPLES = 117 , _
SET_GL_2D_MODE = 150 , _
SET_GL_SCALE = 151
'' Commands:
const as integer POLL_EVENTS = 200

Expand Down
11 changes: 8 additions & 3 deletions src/gfxlib2/fb_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
#define DEFAULT_COLOR_2 0x40000000
#define VIEW_SCREEN 0x00000001

#define DRIVER_OGL_2D_NONE 0
#define DRIVER_OGL_2D_MANUAL_SYNC 1
#define DRIVER_OGL_2D_AUTO_SYNC 2


#define LINE_TYPE_LINE 0
#define LINE_TYPE_B 1
#define LINE_TYPE_BF 2
Expand Down Expand Up @@ -147,9 +152,9 @@
#define SET_GL_ACCUM_GREEN_BITS 114
#define SET_GL_ACCUM_BLUE_BITS 115
#define SET_GL_ACCUM_ALPHA_BITS 116
#define SET_GL_NUM_SAMPLES 117
#define SET_GL_2D_MODE 150
#define SET_GL_SCALE 151
#define SET_GL_NUM_SAMPLES 117
#define SET_GL_2D_MODE 150
#define SET_GL_SCALE 151

#define POLL_EVENTS 200

Expand Down
2 changes: 1 addition & 1 deletion src/gfxlib2/gfx_page.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FBCALL int fb_GfxFlip(int from_page, int to_page)
}

#ifndef DISABLE_OPENGL
if (__fb_gfx->driver->flip && __fb_gl_params.mode_2d!=2) {
if (__fb_gfx->driver->flip && (__fb_gl_params.mode_2d != DRIVER_OGL_2D_AUTO_SYNC)) {
#else
if (__fb_gfx->driver->flip) {
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/gfxlib2/win32/gfx_driver_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ static int driver_init(char *title, int w, int h, int depth_arg, int refresh_rat
if (fb_hWin32Init(title, w, h, depth, refresh_rate, flags)){
return -1;
}
if (__fb_gl_params.mode_2d==2){
if (__fb_gl_params.mode_2d == DRIVER_OGL_2D_AUTO_SYNC){
fb_wgl.MakeCurrent(NULL, NULL);
#ifdef HOST_MINGW
/* Note: _beginthreadex()'s last parameter cannot be NULL,
Expand Down Expand Up @@ -521,7 +521,7 @@ static int driver_init(char *title, int w, int h, int depth_arg, int refresh_rat
if ((samples_attrib) && (*samples_attrib > 0)){
__fb_gl.Enable(GL_MULTISAMPLE_ARB);
}
if (__fb_gl_params.mode_2d!=0){
if (__fb_gl_params.mode_2d != DRIVER_OGL_2D_NONE){
fb_hGL_ScreenCreate();
}
return 0;
Expand Down Expand Up @@ -556,7 +556,7 @@ static void driver_unlock(void)

static void driver_flip(void)
{
if (__fb_gl_params.mode_2d==1){
if (__fb_gl_params.mode_2d == DRIVER_OGL_2D_MANUAL_SYNC){
fb_hGL_SetupProjection();
}
SwapBuffers(hdc);
Expand Down