/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/zzogl-pg/opengl/ZZGl.h
ViewVC logotype

Contents of /branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/zzogl-pg/opengl/ZZGl.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 314 - (show annotations) (download)
Sun Dec 26 18:56:19 2010 UTC (9 years, 2 months ago) by william
File MIME type: text/plain
File size: 4498 byte(s)
** merged upstream r4049 (re-integration of GregMiscellaneous branch)
** applied patched to GigTranser.cpp in ZZOgl from r4140 to change 'static int count = 0;' to 'static int path1_count = 0;')
1 /* ZZ Open GL graphics plugin
2 * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
3 * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 #ifndef ZZGL_H_INCLUDED
21 #define ZZGL_H_INCLUDED
22
23 #include "PS2Etypes.h"
24 #include "PS2Edefs.h"
25
26 // Need this before gl.h
27 #ifdef _WIN32
28
29 #include <windows.h>
30 #include <GL/gl.h>
31 #include <GL/glext.h>
32 #include "glprocs.h"
33
34 #else
35
36 // adding glew support instead of glXGetProcAddress (thanks to scaught)
37 #include <GL/glew.h>
38 #include <GL/gl.h>
39 #include <GL/glext.h>
40 #include <GL/glx.h>
41
42 inline void* wglGetProcAddress(const char* x)
43 {
44 return (void*)glXGetProcAddress((const GLubyte*)x);
45 }
46
47 #endif
48
49 extern u32 s_stencilfunc, s_stencilref, s_stencilmask;
50 // Defines
51
52 #ifndef GL_DEPTH24_STENCIL8_EXT // allows FBOs to support stencils
53 # define GL_DEPTH_STENCIL_EXT 0x84F9
54 # define GL_UNSIGNED_INT_24_8_EXT 0x84FA
55 # define GL_DEPTH24_STENCIL8_EXT 0x88F0
56 # define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
57 #endif
58
59 #define GL_STENCILFUNC(func, ref, mask) { \
60 s_stencilfunc = func; \
61 s_stencilref = ref; \
62 s_stencilmask = mask; \
63 glStencilFunc(func, ref, mask); \
64 }
65
66 #define GL_STENCILFUNC_SET() glStencilFunc(s_stencilfunc, s_stencilref, s_stencilmask)
67
68
69 // sets the data stream
70 #define SET_STREAM() { \
71 glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(VertexGPU), (void*)8); \
72 glSecondaryColorPointerEXT(4, GL_UNSIGNED_BYTE, sizeof(VertexGPU), (void*)12); \
73 glTexCoordPointer(3, GL_FLOAT, sizeof(VertexGPU), (void*)16); \
74 glVertexPointer(4, GL_SHORT, sizeof(VertexGPU), (void*)0); \
75 }
76
77
78 // global alpha blending settings
79 extern GLenum g_internalRGBAFloat16Fmt;
80
81 #define SAFE_RELEASE_TEX(x) { if( (x) != 0 ) { glDeleteTextures(1, &(x)); x = 0; } }
82
83 // inline for an extremely often used sequence
84 // This is turning off all gl functions. Safe to do updates.
85 inline void DisableAllgl()
86 {
87 glDisable(GL_SCISSOR_TEST);
88 glDisable(GL_BLEND);
89 glDisable(GL_ALPHA_TEST);
90 glDisable(GL_DEPTH_TEST);
91 glDepthMask(0);
92 glDisable(GL_STENCIL_TEST);
93 glColorMask(1, 1, 1, 1);
94 }
95
96 //--------------------- Dummies
97
98 #ifdef _WIN32
99 extern void (__stdcall *zgsBlendEquationSeparateEXT)(GLenum, GLenum);
100 extern void (__stdcall *zgsBlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum);
101 #else
102 extern void (APIENTRY *zgsBlendEquationSeparateEXT)(GLenum, GLenum);
103 extern void (APIENTRY *zgsBlendFuncSeparateEXT)(GLenum, GLenum, GLenum, GLenum);
104 #endif
105
106
107 // ------------------------ Types -------------------------
108
109 /////////////////////
110 // graphics resources
111 extern GLenum s_srcrgb, s_dstrgb, s_srcalpha, s_dstalpha; // set by zgsBlendFuncSeparateEXT
112
113 // GL prototypes
114 extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
115 extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
116 extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
117 extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
118 extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
119 extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
120 extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
121 extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
122 extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
123 extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
124 extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
125 extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
126 extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
127 extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
128 extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
129 extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
130 extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
131 extern PFNGLDRAWBUFFERSPROC glDrawBuffers;
132
133 #endif // ZZGL_H_INCLUDED

  ViewVC Help
Powered by ViewVC 1.1.22