PDA

View Full Version : OpenGL ES



noeska
30-09-2007, 11:49 AM
Is there an pascal/delphi unit available for opengl es

for more info on opengl es see:
http://www.khronos.org/opengles/1_X/

and:
http://www.imgtec.com/PowerVR/insider/toolsSDKs/KhronosOpenGLES1xMBX/index.asp

A first try at converting the c headers to pascal using the jedi tool ended up in a disaster (what a suprise :roll: ).

Searching for an existing conversion also gave nothing.

Now as opengl es 1.x is a subset of opengl using some 1.5 features i could go copy and paste the relevant entries from dlgopengl. But i doubt if that would be successfull.

Before going in the hard way and convert it by hand i could use some ideas/ tips etc.

I even considered leaving pascal and go the c way, saves a lot of time for not having to do this conversion. :twisted:

noeska
30-09-2007, 04:38 PM
some exampless:



typedef struct _KEGL_SURFACE_ *EGLSurface;
typedef struct _KEGL_CONTEXT_ *EGLContext;


and



#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0)
#define EGL_NO_CONTEXT ((EGLContext)0)
#define EGL_NO_DISPLAY ((EGLDisplay)0)
#define EGL_NO_SURFACE ((EGLSurface)0)

savage
30-09-2007, 05:05 PM
How are the _KEGL_SURFACE_ and _KEGL_CONTEXT_ structs defined? The lines you provide look like they are pointers to structures/records.

The EGL_* defines look like C Macros to me. In Pascal you would need to explicitly define these are procedures I think.

noeska
30-09-2007, 06:56 PM
this is the complete egltypes.h



/************************************************** ***************************
Name : egltypes.h
Date : 11/04/05
Platform : Windows XP/Windows CE/PocketPC

Description :
Native egltypes.h as required by Khronos OpenGL ES egl.h

This file is part of the PowerVR OpenGL ES SDK.

Copyright 2000-2005 by Imagination Technologies Ltd. All rights reserved.
Information and source code samples contained herein are
provided "as-is", without representations or warranties, and
are subject to change without notice. The author cannot support
modifications or derivative works created from the sample source
code provided. You may use, reproduce, and modify portions or
entire sections of the sample source code for the purposes of
creating applications. Distribution is limited to executable
or binary portions of the sample source code unless you gain
written permission from the author.
************************************************** ***************************/
#ifndef _egltypes_h_
#define _egltypes_h_

/* Types */
typedef int EGLBoolean;
#define EGL_FALSE 0
#define EGL_TRUE 1

/* An integer of at least 32 bits */
typedef int EGLint;

/* Resources */
typedef EGLint EGLDisplay;
typedef EGLint EGLConfig;
typedef struct _KEGL_SURFACE_ *EGLSurface;
typedef struct _KEGL_CONTEXT_ *EGLContext;

/* Windowing system: Windows */
#undef UNREFERENCED_PARAMETER
#include <windows>

typedef HDC NativeDisplayType;
typedef HWND NativeWindowType;
typedef void *NativePixmapType;

/* May need to export on some platforms */
#define GLAPI_EXT

/* EGL and native handle values */
#define EGL_DEFAULT_DISPLAY &#40;&#40;NativeDisplayType&#41;0&#41;
#define EGL_NO_CONTEXT &#40;&#40;EGLContext&#41;0&#41;
#define EGL_NO_DISPLAY &#40;&#40;EGLDisplay&#41;0&#41;
#define EGL_NO_SURFACE &#40;&#40;EGLSurface&#41;0&#41;

#endif

noeska
30-09-2007, 07:39 PM
some of the opengl es have some wierd entries in the dll:
like _eglGetDisplay@4

now i have to do something like:

function eglGetDisplay&#40;display_id&#58; NativeDisplayType &#41;&#58; EGLDisplay; stdcall; external 'libgles_cl.dll' name '_eglGetDisplay@4';
function eglInitialize&#40;dpy&#58; EGLDisplay ; major&#58; PEGLint ; minor&#58; PEGLint &#41;&#58; EGLBoolean; stdcall; external 'libgles_cl.dll' name '_eglInitialize@12'; //*major *minor

noeska
30-09-2007, 08:34 PM
I finished an alpha version: http://www.noeska.net/downloads/opengles.zip

WILL
01-10-2007, 03:44 AM
Very nice work!

I believe those of you that were wanting to make games for the GP2X would be most interested in this, no?

What were the other systems that required OpenGL|ES in place of a fully featured OpenGL API?

JSoftware
01-10-2007, 05:19 AM
What were the other systems that required OpenGL|ES in place of a fully featured OpenGL API?
Playstation? :lol:

noeska
01-10-2007, 07:24 AM
My first concern is the efika(2) (http://www.genesippc.com/).

Also opengl es 1.x is on some 'of the newer' mobile phones /pda's also.

Playstation3 also features opengl es, but not in linux. :(

Isn't the gpx2 2d only?

WILL
03-10-2007, 03:46 AM
GP2X can do both 2D and 3D. ie. Doom/Quake have been ported onto it in the not to distant past. It just might not have as much 3D processing as on a PC or a non-portable game console. But this is what GL|ES is for, right?

btw, what are you planning on doing with the efika? Arcade machine perhaps? ;)

noeska
03-10-2007, 05:09 PM
yes opengl es is for that but mostly it is available for special hardware like the powervr mbx efika2 nokia n93. Looking at some movies for n93 it might be faster then the nintendo ds. the powervr mbx is supposed to be a newer version of the 3d chipset from the dreamcast.

i am porting the 3das engine to support opengl es and make it compileable with freepascal (now delphi only). Having done that i might be able to provide runtimes for mobile phones/ (ps3) / gp2x / (nds) / Efika(2)

my plans for the efika are to make it a (slow) game console/media player. Looking a the raw specs the efika is between a gamecube and wii.

Now i wonder, is there an opengl es compatible library for the nintendo ds also?

Legolas
03-10-2007, 06:20 PM
Nope, though the 3d functions of libnds are written with plain OpenGL names (not ES), like GLBegin, GLEnd, GLRotate, ...

noeska
08-02-2010, 04:33 PM
A new version of the header is released here: http://www.pascalgamedevelopment.com/forum/index.php?topic=6107.0