View Full Version : openGL extensions
Petr, I know you want things to run on older computers, but I am seeing some really cool stuff that use GLextensions.
Attached is a small demo using extensions. I compiled the program in Aurora using Sapero's examples. This sample was written by Kevin Harris in c++ originally.
Use the mouse to rotate while it dazzles.
Any plans to include extensions for opengl?
Petr Schreiber
05-06-2007, 17:52
Thanks kryton,
I know extensions are great, I am also playing some experiments with them.
Especially multitexturing is perfect stuff. I will think how to introduce it to TBGL ;)
The sample seems to need GLAUX.DLL, could you attach it please ? :)
Bye,
Petr
I am glad you are looking into them Petr. Thanks for letting me know about the missing dll. Of course it ran here and I didn't know about it othewise.
It is attached, I found it in my Windows\System32 folder, so you know where to put it. I guess it could also go in the demo programs folder too.
Petr Schreiber
05-06-2007, 22:14
Hi Kent,
thanks! ;)
We can do the same with thinBASIC even now, but point sprites are probably much better optimized.
Only possible disadvantage they have is that when center of sprite is outside of screen ( just by one pixel, even if particle is big as ... house for example :) so should be partially visible ) it is skipped from rendering, which can disturb eye of some graphics maniac. But most of people didn't realize it ( especially when you do not expect it ).
Thanks for the demo, I like it very much!
Bye,
Petr
It reminded me of your new explosion that is why I posted it. The same idea, but part of opengl with the extension then.
I am going to start on converting some of the headers. This way we can use them as they are in thinBasic. Maybe by playing with them then it will be easier to make your tbgl commands for them when needed to simplify.
I want to learn how to do conversions like that. Parker at the Aurora forums gave me some instructions and I have been studying your conversions compared to the opengl c headers, but still confused but will try to do them anyways to learn. No other way probably to really learn it.
you already have gl.h and glu.h converted.
Have you started on any of the following?
Which one should I start on?
Do we need any others or any we don't really need?
http://www.opengl.org/wiki/index.php/Related_toolkits_and_APIs
GLEW
SDL
DevIL
It is really confusing trying to figure what to work on. Hopefully the link above will give you some ideas and then you can pass that knowledge onto me.
In the meantime I am going to try to make a table of conversions and then maybe work on a script to do bulk of the work. When the time comes.
I started to convert glaux.h.
I marked all the areas where I have questions about to convert with:
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Towards the end, the same sort of situations came up, so I didn't keep marking them. Once I see how the others are converted I can do those then.
Thanks for any help!!
'/*++ BUILD Version: 0004 // Increment this if a change has global effects
'Copyright (c) 1985-95, Microsoft Corporation
'Module Name:
' glaux.h
'Abstract:
' Procedure declarations, constant definitions and macros for the OpenGL
' Auxiliary Library.
'--*/
'#ifndef __GLAUX_H__
'%__GLAUX_H__
'/*
' * (c) Copyright 1993, Silicon Graphics, Inc.
' * ALL RIGHTS RESERVED
' * Permission to use, copy, modify, and distribute this software for
' * any purpose and without fee is hereby granted, provided that the above
' * copyright notice appear in all copies and that both the copyright notice
' * and this permission notice appear in supporting documentation, and that
' * the name of Silicon Graphics, Inc. not be used in advertising
' * or publicity pertaining to distribution of the software without specific,
' * written prior permission.
' *
' * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
' * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
' * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
' * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
' * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
' * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
' * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
' * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
' * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
' * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
' * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
' * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
' *
' * US Government Users Restricted Rights
' * Use, duplication, or disclosure by the Government is subject to
' * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
' * (c)(1)(ii) of the Rights in Technical Data and Computer Software
' * clause at DFARS 252.227-7013 and/or in similar or successor
' * clauses in the FAR or the DOD or NASA FAR Supplement.
' * Unpublished-- rights reserved under the copyright laws of the
' * United States. Contractor/manufacturer is Silicon Graphics,
' * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
' *
' * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
' */
'#include <windows.h>
'#include <GL/gl.h>
'#include <GL/glu.h>
'#ifdef __cplusplus
'extern "C" {
'#endif
'/*
'** ToolKit Window Types
'** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
'*/
%AUX_RGB = 0
%AUX_RGBA = AUX_RGB
%AUX_INDEX = 1
%AUX_SINGLE = 0
%AUX_DOUBLE = 2
%AUX_DIRECT = 0
%AUX_INDIRECT = 4
%AUX_ACCUM = 8
%AUX_ALPHA = 16
%AUX_DEPTH24 = 32 '/* 24-bit depth buffer */
%AUX_STENCIL = 64
%AUX_AUX = 128
%AUX_DEPTH16 = 256 '/* 16-bit depth buffer */
%AUX_FIXED_332_PAL = 512
%AUX_DEPTH = AUX_DEPTH16 '/* default is 16-bit depth buffer */
'/*
'** Window Masks
'*/
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Have no clue how to convert this part <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'%AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
'%AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
'%AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
'%AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
'%AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
'%AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
'%AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
'%AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
'%AUX_WIND_HAS_DEPTH(x) (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
'%AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
'%AUX_WIND_USES_FIXED_332_PAL(x) (((x) & AUX_FIXED_332_PAL) != 0)
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'/*
'** ToolKit Event Structure
'*/
TYPE _AUX_EVENTREC
GLint event
GLint data[4]
END TYPE
'/*
'** ToolKit Event Types
'*/
%AUX_EXPOSE = 1
%AUX_CONFIG = 2
%AUX_DRAW = 4
%AUX_KEYEVENT = 8
%AUX_MOUSEDOWN = 16
%AUX_MOUSEUP = 32
%AUX_MOUSELOC = 64
'/*
'** Toolkit Event Data Indices
'*/
%AUX_WINDOWX = 0
%AUX_WINDOWY = 1
%AUX_MOUSEX = 0
%AUX_MOUSEY = 1
%AUX_MOUSESTATUS = 3
%AUX_KEY = 0
%AUX_KEYSTATUS = 1
'/*
'** ToolKit Event Status Messages
'*/
%AUX_LEFTBUTTON = 1
%AUX_RIGHTBUTTON = 2
%AUX_MIDDLEBUTTON = 4
%AUX_SHIFT = 1
%AUX_CONTROL = 2
'/*
'** ToolKit Key Codes
'*/
%AUX_RETURN = &H0D
%AUX_ESCAPE = &H1B
%AUX_SPACE = &H20
%AUX_LEFT = &H25
%AUX_UP = &H26
%AUX_RIGHT = &H27
%AUX_DOWN = &H28
%AUX_A = "A" ' does this sort of assignment work <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
%AUX_B = "B"
%AUX_C = "C"
%AUX_D = "D"
%AUX_E = "E"
%AUX_F = "F"
%AUX_G = "G"
%AUX_H = "H"
%AUX_I = "I"
%AUX_J = "J"
%AUX_K = "K"
%AUX_L = "L"
%AUX_M = "M"
%AUX_N = "N"
%AUX_O = "O"
%AUX_P = "P"
%AUX_Q = "Q"
%AUX_R = "R"
%AUX_S = "S"
%AUX_T = "T"
%AUX_U = "U"
%AUX_V = "V"
%AUX_W = "W"
%AUX_X = "X"
%AUX_Y = "Y"
%AUX_Z = "Z"
%AUX_a = "a"
%AUX_b = "b"
%AUX_c = "c"
%AUX_d = "d"
%AUX_e = "e"
%AUX_f = "f"
%AUX_g = "g"
%AUX_h = "h"
%AUX_i = "i"
%AUX_j = "j"
%AUX_k = "k"
%AUX_l = "l"
%AUX_m = "m"
%AUX_n = "n"
%AUX_o = "o"
%AUX_p = "p"
%AUX_q = "q"
%AUX_r = "r"
%AUX_s = "s"
%AUX_t = "t"
%AUX_u = "u"
%AUX_v = "v"
%AUX_w = "w"
%AUX_x = "x"
%AUX_y = "y"
%AUX_z = "z"
%AUX_0 = "0"
%AUX_1 = "1"
%AUX_2 = "2"
%AUX_3 = "3"
%AUX_4 = "4"
%AUX_5 = "5"
%AUX_6 = "6"
%AUX_7 = "7"
%AUX_8 = "8"
%AUX_9 = "9"
'/*
'** ToolKit Gets and Sets
'*/
%AUX_FD = 1 '/* return fd (long) */
%AUX_COLORMAP = 3 '/* pass buf of r, g and b (unsigned char) */
%AUX_GREYSCALEMAP = 4
%AUX_FOGMAP = 5 '/* pass fog and color bits (long) */
%AUX_ONECOLOR = 6 '/* pass index, r, g, and b (long) */
'/*
'** Color Macros
'*/
%AUX_BLACK = 0
%AUX_RED = 13
%AUX_GREEN = 14
%AUX_YELLOW = 15
%AUX_BLUE = 16
%AUX_MAGENTA = 17
%AUX_CYAN = 18
%AUX_WHITE = 19
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'extern float auxRGBMap[20][3];
'%AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
' glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'/*
'** RGB Image Structure
'*/
TYPE _AUX_RGBImageRec
GLint sizeX, sizeY
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'unsigned char *data
END TYPE
'/*
'** Prototypes
'*/
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'void APIENTRY auxInitDisplayMode(GLenum);
'void APIENTRY auxInitPosition(int, int, int, int);
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'/* GLenum APIENTRY auxInitWindow(LPCTSTR); */
#ifdef UNICODE
%auxInitWindow auxInitWindowW
#else
%auxInitWindow auxInitWindowA
#endif
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'GLenum APIENTRY auxInitWindowA(LPCSTR);
'GLenum APIENTRY auxInitWindowW(LPCWSTR);
'void APIENTRY auxCloseWindow(void);
'void APIENTRY auxQuit(void);
'void APIENTRY auxSwapBuffers(void);
'typedef void (CALLBACK* AUXMAINPROC)(void);
'void APIENTRY auxMainLoop(AUXMAINPROC);
'typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
'void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
'typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
'void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
'typedef void (CALLBACK* AUXIDLEPROC)(void);
'void APIENTRY auxIdleFunc(AUXIDLEPROC);
'typedef void (CALLBACK* AUXKEYPROC)(void);
'void APIENTRY auxKeyFunc(int, AUXKEYPROC);
'typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
'void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
'int APIENTRY auxGetColorMapSize(void);
'void APIENTRY auxGetMouseLoc(int *, int *);
'void APIENTRY auxSetOneColor(int, float, float, float);
'void APIENTRY auxSetFogRamp(int, int);
'void APIENTRY auxSetGreyRamp(void);
'void APIENTRY auxSetRGBMap(int, float *);
'<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'/* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
#ifdef UNICODE
%auxRGBImageLoad auxRGBImageLoadW
#else
%auxRGBImageLoad auxRGBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
#ifdef UNICODE
%auxDIBImageLoad auxDIBImageLoadW
#else
%auxDIBImageLoad auxDIBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
void APIENTRY auxCreateFont(void);
'/* void APIENTRY auxDrawStr(LPCTSTR); */
#ifdef UNICODE
%auxDrawStr auxDrawStrW
#else
%auxDrawStr auxDrawStrA
#endif
void APIENTRY auxDrawStrA(LPCSTR);
void APIENTRY auxDrawStrW(LPCWSTR);
void APIENTRY auxWireSphere(GLdouble);
void APIENTRY auxSolidSphere(GLdouble);
void APIENTRY auxWireCube(GLdouble);
void APIENTRY auxSolidCube(GLdouble);
void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxWireTorus(GLdouble, GLdouble);
void APIENTRY auxSolidTorus(GLdouble, GLdouble);
void APIENTRY auxWireCylinder(GLdouble, GLdouble);
void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
void APIENTRY auxWireIcosahedron(GLdouble);
void APIENTRY auxSolidIcosahedron(GLdouble);
void APIENTRY auxWireOctahedron(GLdouble);
void APIENTRY auxSolidOctahedron(GLdouble);
void APIENTRY auxWireTetrahedron(GLdouble);
void APIENTRY auxSolidTetrahedron(GLdouble);
void APIENTRY auxWireDodecahedron(GLdouble);
void APIENTRY auxSolidDodecahedron(GLdouble);
void APIENTRY auxWireCone(GLdouble, GLdouble);
void APIENTRY auxSolidCone(GLdouble, GLdouble);
void APIENTRY auxWireTeapot(GLdouble);
void APIENTRY auxSolidTeapot(GLdouble);
'/*
'** Window specific functions
'** hwnd, hdc, and hglrc valid after auxInitWindow()
'*/
HWND APIENTRY auxGetHWND(void);
HDC APIENTRY auxGetHDC(void);
HGLRC APIENTRY auxGetHGLRC(void);
'/*
'** Viewperf support functions and constants
'*/
'/* Display Mode Selection Criteria */
'enum {
%AUX_USE_ID = 1
%AUX_EXACT_MATCH = 2
%AUX_MINIMUM_CRITERIA = 3
'};
void APIENTRY auxInitDisplayModePolicy(GLenum);
GLenum APIENTRY auxInitDisplayModeID(GLint);
GLenum APIENTRY auxGetDisplayModePolicy(void);
GLint APIENTRY auxGetDisplayModeID(void);
GLenum APIENTRY auxGetDisplayMode(void);
'#ifdef __cplusplus
'}
'#endif
'#endif /* __GLAUX_H__ */
Here is the original so you can see if I messed up anything already with what I thought was correct. Nothing like having a clean copy to look at :) Thanks for any help!!
/*++ BUILD Version: 0004 // Increment this if a change has global effects
Copyright (c) 1985-95, Microsoft Corporation
Module Name:
glaux.h
Abstract:
Procedure declarations, constant definitions and macros for the OpenGL
Auxiliary Library.
--*/
#ifndef __GLAUX_H__
#define __GLAUX_H__
/*
* (c) Copyright 1993, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
* clause at DFARS 252.227-7013 and/or in similar or successor
* clauses in the FAR or the DOD or NASA FAR Supplement.
* Unpublished-- rights reserved under the copyright laws of the
* United States. Contractor/manufacturer is Silicon Graphics,
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
*
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
** ToolKit Window Types
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
*/
#define AUX_RGB 0
#define AUX_RGBA AUX_RGB
#define AUX_INDEX 1
#define AUX_SINGLE 0
#define AUX_DOUBLE 2
#define AUX_DIRECT 0
#define AUX_INDIRECT 4
#define AUX_ACCUM 8
#define AUX_ALPHA 16
#define AUX_DEPTH24 32 /* 24-bit depth buffer */
#define AUX_STENCIL 64
#define AUX_AUX 128
#define AUX_DEPTH16 256 /* 16-bit depth buffer */
#define AUX_FIXED_332_PAL 512
#define AUX_DEPTH AUX_DEPTH16 /* default is 16-bit depth buffer */
/*
** Window Masks
*/
#define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
#define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
#define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
#define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
#define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
#define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
#define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
#define AUX_WIND_HAS_DEPTH(x) (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
#define AUX_WIND_USES_FIXED_332_PAL(x) (((x) & AUX_FIXED_332_PAL) != 0)
/*
** ToolKit Event Structure
*/
typedef struct _AUX_EVENTREC {
GLint event;
GLint data[4];
} AUX_EVENTREC;
/*
** ToolKit Event Types
*/
#define AUX_EXPOSE 1
#define AUX_CONFIG 2
#define AUX_DRAW 4
#define AUX_KEYEVENT 8
#define AUX_MOUSEDOWN 16
#define AUX_MOUSEUP 32
#define AUX_MOUSELOC 64
/*
** Toolkit Event Data Indices
*/
#define AUX_WINDOWX 0
#define AUX_WINDOWY 1
#define AUX_MOUSEX 0
#define AUX_MOUSEY 1
#define AUX_MOUSESTATUS 3
#define AUX_KEY 0
#define AUX_KEYSTATUS 1
/*
** ToolKit Event Status Messages
*/
#define AUX_LEFTBUTTON 1
#define AUX_RIGHTBUTTON 2
#define AUX_MIDDLEBUTTON 4
#define AUX_SHIFT 1
#define AUX_CONTROL 2
/*
** ToolKit Key Codes
*/
#define AUX_RETURN 0x0D
#define AUX_ESCAPE 0x1B
#define AUX_SPACE 0x20
#define AUX_LEFT 0x25
#define AUX_UP 0x26
#define AUX_RIGHT 0x27
#define AUX_DOWN 0x28
#define AUX_A 'A'
#define AUX_B 'B'
#define AUX_C 'C'
#define AUX_D 'D'
#define AUX_E 'E'
#define AUX_F 'F'
#define AUX_G 'G'
#define AUX_H 'H'
#define AUX_I 'I'
#define AUX_J 'J'
#define AUX_K 'K'
#define AUX_L 'L'
#define AUX_M 'M'
#define AUX_N 'N'
#define AUX_O 'O'
#define AUX_P 'P'
#define AUX_Q 'Q'
#define AUX_R 'R'
#define AUX_S 'S'
#define AUX_T 'T'
#define AUX_U 'U'
#define AUX_V 'V'
#define AUX_W 'W'
#define AUX_X 'X'
#define AUX_Y 'Y'
#define AUX_Z 'Z'
#define AUX_a 'a'
#define AUX_b 'b'
#define AUX_c 'c'
#define AUX_d 'd'
#define AUX_e 'e'
#define AUX_f 'f'
#define AUX_g 'g'
#define AUX_h 'h'
#define AUX_i 'i'
#define AUX_j 'j'
#define AUX_k 'k'
#define AUX_l 'l'
#define AUX_m 'm'
#define AUX_n 'n'
#define AUX_o 'o'
#define AUX_p 'p'
#define AUX_q 'q'
#define AUX_r 'r'
#define AUX_s 's'
#define AUX_t 't'
#define AUX_u 'u'
#define AUX_v 'v'
#define AUX_w 'w'
#define AUX_x 'x'
#define AUX_y 'y'
#define AUX_z 'z'
#define AUX_0 '0'
#define AUX_1 '1'
#define AUX_2 '2'
#define AUX_3 '3'
#define AUX_4 '4'
#define AUX_5 '5'
#define AUX_6 '6'
#define AUX_7 '7'
#define AUX_8 '8'
#define AUX_9 '9'
/*
** ToolKit Gets and Sets
*/
#define AUX_FD 1 /* return fd (long) */
#define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
#define AUX_GREYSCALEMAP 4
#define AUX_FOGMAP 5 /* pass fog and color bits (long) */
#define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
/*
** Color Macros
*/
#define AUX_BLACK 0
#define AUX_RED 13
#define AUX_GREEN 14
#define AUX_YELLOW 15
#define AUX_BLUE 16
#define AUX_MAGENTA 17
#define AUX_CYAN 18
#define AUX_WHITE 19
extern float auxRGBMap[20][3];
#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
/*
** RGB Image Structure
*/
typedef struct _AUX_RGBImageRec {
GLint sizeX, sizeY;
unsigned char *data;
} AUX_RGBImageRec;
/*
** Prototypes
*/
void APIENTRY auxInitDisplayMode(GLenum);
void APIENTRY auxInitPosition(int, int, int, int);
/* GLenum APIENTRY auxInitWindow(LPCTSTR); */
#ifdef UNICODE
#define auxInitWindow auxInitWindowW
#else
#define auxInitWindow auxInitWindowA
#endif
GLenum APIENTRY auxInitWindowA(LPCSTR);
GLenum APIENTRY auxInitWindowW(LPCWSTR);
void APIENTRY auxCloseWindow(void);
void APIENTRY auxQuit(void);
void APIENTRY auxSwapBuffers(void);
typedef void (CALLBACK* AUXMAINPROC)(void);
void APIENTRY auxMainLoop(AUXMAINPROC);
typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
typedef void (CALLBACK* AUXIDLEPROC)(void);
void APIENTRY auxIdleFunc(AUXIDLEPROC);
typedef void (CALLBACK* AUXKEYPROC)(void);
void APIENTRY auxKeyFunc(int, AUXKEYPROC);
typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
int APIENTRY auxGetColorMapSize(void);
void APIENTRY auxGetMouseLoc(int *, int *);
void APIENTRY auxSetOneColor(int, float, float, float);
void APIENTRY auxSetFogRamp(int, int);
void APIENTRY auxSetGreyRamp(void);
void APIENTRY auxSetRGBMap(int, float *);
/* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
#ifdef UNICODE
#define auxRGBImageLoad auxRGBImageLoadW
#else
#define auxRGBImageLoad auxRGBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
#ifdef UNICODE
#define auxDIBImageLoad auxDIBImageLoadW
#else
#define auxDIBImageLoad auxDIBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
void APIENTRY auxCreateFont(void);
/* void APIENTRY auxDrawStr(LPCTSTR); */
#ifdef UNICODE
#define auxDrawStr auxDrawStrW
#else
#define auxDrawStr auxDrawStrA
#endif
void APIENTRY auxDrawStrA(LPCSTR);
void APIENTRY auxDrawStrW(LPCWSTR);
void APIENTRY auxWireSphere(GLdouble);
void APIENTRY auxSolidSphere(GLdouble);
void APIENTRY auxWireCube(GLdouble);
void APIENTRY auxSolidCube(GLdouble);
void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxWireTorus(GLdouble, GLdouble);
void APIENTRY auxSolidTorus(GLdouble, GLdouble);
void APIENTRY auxWireCylinder(GLdouble, GLdouble);
void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
void APIENTRY auxWireIcosahedron(GLdouble);
void APIENTRY auxSolidIcosahedron(GLdouble);
void APIENTRY auxWireOctahedron(GLdouble);
void APIENTRY auxSolidOctahedron(GLdouble);
void APIENTRY auxWireTetrahedron(GLdouble);
void APIENTRY auxSolidTetrahedron(GLdouble);
void APIENTRY auxWireDodecahedron(GLdouble);
void APIENTRY auxSolidDodecahedron(GLdouble);
void APIENTRY auxWireCone(GLdouble, GLdouble);
void APIENTRY auxSolidCone(GLdouble, GLdouble);
void APIENTRY auxWireTeapot(GLdouble);
void APIENTRY auxSolidTeapot(GLdouble);
/*
** Window specific functions
** hwnd, hdc, and hglrc valid after auxInitWindow()
*/
HWND APIENTRY auxGetHWND(void);
HDC APIENTRY auxGetHDC(void);
HGLRC APIENTRY auxGetHGLRC(void);
/*
** Viewperf support functions and constants
*/
/* Display Mode Selection Criteria */
enum {
AUX_USE_ID = 1,
AUX_EXACT_MATCH,
AUX_MINIMUM_CRITERIA
};
void APIENTRY auxInitDisplayModePolicy(GLenum);
GLenum APIENTRY auxInitDisplayModeID(GLint);
GLenum APIENTRY auxGetDisplayModePolicy(void);
GLint APIENTRY auxGetDisplayModeID(void);
GLenum APIENTRY auxGetDisplayMode(void);
#ifdef __cplusplus
}
#endif
#endif /* __GLAUX_H__ */
Sorry for all the posts, but since I was stuck I just did some reading trying to figure out what some of these files do.
It seems that SDL is recommended much more than using GLUT, GLAUX so maybe no need to do glut and glaux?
GLEW seems like a good one to do for the extensions as it handles most of them from what I could tell.
Well I will stop posting tonight as getting all confused and don't want to get anyone confused. If I can still get help on the conversion and how complicated looking things as in that header file can be converted it would be great!
Petr Schreiber
06-06-2007, 09:33
Hi kryton,
thanks for your activities!
GLAUX is considered quite dead, and GLUT ... I am not sure but I know latest version was from 1998 or so.
Some people tries to make it live, but both unofficial OpenGLUT and FreeGLUT seem to stop before 2 years.
GLEW is not bad stuff, but it seems again quite similar to TBGL. Currently it has some extra functions regarding extensions, but this is on my wish list now too for TBGL.
On other side, I prefer to make the current TBGL documentation more complete and write some articles instead of hurry to new version. This way you can get more used to current version, and when you understand all, you can move to new one and learn new stuff incrementally
So from the list you provided, GLEW seems potentially most interesting. But José Roca already did the conversion of headers for PowerBASIC (http://www.jose.it-berater.org/smfforum/index.php?topic=812.msg1697#msg1697) quite recently, so maybe you could check it out.
Bye,
Petr
Petr, I will wait for you to put it in when the time comes. You game me more than enough to study and learn and with each demo you put out I am blown away by what can be done that I don't know how to do yet.
I don't have powerbasic and not a member of the forum so I couldn't download from the link you sent. But I think it is something you should look too especially where we can load from different file formats for textures.
I studied DDS the last couple of days it is neat, I had used it but never really understood what mipmaps were. DDS stores mipmaps so opengl doesn't have to make them. I think DDS and png would be great formats to have and then all our textures could be small and useful.
I think with existing code we can draw to memory and then use those as textures too. I am going to tinker with that tonight.