Search
lxdream.org :: lxdream/src/pvr2/glutil.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/glutil.h
changeset 1140:7dc1c71ece76
prev1134:f502f3d32f90
next1150:1038800cecd8
author nkeynes
date Tue Oct 26 08:39:02 2010 +1000 (10 years ago)
permissions -rw-r--r--
last change Implement fragment shader to support palette textures 'directly', and
therefore avoid having to reload all palette textures whenever the palette
changes.
file annotate diff log raw
nkeynes@635
     1
/**
nkeynes@636
     2
 * $Id$
nkeynes@635
     3
 *
nkeynes@635
     4
 * GL-based support functions 
nkeynes@635
     5
 *
nkeynes@635
     6
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@635
     7
 *
nkeynes@635
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@635
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@635
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@635
    11
 * (at your option) any later version.
nkeynes@635
    12
 *
nkeynes@635
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@635
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@635
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@635
    16
 * GNU General Public License for more details.
nkeynes@635
    17
 */
nkeynes@635
    18
nkeynes@635
    19
#ifndef lxdream_glutil_H
nkeynes@635
    20
#define lxdream_glutil_H
nkeynes@635
    21
nkeynes@687
    22
#include <stdio.h>
nkeynes@635
    23
#include "display.h"
nkeynes@1130
    24
#include "pvr2/shaders.h"
nkeynes@635
    25
nkeynes@736
    26
#ifdef __cplusplus
nkeynes@736
    27
extern "C" {
nkeynes@736
    28
#endif
nkeynes@736
    29
nkeynes@635
    30
/**
nkeynes@635
    31
 * Test if a specific extension is supported. From opengl.org
nkeynes@635
    32
 * @param extension extension name to check for
nkeynes@635
    33
 * @return TRUE if supported, otherwise FALSE.
nkeynes@635
    34
 */
nkeynes@635
    35
gboolean isGLExtensionSupported( const char *extension );
nkeynes@635
    36
nkeynes@667
    37
/**
nkeynes@687
    38
 * Dump GL information to the output stream, usually for debugging purposes
nkeynes@687
    39
 */
nkeynes@687
    40
void glPrintInfo( FILE *out );
nkeynes@687
    41
nkeynes@687
    42
/**
nkeynes@667
    43
 * Test if secondary color (GL_COLOR_SUM) is supported.
nkeynes@667
    44
 */
nkeynes@667
    45
gboolean isGLSecondaryColorSupported();
nkeynes@667
    46
nkeynes@667
    47
gboolean isGLVertexBufferSupported();
nkeynes@1134
    48
gboolean isGLVertexRangeSupported();
nkeynes@667
    49
gboolean isGLPixelBufferSupported();
nkeynes@1140
    50
gboolean isGLMultitextureSupported();
nkeynes@667
    51
gboolean isGLMirroredTextureSupported();
nkeynes@635
    52
nkeynes@635
    53
/****** Shader handling (gl_sl.c) *****/
nkeynes@635
    54
gboolean glsl_is_supported(void);
nkeynes@1134
    55
const char *glsl_get_version(void);
nkeynes@1130
    56
gboolean glsl_load_shaders( );
nkeynes@635
    57
void glsl_unload_shaders(void);
nkeynes@1130
    58
gboolean glsl_set_shader( unsigned program_id );
nkeynes@1130
    59
void glsl_clear_shader();
nkeynes@1140
    60
GLint glsl_get_uniform_location( unsigned program, const char *name );
nkeynes@1140
    61
void glsl_set_uniform_int( unsigned program, const char *name, GLint value );
nkeynes@635
    62
nkeynes@1134
    63
/* Convenience formatting function for driver use */
nkeynes@1134
    64
void fprint_extensions( FILE *out, const char *extensions );
nkeynes@1134
    65
nkeynes@736
    66
#ifdef __cplusplus
nkeynes@736
    67
}
nkeynes@736
    68
#endif
nkeynes@736
    69
nkeynes@635
    70
#endif /* !lxdream_glutil_H */
.