Mercurial > mplayer.hg
annotate libvo/gl_common.h @ 16233:f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
author | reimar |
---|---|
date | Tue, 16 Aug 2005 17:57:53 +0000 |
parents | ede5b4afd262 |
children | b951a75d4f83 |
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 | 4 #include "mp_msg.h" |
5 #include "config.h" | |
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 | 8 #include "video_out.h" |
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 | 15 #include <X11/Xlib.h> |
16 #include <GL/glx.h> | |
17 #include "x11_common.h" | |
18 #endif | |
13653
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff
changeset
|
19 |
16099 | 20 #ifndef GL_TEXTURE_RECTANGLE |
21 #define GL_TEXTURE_RECTANGLE 0x84F5 | |
22 #endif | |
23 #ifndef GL_PIXEL_UNPACK_BUFFER | |
24 #define GL_PIXEL_UNPACK_BUFFER 0x88EC | |
25 #endif | |
26 #ifndef GL_STREAM_DRAW | |
27 #define GL_STREAM_DRAW 0x88E0 | |
28 #endif | |
29 #ifndef GL_WRITE_ONLY | |
30 #define GL_WRITE_ONLY 0x88B9 | |
31 #endif | |
16117 | 32 #ifndef GL_BGR |
33 #define GL_BGR 0x80E0 | |
34 #endif | |
35 #ifndef GL_BGRA | |
36 #define GL_BGRA 0x80E1 | |
37 #endif | |
38 #ifndef GL_UNSIGNED_BYTE_3_3_2 | |
39 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 | |
40 #endif | |
41 #ifndef GL_UNSIGNED_BYTE_2_3_3_REV | |
42 #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 | |
43 #endif | |
44 #ifndef GL_UNSIGNED_SHORT_5_6_5 | |
45 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 | |
46 #endif | |
47 #ifndef GL_UNSIGNED_SHORT_5_6_5_REV | |
48 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 | |
49 #endif | |
50 #ifndef GL_UNSIGNED_SHORT_5_5_5_1 | |
51 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 | |
52 #endif | |
53 #ifndef GL_UNSIGNED_SHORT_1_5_5_5_REV | |
54 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 | |
55 #endif | |
16099 | 56 |
13653
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff
changeset
|
57 void glAdjustAlignment(int stride); |
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff
changeset
|
58 |
14078
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
59 const char *glValName(GLint value); |
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
60 |
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
61 int glFindFormat(uint32_t format, uint32_t *bpp, GLenum *gl_texfmt, |
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
62 GLenum *gl_format, GLenum *gl_type); |
16117 | 63 int glFmt2bpp(GLenum format, GLenum type); |
64 void glCreateClearTex(GLenum target, GLenum fmt, GLint filter, | |
65 int w, int h, char val); | |
66 void glUploadTex(GLenum target, GLenum format, GLenum type, | |
67 const char *data, int stride, | |
68 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
|
69 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
|
70 GLfloat tx, GLfloat ty, GLfloat tw, GLfloat th, |
ede5b4afd262
Helper function for drawing texture and general cleanup of vo_gl2.c
reimar
parents:
16117
diff
changeset
|
71 int sx, int sy, int rect_tex); |
14078
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
72 |
13843 | 73 //! could not set new window, will continue drawing into the old one. |
74 #define SET_WINDOW_FAILED -1 | |
75 //! new window is set, could even transfer the OpenGL context. | |
76 #define SET_WINDOW_OK 0 | |
77 //! new window is set, but the OpenGL context needs to be reinitialized. | |
78 #define SET_WINDOW_REINIT 1 | |
79 | |
14142
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
80 #ifdef GL_WIN32 |
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
81 int setGlWindow(int *vinfo, HGLRC *context, HWND win); |
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
82 void releaseGlContext(int *vinfo, HGLRC *context); |
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
83 #else |
13843 | 84 int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win); |
13921 | 85 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
|
86 #endif |
13843 | 87 |
16233
f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents:
16214
diff
changeset
|
88 extern void (APIENTRY *GenBuffers)(GLsizei, GLuint *); |
f00a2826ee11
use GenBuffers to get a buffer number instead of hardcoding 1.
reimar
parents:
16214
diff
changeset
|
89 extern void (APIENTRY *DeleteBuffers)(GLsizei, const GLuint *); |
16099 | 90 extern void (APIENTRY *BindBuffer)(GLenum, GLuint); |
91 extern GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); | |
92 extern GLboolean (APIENTRY *UnmapBuffer)(GLenum); | |
16109
519a307e3ccf
OpenGL fixes for windows and vo_gl.c ported to windows.
reimar
parents:
16099
diff
changeset
|
93 extern void (APIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum); |
16099 | 94 extern void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *); |
95 extern void (APIENTRY *CombinerParameteri)(GLenum, GLint); | |
96 extern void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum, | |
97 GLenum); | |
98 extern void (APIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum, | |
99 GLenum, GLenum, GLboolean, GLboolean, | |
100 GLboolean); | |
101 extern void (APIENTRY *ActiveTexture)(GLenum); | |
102 extern void (APIENTRY *BindTexture)(GLenum, GLuint); | |
103 extern void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat); | |
104 extern void (APIENTRY *BindProgram)(GLenum, GLuint); | |
105 extern void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *); | |
106 extern void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat, | |
107 GLfloat, GLfloat); | |
108 | |
13843 | 109 #endif |