PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

OpenGL ES problem

And how to use functions OpenGL ES???
And if to write for the personal computer they I work, i.e. light is disconnected, depth ..
glDisable (GL_LIGHTING);
glDisable (GL_DEPTH_TEST);
glDisable (GL_BLEND);

and on a handheld computer it is not compiled at all?

Error 1 error LNK2019: unresolved external symbol __imp_glDisable referenced in function "public: virtual long __cdecl ClassMain::OnNextFrame(class ClassEDisplay *,unsigned long)" (?OnNextFrame@ClassMain@@UAAJPAVClassEDisplay@@K@Z) test2.obj


And what in plugin1-0.lib??
And for what it is necessary??
Has tried rasteroid, their examples slowly work on a handheld computer. Has connected them lib, headers in a folder " gles \ ", all the same gives out a mistake that it does not know " glDisable (GL_LIGHTING); "

Here functions OpenGL ES are obviously used and at all of them works.
Here a piece from their example:
static void renderGLESScene(int width, int height, AppData* context, unsigned int time)
{
/* Time needed for the rotation */
const double effectTime= fmod(time / 1000.0, 360.0);
updateOpenGLESState(width, height);
glClear (GL_COLOR_BUFFER_BIT);
/* Rotate the world matrix and translate it on the z-axis */
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.f, 0.f, -30.f);
glRotatef((float)(effectTime*29.77f), 1.0f, 2.0f, 0.0f);
glRotatef((float)(effectTime*22.311f), -0.1f, 0.0f, -5.0f);
/* Set the pointer to the arrays containing the cube vertices, normals
and texture coordinates */
glVertexPointer(3, GL_BYTE, 0, s_cubeVertices);
glNormalPointer(GL_BYTE, 0, s_cubeNormals);
glTexCoordPointer(2, GL_BYTE, 0, s_cubeTexCoords);
/* Draw the cube one face at a time in the same order thay have been defined
in the s_cubeVertices array */
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
glDrawArrays(GL_TRIANGLE_STRIP, 8, 4);
glDrawArrays(GL_TRIANGLE_STRIP, 12, 4);
glDrawArrays(GL_TRIANGLE_STRIP, 16, 4);
glDrawArrays(GL_TRIANGLE_STRIP, 20, 4);
}


Please prompt as to make that functions OpenGL ES worked on a handheld computer.
And by the way the example on rendering 500 triangles works very slowly nearby 5 fps, it can is possible to accelerate ?
Code:
int i=0;
for (int t=0;t<500;t++)
{
xt[i]=ecd.math->Rand(-2048,2048);
yt[i]=ecd.math->Rand(-2048,2048);
zt[i]=ecd.math->Rand(1048,2048);
xt[i+1]=ecd.math->Rand(-2048,2048);
yt[i+1]=ecd.math->Rand(-2048,2048);
zt[i+1]=zt[i];
xt[i+2]=ecd.math->Rand(-2048,2048);
yt[i+2]=ecd.math->Rand(-2048,2048);
zt[i+2]=zt[i];
treygolnik.SetVertex(0, xt[i], yt[i], zt[i]);
treygolnik.SetVertex(1, xt[i+1], yt[i+1], zt[i+1]);
treygolnik.SetVertex(2, xt[i+2], yt[i+2], zt[i+2]);
display->Render(&treygolnik);
}
Attachments:
test_primer.rar (48 KB)
Hi Relo,

The glDisable error is odd. It's standard OpenGL (ES) functionality and must be present in every implementation that follows the standard. Can you tell me which implementation and/or device SDK you use.

Please try to build the View 3D sample in the EDGELIB samples folder. Can you compile and run the View 3D sample on your device?

The plugin1-0.lib library is a set of wrapper functions to let EDGELIB and OpenGL (ES) work together for rendering graphics.

Software rendering through rasteroid can be slow as everything needs to be handled by software. There is currently no known method to make it faster.
Please try to build the View 3D sample in the EDGELIB samples folder. Can you compile and run the View 3D sample on your device?

Yes I have already understood.

use Rasteroid on the personal computer deduces the information about GL_RENDERER, in the emulator (null) why so? In fact should be software rendering?? And if on a handheld computer there is h/w that it will pass in h/w or will work in a mode software??

try lib and header from Vincent 3D Rendering Library for Pocket PC
http://www.zeuscmd.com/forums/viewTopic.php?topic=23

