Mercurial > mplayer.hg
annotate libvo/gl_common.h @ 16099:629c54dc7e0d
support for rectangular and streaming textures.
author | reimar |
---|---|
date | Tue, 26 Jul 2005 10:16:18 +0000 |
parents | f0c1ee83b216 |
children | 519a307e3ccf |
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 | |
32 | |
13653
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff
changeset
|
33 void glAdjustAlignment(int stride); |
799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff
changeset
|
34 |
14078
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
35 const char *glValName(GLint value); |
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
36 |
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
37 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
|
38 GLenum *gl_format, GLenum *gl_type); |
c4033dcb986f
More similar code from gl and gl2 moved to gl_common
reimar
parents:
13921
diff
changeset
|
39 |
13843 | 40 //! could not set new window, will continue drawing into the old one. |
41 #define SET_WINDOW_FAILED -1 | |
42 //! new window is set, could even transfer the OpenGL context. | |
43 #define SET_WINDOW_OK 0 | |
44 //! new window is set, but the OpenGL context needs to be reinitialized. | |
45 #define SET_WINDOW_REINIT 1 | |
46 | |
14142
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
47 #ifdef GL_WIN32 |
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
48 int setGlWindow(int *vinfo, HGLRC *context, HWND win); |
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
49 void releaseGlContext(int *vinfo, HGLRC *context); |
f0c1ee83b216
Improving gl2 under windows, moving some functionality to gl_common
reimar
parents:
14078
diff
changeset
|
50 #else |
13843 | 51 int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win); |
13921 | 52 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
|
53 #endif |
13843 | 54 |
16099 | 55 extern void (APIENTRY *BindBuffer)(GLenum, GLuint); |
56 extern GLvoid* (APIENTRY *MapBuffer)(GLenum, GLenum); | |
57 extern GLboolean (APIENTRY *UnmapBuffer)(GLenum); | |
58 extern void (APIENTRY *BufferData)(GLenum, GLsizeiptr, const GLvoid *, GLenum); | |
59 extern void (APIENTRY *CombinerParameterfv)(GLenum, const GLfloat *); | |
60 extern void (APIENTRY *CombinerParameteri)(GLenum, GLint); | |
61 extern void (APIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum, | |
62 GLenum); | |
63 extern void (APIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum, | |
64 GLenum, GLenum, GLboolean, GLboolean, | |
65 GLboolean); | |
66 extern void (APIENTRY *ActiveTexture)(GLenum); | |
67 extern void (APIENTRY *BindTexture)(GLenum, GLuint); | |
68 extern void (APIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat); | |
69 extern void (APIENTRY *BindProgram)(GLenum, GLuint); | |
70 extern void (APIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *); | |
71 extern void (APIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat, | |
72 GLfloat, GLfloat); | |
73 | |
13843 | 74 #endif |