DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/hardware/voodoo_opengl.h
00001  /*
00002  *  Copyright (C) 2002-2020  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License along
00015  *  with this program; if not, write to the Free Software Foundation, Inc.,
00016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 
00020 #ifndef DOSBOX_VOODOO_OPENGL_H
00021 #define DOSBOX_VOODOO_OPENGL_H
00022 
00023 #include <stdlib.h>
00024 #include <math.h>
00025 #include <map>
00026 
00027 #include "dosbox.h"
00028 #include "cross.h"
00029 
00030 
00031 #if C_OPENGL
00032 
00033 #include "voodoo_vogl.h"
00034 #include "voodoo_types.h"
00035 
00036 
00037 /* texture data */
00038 struct ogl_texture_data {
00039         GLuint texID;
00040         bool enable;
00041 };
00042 
00043 /* triangle vertex map data */
00044 struct ogl_vertex_map_data {
00045         float sw,tw,z,w;
00046         float s,t;
00047         float lodblend;
00048 };
00049 
00050 /* triangle vertex data */
00051 struct ogl_vertex_data {
00052         float x,y,d,w,z;
00053         float r,g,b,a;
00054         float fogblend;
00055         ogl_vertex_map_data m[2];
00056 };
00057 
00058 struct ogl_texmap {
00059         bool valid_data;
00060         bool valid_pal;
00061         UINT32 format;
00062         UINT32 current_id;
00063 
00064         std::map<const UINT32, GLuint>* ids;
00065 };
00066 
00067 #endif
00068 
00069 
00070 bool voodoo_ogl_init(voodoo_state *v);
00071 void voodoo_ogl_leave(bool leavemode);
00072 void voodoo_ogl_shutdown(voodoo_state *v);
00073 
00074 void voodoo_ogl_set_window(voodoo_state *v);
00075 void voodoo_ogl_swap_buffer(void);
00076 void voodoo_ogl_vblank_flush(void);
00077 
00078 void voodoo_ogl_update_dimensions(void);
00079 void voodoo_ogl_clear(void);
00080 void voodoo_ogl_fastfill(void);
00081 
00082 void voodoo_ogl_clip_window(voodoo_state *v);
00083 void voodoo_ogl_texture_clear(UINT32 texbase, int TMU);
00084 void voodoo_ogl_invalidate_paltex(void);
00085 
00086 void voodoo_ogl_draw_pixel(int x, int y, bool has_rgb, bool has_alpha, int r, int g, int b, int a);
00087 void voodoo_ogl_draw_z(int x, int y, int z);
00088 void voodoo_ogl_draw_pixel_pipeline(int x, int y, int r, int g, int b);
00089 UINT32 voodoo_ogl_read_pixel(int x, int y);
00090 
00091 void voodoo_ogl_draw_triangle(poly_extra_data *extra);
00092 
00093 #endif