sprintf(str_gl_ops,"OpenGL ES Vendor: %s,\nRenderer: %s,\nVersion: %s",glGetString(GL_VENDOR),glGetString(GL_RENDERER),glGetString(GL_VERSION));
return
"OpenGL ES Vendor: Hans-Martin Will,
Renderer: Software,
Version: OpenGL ES-CM 1.1"


But with libraries from Vincent, the program is not started, compiled without mistakes, but at start is simply closed.

examples on OpenGL ES
http://www.zeuscmd.com/tutorials/opengles/index2.php


And why in your examples (for example view3d) functions Opengl ES are not used, and work goes through
display-> Render (*cube);
display-> WorldTranslate (0, 0,-6000);
???
Attachments:
screenshots.ZIP (31 KB)
Hi Relo,

EDGELIB hasn't been tested with the Vincent OpenGL (ES) library, so it might give unexpected results. If the renderer doesn't return a string value it could be that the implementation doesn't support this method.

For Windows Mobile it's unfortunately not possible to use one implementation for both hardware and software rendering. You need to create seperate builds for each implementation (for example, one software, one for PowerVR and one for NVidia).

EDGELIB methods like Render() and WorldTranslate() are able to call OpenGL (ES) functions internally when OpenGL has been enabled.
With use Rasteroid and GLUT|ES
sprintf (stderr3, " OpenGL ES Vendor: %s, \nRenderer: %s, \nVersion: %s ", glGetString (GL_VENDOR), glGetString (GL_RENDERER), glGetString (GL_VERSION)); returns
" OpenGL ES Vendor: Hybrid Graphics, Ltd.,
Renderer: Gerbera 3.0.1,
Version: OpenGL ES-CM 1.1"

and with EDGELIB
"OpenGL ES Vendor: null,
Renderer: null,
Version: null "

it is possible because of plugin1-0.lib??
How I have understood all goes through plugin1-0.lib, instead of directly libGLES_CM??
That is
display-> WorldTranslate (0, 0,-6000);
it is possible to replace on
gluLookAtf(
0.0f, 0.0f, 3.0f,
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f);

