Mercurial > mplayer.hg
comparison libvo/vo_gl2.c @ 29904:f529a2bb299d
Add support for Windows OpenGL rendering onto a device instead of into a window.
Has little use except for experimenting - on Windows 9x it could be used to
render on monitors that were not managed by Windows, but that feature was
removed in newer Windows versions.
author | reimar |
---|---|
date | Sat, 21 Nov 2009 22:27:40 +0000 |
parents | e788d48bf768 |
children | eb6c70e2cbea |
comparison
equal
deleted
inserted
replaced
29903:391e683541a7 | 29904:f529a2bb299d |
---|---|
115 | 115 |
116 static GLint getInternalFormat(void) | 116 static GLint getInternalFormat(void) |
117 { | 117 { |
118 #ifdef GL_WIN32 | 118 #ifdef GL_WIN32 |
119 PIXELFORMATDESCRIPTOR pfd; | 119 PIXELFORMATDESCRIPTOR pfd; |
120 HDC vo_hdc = GetDC(vo_w32_window); | 120 HDC vo_hdc = vo_w32_get_dc(vo_w32_window); |
121 int pf = GetPixelFormat(vo_hdc); | 121 int pf = GetPixelFormat(vo_hdc); |
122 if (!DescribePixelFormat(vo_hdc, pf, sizeof pfd, &pfd)) { | 122 if (!DescribePixelFormat(vo_hdc, pf, sizeof pfd, &pfd)) { |
123 r_sz = g_sz = b_sz = a_sz = 0; | 123 r_sz = g_sz = b_sz = a_sz = 0; |
124 } else { | 124 } else { |
125 r_sz = pfd.cRedBits; | 125 r_sz = pfd.cRedBits; |
126 g_sz = pfd.cGreenBits; | 126 g_sz = pfd.cGreenBits; |
127 b_sz = pfd.cBlueBits; | 127 b_sz = pfd.cBlueBits; |
128 a_sz = pfd.cAlphaBits; | 128 a_sz = pfd.cAlphaBits; |
129 } | 129 } |
130 ReleaseDC(vo_w32_window, vo_hdc); | 130 vo_w32_release_dc(vo_w32_window, vo_hdc); |
131 #else | 131 #else |
132 if (glXGetConfig(mDisplay, gl_vinfo, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0; | 132 if (glXGetConfig(mDisplay, gl_vinfo, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0; |
133 if (glXGetConfig(mDisplay, gl_vinfo, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0; | 133 if (glXGetConfig(mDisplay, gl_vinfo, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0; |
134 if (glXGetConfig(mDisplay, gl_vinfo, GLX_BLUE_SIZE, &b_sz) != 0) b_sz = 0; | 134 if (glXGetConfig(mDisplay, gl_vinfo, GLX_BLUE_SIZE, &b_sz) != 0) b_sz = 0; |
135 if (glXGetConfig(mDisplay, gl_vinfo, GLX_ALPHA_SIZE, &a_sz) != 0) a_sz = 0; | 135 if (glXGetConfig(mDisplay, gl_vinfo, GLX_ALPHA_SIZE, &a_sz) != 0) a_sz = 0; |