1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00
cnc-ddraw/inc/render_ogl.h

60 lines
1.3 KiB
C
Raw Normal View History

2020-10-13 09:20:52 +02:00
#ifndef RENDER_OGL_H
#define RENDER_OGL_H
#include <windows.h>
#include "opengl_utils.h"
#define TEXTURE_COUNT 4
#define FBO_COUNT 2
2020-10-13 09:20:52 +02:00
2024-07-26 08:17:56 +02:00
#ifdef _DEBUG
#define GL_CHECK(stmt) do { \
stmt; \
ogl_check_error(#stmt); \
} while (0)
#else
#define GL_CHECK(stmt) stmt
#endif
2021-06-11 20:30:43 +02:00
typedef struct OGLRENDERER
2020-10-13 09:20:52 +02:00
{
HWND hwnd;
HDC hdc;
2020-10-13 09:20:52 +02:00
HGLRC context;
GLuint main_program;
GLuint shader1_program;
GLuint shader2_program;
2020-10-13 09:20:52 +02:00
BOOL got_error;
int surface_tex_width;
int surface_tex_height;
GLenum surface_format;
GLenum surface_type;
GLuint surface_tex_ids[TEXTURE_COUNT];
GLuint palette_tex_ids[TEXTURE_COUNT];
float scale_w;
float scale_h;
GLint main_tex_coord_attr_loc;
GLint main_vertex_coord_attr_loc;
GLuint main_vbos[3];
GLuint main_vao;
2024-05-18 06:20:13 +02:00
GLint shader1_frame_count_uni_loc;
GLint shader2_frame_count_uni_loc;
2024-05-16 01:20:13 +02:00
GLuint frame_buffer_id[FBO_COUNT];
GLuint frame_buffer_tex_id[FBO_COUNT];
GLint shader1_tex_coord_attr_loc;
GLint shader2_tex_coord_attr_loc;
GLuint shader1_vbos[3];
GLuint shader2_vbos[3];
GLuint shader1_vao;
GLuint shader2_vao;
2020-10-13 09:20:52 +02:00
BOOL use_opengl;
BOOL filter_bilinear;
BOOL shader2_upscale;
2021-06-11 20:30:43 +02:00
} OGLRENDERER;
2020-10-13 09:20:52 +02:00
DWORD WINAPI ogl_render_main(void);
BOOL ogl_create();
BOOL ogl_release();
2020-10-13 09:20:52 +02:00
#endif