and how to make the following: glFlush ();glutSwapBuffers ();
by the way by a call display-> Render (*cube); occurs paint object and an automatic exchange of the videobuffer? If some objects paint are necessary to me, can transfer to the buffer do in the end after paint all scene (more than 1 object)?
Here is how in an example:
Code:
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
gluLookAtf(
0.0f, 0.0f, 3.0f,
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f);
glRotatef(xrot, 1.0f, 0.0f, 0.0f);
glRotatef(yrot, 0.0f, 1.0f, 0.0f);
// FRONT AND BACK
glColor4f(1.0f, 0.0f, 0.0f, 0.5f);
glNormal3f(0.0f, 0.0f, 1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glNormal3f(0.0f, 0.0f, -1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
// LEFT AND RIGHT
glColor4f(0.0f, 1.0f, 0.0f, 0.5f);
glNormal3f(-1.0f, 0.0f, 0.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 8, 4);
glNormal3f(1.0f, 0.0f, 0.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 12, 4);
// TOP AND BOTTOM
glColor4f(0.0f, 0.0f, 1.0f, 0.5f);
glNormal3f(0.0f, 1.0f, 0.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 16, 4);
glNormal3f(0.0f, -1.0f, 0.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 20, 4);
glTranslatef(-1,-1,-1);
// FRONT AND BACK
glColor4f(1.0f, 0.0f, 0.0f, 0.5f);
glNormal3f(0.0f, 0.0f, 1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
glNormal3f(0.0f, 0.0f, -1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
sprintf(stderr3,"OpenGL ES Vendor: %s,\nRenderer: %s,\nVersion: %s",glGetString(GL_VENDOR),glGetString(GL_RENDERER),glGetString(GL_VERSION));
glFlush ();
glutSwapBuffers();
Hi Relo,

When using the EDGELIB methods (like WorldTranslate and Render) it uses the plugingl.lib library. When using the OpenGL functions like glRotatef it calls OpenGL directly without using plugingl.lib.

If you only like to use the EDGELIB framework, and use OpenGL (ES) directly for rendering you can use EFL_MANUALFLIP as a flag option and call OpenGL functions only. If you also like to use E3DSurface objects, you can lock them and get the vertex, normal, color and texture coordinate arrays.
Planet9Dave · 28 Jan 2009, 01:52 UTC
Hi,

I'm trying to port our EdgeLib-based demo over to a WinMobile 5.0 PocketPC (ARMV4I) handheld, and running into what sounds like the same issue when compiling:

plugin1-0.lib(wrap_gles.obj) : error LNK2001: unresolved external symbol __imp_glDisable
(and tons of other unresolved standard glWhatever function names)


edge wrote:
The glDisable error is odd. It's standard OpenGL (ES) functionality and must be present in every implementation that follows the standard. Can you tell me which implementation and/or device SDK you use.


Specifically, I've copied most of the "how to figure out which libraries to link" code from the View3D sample, defined the appropriate symbols, and Visual Studio's helpful syntax highlighting tells me I should be getting the following:

Code:

// EGL_USEGLES defined
#include "GLES\\gl.h"
#include "GLES\\egl.h"

// EGL_PC and DEVICE_DESKTOP not defined
#pragma comment(lib, "plugin1-0.lib")

// EGL_RASTEROID defined
#pragma comment(lib, "libEGL.lib")
#pragma comment(lib, "libGLES_CM_NoE.lib")



I think the problem is a mismatch in PocketPC support: I'm linking against the ppc2005-arm versions of the Edge libraries, but Rasteroid 3.1 provides only wince/pp2003 versions, and it looks as though there's a mismatch in symbol naming: symbols __imp__glDisable and _glDisable are defined in libGLES_CM_NoE.lib, but not the complained-about __imp_glDisable (note the different number of underscores).

I'm hoping that the problem is the Rasteroid version, and if so, is there a newer release supporting ppc2005 and beyond? Hybrid Graphics' website has apparently been non-responsive (or questionable) at least since last December.

Thanks in advance,
Dave

Dave Florek
Planet 9 Studios
525 Brannan St, Suite 407
San Francisco, CA 94107
http://www.planet9.com/
Hi Dave,

Unfortunately, support for Rasteroid has been discontinued. The development probably stopped after the takeover by NVidia.

Perhaps it's an option to build your application for Pocket PC 2003?
Planet9Dave · 28 Jan 2009, 18:41 UTC
Perhaps it's an option to build your application for Pocket PC 2003?


Thanks, I'll give that a try.

Or perhaps I'll start my own reference implementation of OpenGL. In my spare time. 8)

Dave

Dave Florek
Planet 9 Studios
525 Brannan St, Suite 407
San Francisco, CA 94107
http://www.planet9.com/
Planet9Dave · 29 Jan 2009, 02:48 UTC
And in another realm, I'm also trying to get up-to-speed on iPhone development. Since my application is heavily dependent on OpenGL (both within and outside of EdgeLib), I've started with the View3D sample, and after a substantial amount of beating the Xcode project into submission (following the tips on your gettingstarted_mac_project.html page), I'm down to three remaining undefined symbols:
Code:

Undefined symbols:
"_kEAGLDrawablePropertyColorFormat", referenced from:
_kEAGLDrawablePropertyColorFormat$non_lazy_ptr in libedge.a(appleframe.o)
"_kEAGLColorFormatRGB565", referenced from:
_kEAGLColorFormatRGB565$non_lazy_ptr in libedge.a(appleframe.o)
"_kEAGLDrawablePropertyRetainedBacking", referenced from:
_kEAGLDrawablePropertyRetainedBacking$non_lazy_ptr in libedge.a(appleframe.o)


I'm betting that I have a version mismatch issue, trying to be leniently backwards compatible (at least a little): I'm building against the iPhone 2.0 SDK under Xcode 3.1 (beta) [Core version 1078.0 in the "About Xcode..." pop-up] and EdgeLib 3.952. I saw a note in another thread about informing potential purchasers that an App is supported only on iPhone 2.2 firmware, but would prefer not to require all potential users to upgrade firmware/OS ... a business "bad practice" as mentioned in the same thread. What is the earliest version of the iPhone (and SDK) that I can use with EdgeLib?

Thanks in advance,
Dave

Dave Florek
Planet 9 Studios
525 Brannan St, Suite 407
San Francisco, CA 94107
http://www.planet9.com/
Hi Dave,

You can download the latest iPhone SDK (the 2.2.1 version is just released) and target iPhone 2.0 firmware. I hope this will solve your linker issues.