Search
lxdream.org :: lxdream/src/drivers/gl_common.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/gl_common.h
changeset 545:fdcdcd8b9fd1
prev477:9a373f2ff009
next561:533f6b478071
author nkeynes
date Thu Nov 29 09:28:28 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Refactor GLX support and implement pbuffer rendering support
file annotate diff log raw
nkeynes@352
     1
/**
nkeynes@477
     2
 * $Id: gl_common.h,v 1.5 2007-10-31 09:10:23 nkeynes Exp $
nkeynes@352
     3
 *
nkeynes@352
     4
 * Parent for all X11 display drivers.
nkeynes@352
     5
 *
nkeynes@352
     6
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@352
     7
 *
nkeynes@352
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@352
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@352
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@352
    11
 * (at your option) any later version.
nkeynes@352
    12
 *
nkeynes@352
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@352
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@352
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@352
    16
 * GNU General Public License for more details.
nkeynes@352
    17
 */
nkeynes@352
    18
nkeynes@352
    19
#ifndef video_gl_common_H
nkeynes@352
    20
#define video_gl_common_H
nkeynes@352
    21
nkeynes@352
    22
#include "display.h"
nkeynes@352
    23
nkeynes@352
    24
/**
nkeynes@352
    25
 * Test if a specific extension is supported. From opengl.org
nkeynes@352
    26
 * @param extension extension name to check for
nkeynes@352
    27
 * @return TRUE if supported, otherwise FALSE.
nkeynes@352
    28
 */
nkeynes@352
    29
gboolean isGLExtensionSupported( const char *extension );
nkeynes@352
    30
nkeynes@352
    31
gboolean hasRequiredGLExtensions();
nkeynes@352
    32
nkeynes@352
    33
/**
nkeynes@545
    34
 * Generic GL routine to draw the given frame buffer into a texture
nkeynes@352
    35
 */
nkeynes@545
    36
gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id );
nkeynes@352
    37
nkeynes@352
    38
/**
nkeynes@352
    39
 * Generic GL routine to blank the display view with the specified colour.
nkeynes@352
    40
 */
nkeynes@352
    41
gboolean gl_display_blank( uint32_t colour );
nkeynes@352
    42
nkeynes@443
    43
/**
nkeynes@443
    44
 * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
nkeynes@443
    45
 */
nkeynes@477
    46
void gl_display_render_buffer( render_buffer_t buffer );
nkeynes@443
    47
nkeynes@443
    48
/**
nkeynes@545
    49
 * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
nkeynes@545
    50
 */
nkeynes@545
    51
void gl_texture_window( int width, int height, int tex_id, gboolean inverted );
nkeynes@545
    52
nkeynes@545
    53
/**
nkeynes@443
    54
 * Redisplay the last frame.
nkeynes@443
    55
 */
nkeynes@443
    56
void gl_redisplay_last();
nkeynes@352
    57
nkeynes@352
    58
/**
nkeynes@352
    59
 * Generic GL read_render_buffer. This function assumes that the caller
nkeynes@352
    60
 * has already set the appropriate glReadBuffer(); in other words, unless
nkeynes@352
    61
 * there's only one buffer this needs to be wrapped.
nkeynes@352
    62
 */
nkeynes@477
    63
gboolean gl_read_render_buffer( unsigned char *target, render_buffer_t buffer, 
nkeynes@477
    64
				int rowstride, int colour_format );
nkeynes@352
    65
nkeynes@352
    66
nkeynes@352
    67
/****** FBO handling (gl_fbo.c) ******/
nkeynes@352
    68
gboolean gl_fbo_is_supported();
nkeynes@352
    69
void gl_fbo_shutdown();
nkeynes@352
    70
void gl_fbo_init( display_driver_t driver );
nkeynes@477
    71
void gl_fbo_detach();
nkeynes@352
    72
nkeynes@405
    73
/****** Shader handling (gl_sl.c) *****/
nkeynes@405
    74
gboolean glsl_is_supported(void);
nkeynes@405
    75
gboolean glsl_load_shaders( const char *vert_shader, const char *frag_shader );
nkeynes@405
    76
void glsl_unload_shaders(void);
nkeynes@405
    77
nkeynes@405
    78
extern const char *glsl_vertex_shader_src;
nkeynes@405
    79
extern const char *glsl_fragment_shader_src;
nkeynes@405
    80
nkeynes@352
    81
#endif /* !video_gl_common_H */
.