Search
lxdream.org :: lxdream/src/drivers/gl_glx.c
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/gl_glx.c
changeset 94:8d80d9c7cc7d
next96:3ec45b6525ba
author nkeynes
date Sun Feb 05 04:05:27 2006 +0000 (13 years ago)
permissions -rw-r--r--
last change Video code reshuffle to start getting real video happening.
Implement colourspace conversions
Various tweaks
file annotate diff log raw
nkeynes@94
     1
/**
nkeynes@94
     2
 * $Id: gl_glx.c,v 1.1 2006-02-05 04:05:27 nkeynes Exp $
nkeynes@94
     3
 *
nkeynes@94
     4
 * GLX framebuffer support. Note depends on an X11 video driver 
nkeynes@94
     5
 * (ie video_gtk) to maintain the X11 side of things.
nkeynes@94
     6
 *
nkeynes@94
     7
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@94
     8
 *
nkeynes@94
     9
 * This program is free software; you can redistribute it and/or modify
nkeynes@94
    10
 * it under the terms of the GNU General Public License as published by
nkeynes@94
    11
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@94
    12
 * (at your option) any later version.
nkeynes@94
    13
 *
nkeynes@94
    14
 * This program is distributed in the hope that it will be useful,
nkeynes@94
    15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@94
    16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@94
    17
 * GNU General Public License for more details.
nkeynes@94
    18
 */
nkeynes@94
    19
nkeynes@94
    20
#include "dream.h"
nkeynes@94
    21
#include <X11/Xlib.h>
nkeynes@94
    22
#include <GL/glx.h>
nkeynes@94
    23
#include "video.h"
nkeynes@94
    24
#include "drivers/video_x11.h"
nkeynes@94
    25
nkeynes@94
    26
gboolean gl_glx_init( )
nkeynes@94
    27
{
nkeynes@94
    28
    int major, minor;
nkeynes@94
    29
    const char *glxExts, *glxServer;
nkeynes@94
    30
    int screen = XScreenNumberOfScreen(video_x11_screen);
nkeynes@94
    31
nkeynes@94
    32
    if( glXQueryVersion( video_x11_display, &major, &minor ) == False ) {
nkeynes@94
    33
	ERROR( "X Display lacks the GLX nature" );
nkeynes@94
    34
	return FALSE;
nkeynes@94
    35
    }
nkeynes@94
    36
    if( major < 1 || minor < 1 ) {
nkeynes@94
    37
	ERROR( "GLX version %d.%d is not supported", major, minor );
nkeynes@94
    38
	return FALSE;
nkeynes@94
    39
    }
nkeynes@94
    40
nkeynes@94
    41
    glxExts = glXQueryExtensionsString( video_x11_display, screen );
nkeynes@94
    42
    glxServer = glXQueryServerString( video_x11_display, screen, GLX_VENDOR );
nkeynes@94
    43
    INFO( "GLX version %d.%d, %s. Supported exts: %s", major, minor,
nkeynes@94
    44
	  glxServer, glxExts );
nkeynes@94
    45
}
nkeynes@94
    46
nkeynes@94
    47
gboolean gl_glx_start_frame( uint32_t width, uint32_t height,
nkeynes@94
    48
			     int colour_format )
nkeynes@94
    49
{
nkeynes@94
    50
    return FALSE;
nkeynes@94
    51
}
nkeynes@94
    52
nkeynes@94
    53
gboolean gl_glx_swap_frame( )
nkeynes@94
    54
{
nkeynes@94
    55
    return FALSE;
nkeynes@94
    56
}
.