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 429:e581b90c3fb3
prev405:570d93abb5b7
next443:1163eb5c0590
author nkeynes
date Tue Oct 09 08:12:29 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
nkeynes@352
     1
/**
nkeynes@429
     2
 * $Id: gl_common.h,v 1.3 2007-10-08 11:49:35 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@352
    34
 * Generic GL routine to draw the given frame buffer in the display view.
nkeynes@352
    35
 */
nkeynes@352
    36
gboolean gl_display_frame_buffer( frame_buffer_t frame );
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@352
    43
nkeynes@352
    44
/**
nkeynes@352
    45
 * Generic GL read_render_buffer. This function assumes that the caller
nkeynes@352
    46
 * has already set the appropriate glReadBuffer(); in other words, unless
nkeynes@352
    47
 * there's only one buffer this needs to be wrapped.
nkeynes@352
    48
 */
nkeynes@429
    49
gboolean gl_read_render_buffer( render_buffer_t buffer, unsigned char *target );
nkeynes@352
    50
nkeynes@352
    51
nkeynes@352
    52
/****** FBO handling (gl_fbo.c) ******/
nkeynes@352
    53
gboolean gl_fbo_is_supported();
nkeynes@352
    54
void gl_fbo_shutdown();
nkeynes@352
    55
void gl_fbo_init( display_driver_t driver );
nkeynes@352
    56
nkeynes@405
    57
/****** Shader handling (gl_sl.c) *****/
nkeynes@405
    58
gboolean glsl_is_supported(void);
nkeynes@405
    59
gboolean glsl_load_shaders( const char *vert_shader, const char *frag_shader );
nkeynes@405
    60
void glsl_unload_shaders(void);
nkeynes@405
    61
nkeynes@405
    62
extern const char *glsl_vertex_shader_src;
nkeynes@405
    63
extern const char *glsl_fragment_shader_src;
nkeynes@405
    64
nkeynes@352
    65
#endif /* !video_gl_common_H */
.