2014-06-01 17:55:23 +00:00
|
|
|
/*
|
2018-09-02 00:57:29 +00:00
|
|
|
* This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>.
|
2014-06-01 17:55:23 +00:00
|
|
|
* It is copyright by its individual contributors, as recorded in the
|
|
|
|
* project's Git history. See COPYING.txt at the top level for license
|
|
|
|
* terms and a link to the Git history.
|
|
|
|
*/
|
2008-01-29 14:49:54 +00:00
|
|
|
/* prototypes for function calls between files within the OpenGL module */
|
|
|
|
|
2015-09-09 03:27:52 +00:00
|
|
|
#pragma once
|
2008-01-29 14:49:54 +00:00
|
|
|
|
2016-12-05 00:26:11 +00:00
|
|
|
#include "dxxsconf.h"
|
2016-09-24 18:06:11 +00:00
|
|
|
#if DXX_USE_OGL
|
2008-01-29 14:49:54 +00:00
|
|
|
#include "ogl_init.h" // interface to OpenGL module
|
2021-02-05 12:54:08 +00:00
|
|
|
#include "ogl_extensions.h"
|
2015-09-09 03:27:52 +00:00
|
|
|
#include "gr.h"
|
2008-01-29 14:49:54 +00:00
|
|
|
|
2021-09-04 12:17:14 +00:00
|
|
|
namespace dcx {
|
2008-01-29 14:49:54 +00:00
|
|
|
void ogl_init_texture_list_internal(void);
|
|
|
|
void ogl_smash_texture_list_internal(void);
|
|
|
|
|
2012-11-11 00:14:30 +00:00
|
|
|
extern int linedotscale;
|
2008-01-29 14:49:54 +00:00
|
|
|
|
|
|
|
extern int GL_TEXTURE_2D_enabled;
|
2015-12-13 18:00:48 +00:00
|
|
|
}
|
2008-01-29 14:49:54 +00:00
|
|
|
|
2015-04-02 02:36:54 +00:00
|
|
|
#define OGL_SET_FEATURE_STATE(G,V,F) static_cast<void>(G != V && (G = V, F, 0))
|
|
|
|
#define OGL_ENABLE(a) OGL_SET_FEATURE_STATE(GL_##a##_enabled, 1, glEnable(GL_##a))
|
|
|
|
#define OGL_DISABLE(a) OGL_SET_FEATURE_STATE(GL_##a##_enabled, 0, glDisable(GL_##a))
|
2008-01-29 14:49:54 +00:00
|
|
|
|
|
|
|
//#define OGL_TEXCLAMP() OGL_ENABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);)
|
|
|
|
//#define OGL_TEXREPEAT() OGL_DISABLE2(GL_texclamp,glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);)
|
|
|
|
//#define OGL_SETSTATE(a,s,f) {if (a ## _state!=s) {f;a ## _state=s;}}
|
|
|
|
//#define OGL_TEXENV(p,m) OGL_SETSTATE(p,m,glTexEnvi(GL_TEXTURE_ENV, p,m));
|
|
|
|
//#define OGL_TEXPARAM(p,m) OGL_SETSTATE(p,m,glTexParameteri(GL_TEXTURE_2D,p,m))
|
|
|
|
|
2015-12-13 18:00:49 +00:00
|
|
|
namespace dcx {
|
2013-08-04 22:24:33 +00:00
|
|
|
extern unsigned last_width,last_height;
|
|
|
|
static inline void OGL_VIEWPORT(const unsigned x, const unsigned y, const unsigned w, const unsigned h)
|
|
|
|
{
|
|
|
|
if (w!=last_width || h!=last_height)
|
|
|
|
{
|
2016-05-28 17:31:26 +00:00
|
|
|
last_width = w;
|
|
|
|
last_height = h;
|
2013-08-04 22:24:33 +00:00
|
|
|
glViewport(x,grd_curscreen->sc_canvas.cv_bitmap.bm_h-y-h,w,h);
|
|
|
|
}
|
|
|
|
}
|
2015-12-13 18:00:48 +00:00
|
|
|
|
2016-01-09 16:38:15 +00:00
|
|
|
#ifdef dsx
|
2008-01-29 14:49:54 +00:00
|
|
|
//platform specific funcs
|
2020-07-05 23:34:32 +00:00
|
|
|
void ogl_swap_buffers_internal();
|
2015-12-13 18:00:48 +00:00
|
|
|
#endif
|
2020-07-05 23:34:32 +00:00
|
|
|
}
|
2015-12-13 18:00:48 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|