Changeset 23d3f63ca53121de44137a0453f698f9d8d45bd9
- Timestamp:
- 22/07/04 18:37:43
(4 years ago)
- Author:
- Gildas Bazin <gbazin@videolan.org>
- git-committer:
- Gildas Bazin <gbazin@videolan.org> 1090514263 +0000
- git-parent:
[031cb39a6f015aeaf347a6ec2e5394a258e9e415]
- git-author:
- Gildas Bazin <gbazin@videolan.org> 1090514263 +0000
- Message:
* modules/video_output/x11/glx.c: improvements.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r4994baa |
r23d3f63 |
|
| 40 | 40 | #include <GL/glx.h> |
|---|
| 41 | 41 | |
|---|
| 42 | | |
|---|
| 43 | 42 | /* Data common to vout and opengl provider structures */ |
|---|
| 44 | 43 | typedef struct glx_t |
|---|
| … | … | |
| 53 | 52 | GLXWindow gwnd; |
|---|
| 54 | 53 | Atom wm_delete; |
|---|
| | 54 | |
|---|
| 55 | 55 | } glx_t; |
|---|
| | 56 | |
|---|
| | 57 | /* RV16 */ |
|---|
| | 58 | //#define VLCGL_RGB_FORMAT GL_RGB |
|---|
| | 59 | //#define VLCGL_RGB_TYPE GL_UNSIGNED_SHORT_5_6_5 |
|---|
| | 60 | |
|---|
| | 61 | /* RV24 */ |
|---|
| | 62 | //#define VLCGL_RGB_FORMAT GL_RGB |
|---|
| | 63 | //#define VLCGL_RGB_TYPE GL_UNSIGNED_BYTE |
|---|
| | 64 | |
|---|
| | 65 | /* RV32 */ |
|---|
| | 66 | #define VLCGL_RGB_FORMAT GL_RGBA |
|---|
| | 67 | #define VLCGL_RGB_TYPE GL_UNSIGNED_BYTE |
|---|
| 56 | 68 | |
|---|
| 57 | 69 | |
|---|
| … | … | |
| 104 | 116 | vlc_module_end(); |
|---|
| 105 | 117 | |
|---|
| 106 | | |
|---|
| 107 | 118 | /***************************************************************************** |
|---|
| 108 | 119 | * vout_sys_t: GLX video output method descriptor |
|---|
| … | … | |
| 161 | 172 | p_vout->p_sys->i_effect = 1; |
|---|
| 162 | 173 | |
|---|
| 163 | | /* p_vout->p_sys->glx.i_width = p_vout->i_window_width; |
|---|
| 164 | | p_vout->p_sys->glx.i_height = p_vout->i_window_height; */ |
|---|
| 165 | | p_vout->p_sys->glx.i_width = 700; |
|---|
| 166 | | p_vout->p_sys->glx.i_height = 700; |
|---|
| | 174 | p_vout->p_sys->glx.i_width = p_vout->i_window_width; |
|---|
| | 175 | p_vout->p_sys->glx.i_height = p_vout->i_window_height; |
|---|
| 167 | 176 | p_vout->p_sys->glx.b_fullscreen = 0; |
|---|
| 168 | 177 | |
|---|
| … | … | |
| 196 | 205 | static int Init( vout_thread_t *p_vout ) |
|---|
| 197 | 206 | { |
|---|
| 198 | | int i_index; |
|---|
| 199 | | picture_t *p_pic; |
|---|
| | 207 | int i_pixel_pitch; |
|---|
| 200 | 208 | |
|---|
| 201 | 209 | /* No YUV textures :( */ |
|---|
| | 210 | |
|---|
| | 211 | #if VLCGL_RGB_FORMAT == GL_RGB |
|---|
| | 212 | # if VLCGL_RGB_TYPE == GL_UNSIGNED_BYTE |
|---|
| | 213 | p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); |
|---|
| | 214 | p_vout->output.i_rmask = 0x000000ff; |
|---|
| | 215 | p_vout->output.i_gmask = 0x0000ff00; |
|---|
| | 216 | p_vout->output.i_bmask = 0x00ff0000; |
|---|
| | 217 | i_pixel_pitch = 3; |
|---|
| | 218 | # else |
|---|
| | 219 | p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); |
|---|
| | 220 | p_vout->output.i_rmask = 0xf800; |
|---|
| | 221 | p_vout->output.i_gmask = 0x07e0; |
|---|
| | 222 | p_vout->output.i_bmask = 0x001f; |
|---|
| | 223 | i_pixel_pitch = 2; |
|---|
| | 224 | # endif |
|---|
| | 225 | #else |
|---|
| 202 | 226 | p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); |
|---|
| 203 | 227 | p_vout->output.i_rmask = 0x000000ff; |
|---|
| 204 | 228 | p_vout->output.i_gmask = 0x0000ff00; |
|---|
| 205 | 229 | p_vout->output.i_bmask = 0x00ff0000; |
|---|
| 206 | | |
|---|
| | 230 | i_pixel_pitch = 4; |
|---|
| | 231 | #endif |
|---|
| | 232 | |
|---|
| | 233 | /* Since OpenGL can do rescaling for us, stick to the default |
|---|
| | 234 | * coordinates and aspect. */ |
|---|
| 207 | 235 | p_vout->output.i_width = p_vout->render.i_width; |
|---|
| 208 | 236 | p_vout->output.i_height = p_vout->render.i_height; |
|---|
| 209 | 237 | p_vout->output.i_aspect = p_vout->render.i_aspect; |
|---|
| 210 | 238 | |
|---|
| 211 | | I_OUTPUTPICTURES = 0; |
|---|
| 212 | | |
|---|
| 213 | | p_pic = NULL; |
|---|
| 214 | | |
|---|
| 215 | | /* Find an empty picture slot */ |
|---|
| 216 | | for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ ) |
|---|
| 217 | | { |
|---|
| 218 | | if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE ) |
|---|
| 219 | | { |
|---|
| 220 | | p_pic = p_vout->p_picture + i_index; |
|---|
| 221 | | break; |
|---|
| 222 | | } |
|---|
| 223 | | } |
|---|
| 224 | | |
|---|
| 225 | | if( p_pic == NULL ) |
|---|
| 226 | | { |
|---|
| 227 | | return -1; |
|---|
| 228 | | } |
|---|
| 229 | | |
|---|
| 230 | | /* We know the chroma, allocate a buffer which will be used |
|---|
| | 239 | /* We know the chroma, allocate a buffer which will be used |
|---|
| 231 | 240 | * directly by the decoder */ |
|---|
| 232 | | p_pic->i_planes = 1; |
|---|
| 233 | | |
|---|
| | 241 | p_vout->p_picture[0].i_planes = 1; |
|---|
| 234 | 242 | p_vout->p_sys->p_buffer = |
|---|
| 235 | | malloc( p_vout->p_sys->i_tex_width * p_vout->p_sys->i_tex_height * 4 ); |
|---|
| | 243 | malloc( p_vout->p_sys->i_tex_width * p_vout->p_sys->i_tex_height * |
|---|
| | 244 | i_pixel_pitch ); |
|---|
| 236 | 245 | if( !p_vout->p_sys->p_buffer ) |
|---|
| 237 | 246 | { |
|---|
| … | … | |
| 240 | 249 | } |
|---|
| 241 | 250 | |
|---|
| 242 | | p_pic->p->p_pixels = p_vout->p_sys->p_buffer |
|---|
| 243 | | + 2 * p_vout->p_sys->i_tex_width * |
|---|
| 244 | | (p_vout->p_sys->i_tex_height - p_vout->output.i_height) |
|---|
| 245 | | + 2 * (p_vout->p_sys->i_tex_width - p_vout->output.i_width); |
|---|
| 246 | | p_pic->p->i_lines = p_vout->output.i_height; |
|---|
| 247 | | p_pic->p->i_pitch = p_vout->p_sys->i_tex_width * 4; |
|---|
| 248 | | p_pic->p->i_pixel_pitch = 4; |
|---|
| 249 | | p_pic->p->i_visible_pitch = p_vout->output.i_width * 4; |
|---|
| 250 | | |
|---|
| 251 | | p_pic->i_status = DESTROYED_PICTURE; |
|---|
| 252 | | p_pic->i_type = DIRECT_PICTURE; |
|---|
| 253 | | |
|---|
| 254 | | PP_OUTPUTPICTURE[ 0 ] = p_pic; |
|---|
| 255 | | |
|---|
| | 251 | p_vout->p_picture[0].p->p_pixels = p_vout->p_sys->p_buffer; |
|---|
| | 252 | p_vout->p_picture[0].p->i_lines = p_vout->output.i_height; |
|---|
| | 253 | p_vout->p_picture[0].p->i_pixel_pitch = i_pixel_pitch; |
|---|
| | 254 | p_vout->p_picture[0].p->i_pitch = p_vout->p_sys->i_tex_width * |
|---|
| | 255 | p_vout->p_picture[0].p->i_pixel_pitch; |
|---|
| | 256 | p_vout->p_picture[0].p->i_visible_pitch = p_vout->output.i_width * |
|---|
| | 257 | p_vout->p_picture[0].p->i_pixel_pitch; |
|---|
| | 258 | |
|---|
| | 259 | p_vout->p_picture[0].i_status = DESTROYED_PICTURE; |
|---|
| | 260 | p_vout->p_picture[0].i_type = DIRECT_PICTURE; |
|---|
| | 261 | |
|---|
| | 262 | PP_OUTPUTPICTURE[ 0 ] = &p_vout->p_picture[0]; |
|---|
| 256 | 263 | I_OUTPUTPICTURES = 1; |
|---|
| 257 | 264 | |
|---|
| … | … | |
| 260 | 267 | /* Set the texture parameters */ |
|---|
| 261 | 268 | glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); |
|---|
| 262 | | glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); |
|---|
| | 269 | glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); |
|---|
| 263 | 270 | |
|---|
| 264 | 271 | if( p_vout->p_sys->i_effect ) |
|---|
| 265 | 272 | { |
|---|
| 266 | 273 | glEnable( GL_CULL_FACE); |
|---|
| 267 | | /* glDisable( GL_DEPTH_TEST ); |
|---|
| | 274 | /* glDisable( GL_DEPTH_TEST ); |
|---|
| 268 | 275 | glEnable( GL_BLEND ); |
|---|
| 269 | 276 | glBlendFunc( GL_SRC_ALPHA, GL_ONE );*/ |
|---|
| … | … | |
| 309 | 316 | } |
|---|
| 310 | 317 | |
|---|
| 311 | | |
|---|
| 312 | 318 | /***************************************************************************** |
|---|
| 313 | 319 | * CreateOpenGL: initialize an OpenGL provider |
|---|
| … | … | |
| 330 | 336 | } |
|---|
| 331 | 337 | |
|---|
| 332 | | |
|---|
| 333 | 338 | /***************************************************************************** |
|---|
| 334 | 339 | * DestroyOpenGL: destroys an OpenGL provider |
|---|
| … | … | |
| 363 | 368 | } |
|---|
| 364 | 369 | |
|---|
| 365 | | |
|---|
| 366 | 370 | /***************************************************************************** |
|---|
| 367 | 371 | * SwapBuffers: swap front/back buffers |
|---|
| … | … | |
| 380 | 384 | } |
|---|
| 381 | 385 | } |
|---|
| 382 | | |
|---|
| 383 | 386 | |
|---|
| 384 | 387 | /***************************************************************************** |
|---|
| … | … | |
| 396 | 399 | return i_ret; |
|---|
| 397 | 400 | } |
|---|
| 398 | | |
|---|
| 399 | 401 | |
|---|
| 400 | 402 | /***************************************************************************** |
|---|
| … | … | |
| 420 | 422 | return 0; |
|---|
| 421 | 423 | } |
|---|
| 422 | | |
|---|
| 423 | 424 | |
|---|
| 424 | 425 | static int HandleX11Events( vlc_object_t *p_thread, glx_t *p_glx ) |
|---|
| … | … | |
| 451 | 452 | } |
|---|
| 452 | 453 | |
|---|
| 453 | | |
|---|
| 454 | 454 | /***************************************************************************** |
|---|
| 455 | 455 | * Render: render previously calculated output |
|---|
| … | … | |
| 457 | 457 | static void Render( vout_thread_t *p_vout, picture_t *p_pic ) |
|---|
| 458 | 458 | { |
|---|
| | 459 | vout_sys_t *p_sys = p_vout->p_sys; |
|---|
| | 460 | float f_width = (float)p_vout->output.i_width / p_sys->i_tex_width; |
|---|
| | 461 | float f_height = (float)p_vout->output.i_height / p_sys->i_tex_height; |
|---|
| | 462 | |
|---|
| 459 | 463 | glClear(GL_COLOR_BUFFER_BIT); |
|---|
| 460 | | /*glTexImage2D (GL_TEXTURE_2D, 0, 3, p_vout->output.i_width, |
|---|
| 461 | | p_vout->output.i_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, |
|---|
| 462 | | p_vout->p_sys->p_buffer);*/ |
|---|
| | 464 | |
|---|
| 463 | 465 | glTexImage2D (GL_TEXTURE_2D, 0, 3, p_vout->p_sys->i_tex_width, |
|---|
| 464 | | p_vout->p_sys->i_tex_height , 0, GL_RGBA, GL_UNSIGNED_BYTE, |
|---|
| | 466 | p_vout->p_sys->i_tex_height , 0, |
|---|
| | 467 | VLCGL_RGB_FORMAT, VLCGL_RGB_TYPE, |
|---|
| 465 | 468 | p_vout->p_sys->p_buffer); |
|---|
| 466 | 469 | |
|---|
| 467 | 470 | if( !p_vout->p_sys->i_effect ) |
|---|
| 468 | 471 | { |
|---|
| 469 | | glEnable( GL_TEXTURE_2D); |
|---|
| 470 | | glBegin( GL_POLYGON); |
|---|
| 471 | | glTexCoord2f(0.0,0.0); glVertex2f(-1.0,1.0); |
|---|
| 472 | | glTexCoord2f(1.0,0.0); glVertex2f(1.0,1.0); |
|---|
| 473 | | glTexCoord2f(1.0,1.0); glVertex2f(1.0,-1.0); |
|---|
| 474 | | glTexCoord2f(0.0,1.0); glVertex2f(-1.0,-1.0); |
|---|
| | 472 | glEnable( GL_TEXTURE_2D ); |
|---|
| | 473 | glBegin( GL_POLYGON ); |
|---|
| | 474 | glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, 1.0 ); |
|---|
| | 475 | glTexCoord2f( f_width, 0.0 ); glVertex2f( 1.0, 1.0 ); |
|---|
| | 476 | glTexCoord2f( f_width, f_height ); glVertex2f( 1.0, -1.0 ); |
|---|
| | 477 | glTexCoord2f( 0.0, f_height ); glVertex2f( -1.0, -1.0 ); |
|---|
| 475 | 478 | glEnd(); |
|---|
| 476 | 479 | } |
|---|
| … | … | |
| 479 | 482 | glRotatef( 1.0, 0.3, 0.5, 0.7 ); |
|---|
| 480 | 483 | |
|---|
| 481 | | glEnable( GL_TEXTURE_2D); |
|---|
| | 484 | glEnable( GL_TEXTURE_2D ); |
|---|
| 482 | 485 | glBegin( GL_QUADS ); |
|---|
| 483 | 486 | |
|---|
| 484 | | float f_width = p_vout->output.i_width; |
|---|
| 485 | | float f_height = p_vout->output.i_height; |
|---|
| 486 | | |
|---|
| 487 | | /* Correct the aspect ratio */ |
|---|
| 488 | | /* float f_aspect = (float)p_vout->output.i_aspect / VOUT_ASPECT_FACTOR; |
|---|
| 489 | | if( f_aspect > 1.0 ) |
|---|
| 490 | | { |
|---|
| 491 | | f_height *= f_aspect; |
|---|
| 492 | | } |
|---|
| 493 | | else |
|---|
| 494 | | { |
|---|
| 495 | | f_width *= f_aspect; |
|---|
| 496 | | }*/ |
|---|
| 497 | | |
|---|
| 498 | | float f_offset_x = (1.0 - f_width / p_vout->p_sys->i_tex_width) / 2.0; |
|---|
| 499 | | float f_offset_y = (1.0 - f_height / p_vout->p_sys->i_tex_height) / 2.0; |
|---|
| 500 | | |
|---|
| 501 | 487 | /* Front */ |
|---|
| 502 | | glTexCoord2f( f_offset_x, f_offset_y ); |
|---|
| 503 | | glVertex3f( - 1.0, 1.0, 1.0 ); |
|---|
| 504 | | glTexCoord2f( f_offset_x, 1.0 - f_offset_y ); |
|---|
| 505 | | glVertex3f( - 1.0, - 1.0, 1.0 ); |
|---|
| 506 | | glTexCoord2f( 1.0 - f_offset_x, 1.0 - f_offset_y ); |
|---|
| 507 | | glVertex3f( 1.0, - 1.0, 1.0 ); |
|---|
| 508 | | glTexCoord2f( 1.0 - f_offset_x, f_offset_y ); |
|---|
| 509 | | glVertex3f( 1.0, 1.0, 1.0 ); |
|---|
| | 488 | glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, 1.0 ); |
|---|
| | 489 | glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, 1.0 ); |
|---|
| | 490 | glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, 1.0 ); |
|---|
| | 491 | glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, 1.0 ); |
|---|
| 510 | 492 | |
|---|
| 511 | 493 | /* Left */ |
|---|
| 512 | | glTexCoord2f( f_offset_x, f_offset_y ); |
|---|
| 513 | | glVertex3f( - 1.0, 1.0, - 1.0 ); |
|---|
| 514 | | glTexCoord2f( f_offset_x, 1.0 - f_offset_y ); |
|---|
| 515 | | glVertex3f( - 1.0, - 1.0, - 1.0 ); |
|---|
| 516 | | glTexCoord2f( 1.0 - f_offset_x, 1.0 - f_offset_y ); |
|---|
| 517 | | glVertex3f( - 1.0, - 1.0, 1.0 ); |
|---|
| 518 | | glTexCoord2f( 1.0 - f_offset_x, f_offset_y ); |
|---|
| 519 | | glVertex3f( - 1.0, 1.0, 1.0 ); |
|---|
| | 494 | glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 ); |
|---|
| | 495 | glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 ); |
|---|
| | 496 | glTexCoord2f( f_width, f_height ); glVertex3f( - 1.0, - 1.0, 1.0 ); |
|---|
| | 497 | glTexCoord2f( f_width, 0 ); glVertex3f( - 1.0, 1.0, 1.0 ); |
|---|
| 520 | 498 | |
|---|
| 521 | 499 | /* Back */ |
|---|
| 522 | | glTexCoord2f( f_offset_x, f_offset_y ); |
|---|
| 523 | | glVertex3f( 1.0, 1.0, - 1.0 ); |
|---|
| 524 | | glTexCoord2f( f_offset_x, 1.0 - f_offset_y ); |
|---|
| 525 | | glVertex3f( 1.0, - 1.0, - 1.0 ); |
|---|
| 526 | | glTexCoord2f( 1.0 - f_offset_x, 1.0 - f_offset_y ); |
|---|
| 527 | | glVertex3f( - 1.0, - 1.0, - 1.0 ); |
|---|
| 528 | | glTexCoord2f( 1.0 - f_offset_x, f_offset_y ); |
|---|
| 529 | | glVertex3f( - 1.0, 1.0, - 1.0 ); |
|---|
| | 500 | glTexCoord2f( 0, 0 ); glVertex3f( 1.0, 1.0, - 1.0 ); |
|---|
| | 501 | glTexCoord2f( 0, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 ); |
|---|
| | 502 | glTexCoord2f( f_width, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 ); |
|---|
| | 503 | glTexCoord2f( f_width, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 ); |
|---|
| 530 | 504 | |
|---|
| 531 | 505 | /* Right */ |
|---|
| 532 | | glTexCoord2f( f_offset_x, f_offset_y ); |
|---|
| 533 | | glVertex3f( 1.0, 1.0, 1.0 ); |
|---|
| 534 | | glTexCoord2f( f_offset_x, 1.0 - f_offset_y ); |
|---|
| 535 | | glVertex3f( 1.0, - 1.0, 1.0 ); |
|---|
| 536 | | glTexCoord2f( 1.0 - f_offset_x, 1.0 - f_offset_y ); |
|---|
| 537 | | glVertex3f( 1.0, - 1.0, - 1.0 ); |
|---|
| 538 | | glTexCoord2f( 1.0 - f_offset_x, f_offset_y ); |
|---|
| 539 | | glVertex3f( 1.0, 1.0, - 1.0 ); |
|---|
| | 506 | glTexCoord2f( 0, 0 ); glVertex3f( 1.0, 1.0, 1.0 ); |
|---|
| | 507 | glTexCoord2f( 0, f_height ); glVertex3f( 1.0, - 1.0, 1.0 ); |
|---|
| | 508 | glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 ); |
|---|
| | 509 | glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, - 1.0 ); |
|---|
| 540 | 510 | |
|---|
| 541 | 511 | /* Top */ |
|---|
| 542 | | glTexCoord2f( f_offset_x, f_offset_y ); |
|---|
| 543 | | glVertex3f( - 1.0, 1.0, - 1.0 ); |
|---|
| 544 | | glTexCoord2f( f_offset_x, 1.0 - f_offset_y ); |
|---|
| 545 | | glVertex3f( - 1.0, 1.0, 1.0 ); |
|---|
| 546 | | glTexCoord2f( 1.0 - f_offset_x, 1.0 - f_offset_y ); |
|---|
| 547 | | glVertex3f( 1.0, 1.0, 1.0 ); |
|---|
| 548 | | glTexCoord2f( 1.0 - f_offset_x, f_offset_y ); |
|---|
| 549 | | glVertex3f( 1.0, 1.0, - 1.0 ); |
|---|
| | 512 | glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, 1.0, - 1.0 ); |
|---|
| | 513 | glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, 1.0, 1.0 ); |
|---|
| | 514 | glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, 1.0, 1.0 ); |
|---|
| | 515 | glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, 1.0, - 1.0 ); |
|---|
| 550 | 516 | |
|---|
| 551 | 517 | /* Bottom */ |
|---|
| 552 | | glTexCoord2f( f_offset_x, f_offset_y ); |
|---|
| 553 | | glVertex3f( - 1.0, - 1.0, 1.0 ); |
|---|
| 554 | | glTexCoord2f( f_offset_x, 1.0 - f_offset_y ); |
|---|
| 555 | | glVertex3f( - 1.0, - 1.0, - 1.0 ); |
|---|
| 556 | | glTexCoord2f( 1.0 - f_offset_x, 1.0 - f_offset_y ); |
|---|
| 557 | | glVertex3f( 1.0, - 1.0, - 1.0 ); |
|---|
| 558 | | glTexCoord2f( 1.0 - f_offset_x, f_offset_y ); |
|---|
| 559 | | glVertex3f( 1.0, - 1.0, 1.0 ); |
|---|
| | 518 | glTexCoord2f( 0, 0 ); glVertex3f( - 1.0, - 1.0, 1.0 ); |
|---|
| | 519 | glTexCoord2f( 0, f_height ); glVertex3f( - 1.0, - 1.0, - 1.0 ); |
|---|
| | 520 | glTexCoord2f( f_width, f_height ); glVertex3f( 1.0, - 1.0, - 1.0 ); |
|---|
| | 521 | glTexCoord2f( f_width, 0 ); glVertex3f( 1.0, - 1.0, 1.0 ); |
|---|
| 560 | 522 | glEnd(); |
|---|
| 561 | 523 | } |
|---|
| | 524 | |
|---|
| 562 | 525 | glDisable( GL_TEXTURE_2D); |
|---|
| 563 | 526 | } |
|---|
| 564 | | |
|---|
| 565 | 527 | |
|---|
| 566 | 528 | /***************************************************************************** |
|---|
| … | … | |
| 580 | 542 | } |
|---|
| 581 | 543 | } |
|---|
| 582 | | |
|---|
| 583 | 544 | |
|---|
| 584 | 545 | /***************************************************************************** |
|---|
| … | … | |
| 673 | 634 | } |
|---|
| 674 | 635 | |
|---|
| 675 | | |
|---|
| 676 | 636 | int InitGLX12( vlc_object_t *p_thread, glx_t *p_glx ) |
|---|
| 677 | 637 | { |
|---|
| … | … | |
| 707 | 667 | return 0; |
|---|
| 708 | 668 | } |
|---|
| 709 | | |
|---|
| 710 | 669 | |
|---|
| 711 | 670 | int InitGLX13( vlc_object_t *p_thread, glx_t *p_glx ) |
|---|
| … | … | |
| 770 | 729 | return 0; |
|---|
| 771 | 730 | } |
|---|
| 772 | | |
|---|
| 773 | 731 | |
|---|
| 774 | 732 | void CreateWindow( vlc_object_t *p_thread, glx_t *p_glx, XVisualInfo *p_vi ) |
|---|
| … | … | |
| 825 | 783 | } |
|---|
| 826 | 784 | |
|---|
| 827 | | |
|---|
| 828 | 785 | void SwitchContext( glx_t *p_glx ) |
|---|
| 829 | 786 | { |
|---|
| … | … | |
| 840 | 797 | } |
|---|
| 841 | 798 | } |
|---|
| 842 | | |
|---|
| 843 | 799 | |
|---|
| 844 | 800 | int GetAlignedSize( int i_size ) |
|---|