annotate libvo/gl_common.h @ 16531:8bce04298ae8

Sync with 1.1108
author gpoirier
date Mon, 19 Sep 2005 19:53:20 +0000
parents 3191dcb27a12
children 26b156d7a68d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13653
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
1 #ifndef __GL_COMMON_H__
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
2 #define __GL_COMMON_H__
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
3
13843
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
4 #include "mp_msg.h"
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
5 #include "config.h"
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
6
13653
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
7 #include <GL/gl.h>
13843
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
8 #include "video_out.h"
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
9
14142
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
10 #ifdef GL_WIN32
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
11 #include <windows.h>
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
12 #include <GL/glext.h>
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
13 #include "w32_common.h"
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
14 #else
13843
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
15 #include <X11/Xlib.h>
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
16 #include <GL/glx.h>
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
17 #include "x11_common.h"
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
18 #endif
13653
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
19
16488
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
20 // conditionally define all extension defines used
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
21 // vendor specific extensions should be marked as such
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
22 // (e.g. _NV), _ARB is not used to ease readability.
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
23 #ifndef GL_MAX_GENERAL_COMBINERS_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
24 #define GL_MAX_GENERAL_COMBINERS_NV 0x854D
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
25 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
26 #ifndef GL_NUM_GENERAL_COMBINERS_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
27 #define GL_NUM_GENERAL_COMBINERS_NV 0x854E
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
28 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
29 #ifndef GL_CONSTANT_COLOR0_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
30 #define GL_CONSTANT_COLOR0_NV 0x852A
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
31 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
32 #ifndef GL_CONSTANT_COLOR1_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
33 #define GL_CONSTANT_COLOR1_NV 0x852B
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
34 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
35 #ifndef GL_COMBINER0_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
36 #define GL_COMBINER0_NV 0x8550
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
37 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
38 #ifndef GL_COMBINER1_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
39 #define GL_COMBINER1_NV 0x8551
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
40 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
41 #ifndef GL_VARIABLE_A_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
42 #define GL_VARIABLE_A_NV 0x8523
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
43 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
44 #ifndef GL_VARIABLE_B_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
45 #define GL_VARIABLE_B_NV 0x8524
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
46 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
47 #ifndef GL_VARIABLE_C_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
48 #define GL_VARIABLE_C_NV 0x8525
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
49 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
50 #ifndef GL_VARIABLE_D_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
51 #define GL_VARIABLE_D_NV 0x8526
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
52 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
53 #ifndef GL_UNSIGNED_INVERT_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
54 #define GL_UNSIGNED_INVERT_NV 0x8537
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
55 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
56 #ifndef GL_HALF_BIAS_NORMAL_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
57 #define GL_HALF_BIAS_NORMAL_NV 0x853A
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
58 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
59 #ifndef GL_SIGNED_IDENTITY_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
60 #define GL_SIGNED_IDENTITY_NV 0x853C
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
61 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
62 #ifndef GL_SCALE_BY_FOUR_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
63 #define GL_SCALE_BY_FOUR_NV 0x853F
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
64 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
65 #ifndef GL_DISCARD_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
66 #define GL_DISCARD_NV 0x8530
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
67 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
68 #ifndef GL_SPARE0_NV
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
69 #define GL_SPARE0_NV 0x852E
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
70 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
71 #ifndef GL_MAX_TEXTURE_UNITS
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
72 #define GL_MAX_TEXTURE_UNITS 0x84E2
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
73 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
74 #ifndef GL_TEXTURE0
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
75 #define GL_TEXTURE0 0x84C0
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
76 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
77 #ifndef GL_TEXTURE1
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
78 #define GL_TEXTURE1 0x84C1
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
79 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
80 #ifndef GL_TEXTURE2
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
81 #define GL_TEXTURE2 0x84C2
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
82 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
83 #ifndef GL_TEXTURE3
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
84 #define GL_TEXTURE3 0x84C3
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
85 #endif
16099
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
86 #ifndef GL_TEXTURE_RECTANGLE
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
87 #define GL_TEXTURE_RECTANGLE 0x84F5
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
88 #endif
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
89 #ifndef GL_PIXEL_UNPACK_BUFFER
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
90 #define GL_PIXEL_UNPACK_BUFFER 0x88EC
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
91 #endif
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
92 #ifndef GL_STREAM_DRAW
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
93 #define GL_STREAM_DRAW 0x88E0
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
94 #endif
16237
b951a75d4f83 Our buffer usage actually fits better to GL_DYNAMIC_DRAW than GL_STREAM_DRAW.
reimar
parents: 16233
diff changeset
95 #ifndef GL_DYNAMIC_DRAW
b951a75d4f83 Our buffer usage actually fits better to GL_DYNAMIC_DRAW than GL_STREAM_DRAW.
reimar
parents: 16233
diff changeset
96 #define GL_DYNAMIC_DRAW 0x88E8
b951a75d4f83 Our buffer usage actually fits better to GL_DYNAMIC_DRAW than GL_STREAM_DRAW.
reimar
parents: 16233
diff changeset
97 #endif
16099
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
98 #ifndef GL_WRITE_ONLY
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
99 #define GL_WRITE_ONLY 0x88B9
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
100 #endif
16117
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
101 #ifndef GL_BGR
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
102 #define GL_BGR 0x80E0
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
103 #endif
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
104 #ifndef GL_BGRA
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
105 #define GL_BGRA 0x80E1
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
106 #endif
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
107 #ifndef GL_UNSIGNED_BYTE_3_3_2
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
108 #define GL_UNSIGNED_BYTE_3_3_2 0x8032
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
109 #endif
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
110 #ifndef GL_UNSIGNED_BYTE_2_3_3_REV
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
111 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
112 #endif
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
113 #ifndef GL_UNSIGNED_SHORT_5_6_5
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
114 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
115 #endif
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
116 #ifndef GL_UNSIGNED_SHORT_5_6_5_REV
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
117 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
118 #endif
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
119 #ifndef GL_UNSIGNED_SHORT_5_5_5_1
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
120 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
121 #endif
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
122 #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
123 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
124 #endif
16488
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
125 #ifndef GL_FRAGMENT_PROGRAM
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
126 #define GL_FRAGMENT_PROGRAM 0x8804
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
127 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
128 #ifndef GL_PROGRAM_FORMAT_ASCII
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
129 #define GL_PROGRAM_FORMAT_ASCII 0x8875
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
130 #endif
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
131 #ifndef GL_PROGRAM_ERROR_POSITION
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
132 #define GL_PROGRAM_ERROR_POSITION 0x864B
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
133 #endif
16099
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
134
13653
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
135 void glAdjustAlignment(int stride);
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
136
14078
c4033dcb986f More similar code from gl and gl2 moved to gl_common
reimar
parents: 13921
diff changeset
137 const char *glValName(GLint value);
c4033dcb986f More similar code from gl and gl2 moved to gl_common
reimar
parents: 13921
diff changeset
138
16303
a87c6cf3fe52 Fix texture format variable types. Internal format is GLint, others are GLenum
reimar
parents: 16270
diff changeset
139 int glFindFormat(uint32_t format, uint32_t *bpp, GLint *gl_texfmt,
14078
c4033dcb986f More similar code from gl and gl2 moved to gl_common
reimar
parents: 13921
diff changeset
140 GLenum *gl_format, GLenum *gl_type);
16117
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
141 int glFmt2bpp(GLenum format, GLenum type);
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
142 void glCreateClearTex(GLenum target, GLenum fmt, GLint filter,
16460
ec7036dedee4 Fix border color (forgot to divide by 255.0).
reimar
parents: 16303
diff changeset
143 int w, int h, unsigned char val);
16117
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
144 void glUploadTex(GLenum target, GLenum format, GLenum type,
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
145 const char *data, int stride,
d280ec2b9e63 More helper functions/defines and bugfixes
reimar
parents: 16109
diff changeset
146 int x, int y, int w, int h, int slice);
16214
ede5b4afd262 Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents: 16117
diff changeset
147 void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h,
ede5b4afd262 Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents: 16117
diff changeset
148 GLfloat tx, GLfloat ty, GLfloat tw, GLfloat th,
16488
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
149 int sx, int sy, int rect_tex, int is_yv12);
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
150
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
151 //! do not use YUV conversion, this should always stay 0
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
152 #define YUV_CONVERSION_NONE 0
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
153 //! use nVidia specific register combiners for YUV conversion
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
154 #define YUV_CONVERSION_COMBINERS 1
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
155 //! use a fragment program for YUV conversion
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
156 #define YUV_CONVERSION_FRAGMENT 2
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
157 //! use a fragment program for YUV conversion with gamma using POW
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
158 #define YUV_CONVERSION_FRAGMENT_POW 3
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
159 //! use a fragment program with additional table lookup for YUV conversion
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
160 #define YUV_CONVERSION_FRAGMENT_LOOKUP 4
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
161 void glSetupYUVConversion(int type, float brightness, float contrast,
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
162 float hue, float saturation,
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
163 float rgamma, float ggamma, float bgamma);
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
164 void inline glEnableYUVConversion(GLenum target, int type);
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
165 void inline glDisableYUVConversion(GLenum target, int type);
14078
c4033dcb986f More similar code from gl and gl2 moved to gl_common
reimar
parents: 13921
diff changeset
166
13843
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
167 //! could not set new window, will continue drawing into the old one.
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
168 #define SET_WINDOW_FAILED -1
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
169 //! new window is set, could even transfer the OpenGL context.
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
170 #define SET_WINDOW_OK 0
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
171 //! new window is set, but the OpenGL context needs to be reinitialized.
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
172 #define SET_WINDOW_REINIT 1
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
173
14142
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
174 #ifdef GL_WIN32
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
175 int setGlWindow(int *vinfo, HGLRC *context, HWND win);
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
176 void releaseGlContext(int *vinfo, HGLRC *context);
f0c1ee83b216 Improving gl2 under windows, moving some functionality to gl_common
reimar
parents: 14078
diff changeset
177 #else
13843
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
178 int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win);
13921
ae1dfa5bc2e1 added missing declaration of releaseGlContext
reimar
parents: 13843
diff changeset
179 void releaseGlContext(XVisualInfo **vinfo, GLXContext *context);
13653
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
180 #endif
13843
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
181
16233
f00a2826ee11 use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents: 16214
diff changeset
182 extern void (APIENTRY *GenBuffers)(GLsizei, GLuint *);
f00a2826ee11 use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents: 16214
diff changeset
183 extern void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *);
16099
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
184 extern void (APIENTRY *BindBuffer)(GLenum, GLuint);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
185 extern GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
186 extern GLboolean (APIENTRY *UnmapBuffer)(GLenum);
16109
519a307e3ccf OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents: 16099
diff changeset
187 extern void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
16099
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
188 extern void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
189 extern void (APIENTRY *CombinerParameteri)(GLenum, GLint);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
190 extern void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
191 GLenum);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
192 extern void (APIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
193 GLenum, GLenum, GLboolean, GLboolean,
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
194 GLboolean);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
195 extern void (APIENTRY *ActiveTexture)(GLenum);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
196 extern void (APIENTRY *BindTexture)(GLenum, GLuint);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
197 extern void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat);
16488
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
198 extern void (APIENTRY *GenPrograms)(GLsizei, GLuint *);
3191dcb27a12 hardware color-space conversion for vo_gl and vo_gl2
reimar
parents: 16460
diff changeset
199 extern void (APIENTRY *DeletePrograms)(GLsizei, const GLuint *);
16099
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
200 extern void (APIENTRY *BindProgram)(GLenum, GLuint);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
201 extern void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
202 extern void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
203 GLfloat, GLfloat);
16270
d5374d07492a Fix crash in windows
reimar
parents: 16268
diff changeset
204 extern int (APIENTRY *SwapInterval)(int);
16099
629c54dc7e0d support for rectangular and streaming textures.
reimar
parents: 14142
diff changeset
205
13843
3f28d2a56758 fullscreen fixes and GUI support for vo_gl
reimar
parents: 13653
diff changeset
206 #endif