root/trunk/libs/opengl/api/opengl/Helper.hx

Revision 1036, 1.5 kB (checked in by dan, 2 years ago)

code cleanup: replace space indents by tabs, consistent copyright header.

Line 
1 /*  Copyright (c) the Xinf contributors.
2         see http://xinf.org/copyright for license. */
3
4 package opengl;
5
6 /**
7         OpenGL helpers and workarounds.
8 **/
9 class Helper {
10
11         public static function getBools( pname:Int, interest:Int ) :Array<Bool> {
12                 return untyped _getBool( pname, interest );
13         }
14         public static function getBool( pname:Int ) :Bool {
15                 return untyped _getBool( pname, 1 );
16         }
17
18         public static function getInts( pname:Int, interest:Int ) :Dynamic {
19                 return ( _getInt( pname, interest ) );
20         }
21         public static function getInt( pname:Int ) :Int {
22                 return untyped _getInt( pname, 1 );
23         }
24
25         public static function getFloats( pname:Int, interest:Int ) :Dynamic {
26                 return ( _getFloat( pname, interest ) );
27         }
28         public static function getFloat( pname:Int ) :Float {
29                 return untyped _getFloat( pname, 1 );
30         }
31
32         public static function getDoubles( pname:Int, interest:Int ) :Dynamic {
33                 return ( _getDouble( pname, interest ) );
34         }
35         public static function getDouble( pname:Int ) :Float {
36                 return untyped _getDouble( pname, 1 );
37         }
38
39         private static var _getBool;
40         private static var _getInt;
41         private static var _getFloat;
42         private static var _getDouble;
43        
44         public static function __init__() : Void {
45                 DLLLoader.addLibToPath("opengl");
46
47                 _getBool = neko.Lib.load("opengl","opengl_get_bool", 2 );
48                 _getInt = neko.Lib.load("opengl","opengl_get_int", 2 );
49                 _getFloat = neko.Lib.load("opengl","opengl_get_float", 2 );
50                 _getDouble = neko.Lib.load("opengl","opengl_get_double", 2 );
51
52         }
53 }
Note: See TracBrowser for help on using the browser.