PocketMatrix forums

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

Using PowerVR on Windows desktop

Hi! I want to tinker around with 3D graphics on the iPhone. Since I'm much more comfortable working on Visual Studio, I downloaded the PowerVR Insider SDK from this site, and recompiled the "Animate3D" sample included with EDGELIB. The only modification I made was to replace the following line of code:

Code:
#define EGL_PC


for this one:

Code:
#define EGL_POWERVR


The code compiled and the sample ran fine (ie. I see the animated turtle) but, when I closed the application's window I got this "Unhandled exception" message from Visual Studio. I'm attaching the project so that you can try it for yourself. I'm using the latest version of the PowerVR SDK and is installed in the default directory.

As a side question (but related to 3D graphics, nonetheless): in a previous thread I was told that the engine uses fixed point internally for 3D graphics. Apple's docs say that the iPhone supports floating point in hardware and that it outperforms its fixed-point equivalent. Would it be possible to make edgelib work internally with floating point code by using a compilation flag?

Which features are planned regarding the 3D engine in the upcoming versions of the library?

Thanks for your support,

--Nacho
Attachments:
TerrainRenderer.rar (148 KB)
Hi Nacho,

Please check if you're linking the pluginpowervr.lib library instead of plugingl.lib. If changing the library doesn't work, can you tell me which kind of unhandled exception you get (for example: an access violation)? Also, please post the call stack from your debugger.

Currently it's not possible to send floating point coordinates to OpenGL using EDGELIB. However, you can fetch the E3DSurface data and convert them to floating point manually, but you need to call OpenGL directly.

Regarding your question about EDGELIB 4.0:
At this point we are still defining the complete road map for EDGELIB 4.0. We will publish announcements on this as soon as we think is appropriate.
Hi edge,

Thanks for your reply. Yes, I'm getting an "access violation" message. More precisely:

Visual Studio Express 2005 wrote:
Unhandled exception at 0x5f14699b in TerrainRenderer.exe: 0xC0000005: Access violation reading location 0x5f14699b.


I'm attaching two screenshots that show the stack trace and the fact that "pluginpowervr.lib" is in use.

Thanks for your answer regarding floating point and the engine, too. Looking forward to what features will version 4 add to the 3D renderer so that I don't have to code them myself :D

--Nacho
Attachments:
PowerVRShots.rar (52 KB)
Hi Nacho,

We've downloaded 1.1 SDK, but couldn't compile your sample. The SDK is missing an EGL folder. The reason for the access violation could be mismatching libraries and SDK's. Did you try downloading the 1.0 SDK?
I'm trying to get powervr working for windows desktop as well. I installed the PC emulation OGLES 1.1 SDK and include/linked like this:

Code:

#define EGL_USEGL
#define EGL_USEGLES
#define EGL_POWERVR
#include "GLES/gl.h"
#include "GLES/egl.h"
#include "GLES/glext.h"
#pragma comment(lib, "pluginpowervr.lib")
#pragma comment(lib, "libgles_cm.lib")


The program compiles fine, but I'm getting the linking errors below:
Code:

1>LINK : ..\tfg_pc\debug\tfg_pc.exe not found or not built by the last incremental link; performing full link
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glTexParameterx referenced in function "unsigned long __cdecl EdgeGL_GenTexture(void *)" (?EdgeGL_GenTexture@@YAKPAX@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glBindTexture referenced in function "unsigned long __cdecl EdgeGL_GenTexture(void *)" (?EdgeGL_GenTexture@@YAKPAX@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glGenTextures referenced in function "unsigned long __cdecl EdgeGL_GenTexture(void *)" (?EdgeGL_GenTexture@@YAKPAX@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glDeleteTextures referenced in function "void __cdecl EdgeGL_DeleteTexture(void *,unsigned long)" (?EdgeGL_DeleteTexture@@YAXPAXK@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glTexSubImage2D referenced in function "long __cdecl EdgeGL_UpdateTextureData(void *,unsigned long,unsigned long,unsigned long,struct tagRECT *,unsigned char,unsigned char,void *,bool)" (?EdgeGL_UpdateTextureData@@YAJPAXKKKPAUtagRECT@@EE0_N@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glTexImage2D referenced in function "long __cdecl EdgeGL_UpdateTextureData(void *,unsigned long,unsigned long,unsigned long,struct tagRECT *,unsigned char,unsigned char,void *,bool)" (?EdgeGL_UpdateTextureData@@YAJPAXKKKPAUtagRECT@@EE0_N@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glCompressedTexImage2D referenced in function "long __cdecl EdgeGL_UpdateCompressedTexture(void *,unsigned long,unsigned long,unsigned long,struct tagRECT *,char *,void *,bool)" (?EdgeGL_UpdateCompressedTexture@@YAJPAXKKKPAUtagRECT@@PAD0_N@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glDisable referenced in function "void __cdecl EdgeGL_EnableLight(void *,unsigned char,bool)" (?EdgeGL_EnableLight@@YAXPAXE_N@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glEnable referenced in function "void __cdecl EdgeGL_EnableLight(void *,unsigned char,bool)" (?EdgeGL_EnableLight@@YAXPAXE_N@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glLightxv referenced in function "void __cdecl EdgeGL_LightPosition(void *,unsigned char,long,long,long)" (?EdgeGL_LightPosition@@YAXPAXEJJJ@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glColor4x referenced in function "void __cdecl EdgeGL_SetColor(void *,unsigned long,unsigned char)" (?EdgeGL_SetColor@@YAXPAXKE@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glClearColorx referenced in function "void __cdecl EdgeGL_SetColor(void *,unsigned long,unsigned char)" (?EdgeGL_SetColor@@YAXPAXKE@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glShadeModel referenced in function "void __cdecl EdgeGL_SetShading(void *,unsigned char)" (?EdgeGL_SetShading@@YAXPAXE@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glBlendFunc referenced in function "void __cdecl EdgeGL_SetTextureBlending(void *,unsigned char,unsigned char)" (?EdgeGL_SetTextureBlending@@YAXPAXEE@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glTexEnvx referenced in function "void __cdecl EdgeGL_SetTextureBlending(void *,unsigned char,unsigned char)" (?EdgeGL_SetTextureBlending@@YAXPAXEE@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glOrthox referenced in function "void __cdecl EdgeGL_Ortho(void *,long *)" (?EdgeGL_Ortho@@YAXPAXPAJ@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glLoadIdentity referenced in function "void __cdecl EdgeGL_Ortho(void *,long *)" (?EdgeGL_Ortho@@YAXPAXPAJ@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glMatrixMode referenced in function "void __cdecl EdgeGL_Ortho(void *,long *)" (?EdgeGL_Ortho@@YAXPAXPAJ@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glFrustumx referenced in function "void __cdecl EdgeGL_Perspective(void *,long *)" (?EdgeGL_Perspective@@YAXPAXPAJ@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glMultMatrixx referenced in function "void __cdecl EdgeGL_PerspectiveMatrix(void *,void *)" (?EdgeGL_PerspectiveMatrix@@YAXPAX0@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glScissor referenced in function "void __cdecl EdgeGL_Scissor(void *,long *)" (?EdgeGL_Scissor@@YAXPAXPAJ@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glPushMatrix referenced in function "void __cdecl EdgeGL_PushMatrix(void *)" (?EdgeGL_PushMatrix@@YAXPAX@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glPopMatrix referenced in function "void __cdecl EdgeGL_PopMatrix(void *)" (?EdgeGL_PopMatrix@@YAXPAX@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glClear referenced in function "void __cdecl EdgeGL_Clear(void *,bool,bool)" (?EdgeGL_Clear@@YAXPAX_N1@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glDrawArrays referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glDrawElements referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glTexCoordPointer referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glColorPointer referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glNormalPointer referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glDisableClientState referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glVertexPointer referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glEnableClientState referenced in function "void __cdecl EdgeGL_RenderModel(void *,void * *,long *,unsigned long,bool,bool)" (?EdgeGL_RenderModel@@YAXPAXPAPAXPAJK_N3@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glHint referenced in function "public: long __thiscall EdgeGLInterface::Open(int,unsigned long,unsigned long)" (?Open@EdgeGLInterface@@QAEJHKK@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glDepthFunc referenced in function "public: long __thiscall EdgeGLInterface::Open(int,unsigned long,unsigned long)" (?Open@EdgeGLInterface@@QAEJHKK@Z)
1>pluginpowervr.lib(wrap_gles.obj) : error LNK2019: unresolved external symbol __imp__glGetIntegerv referenced in function "public: long __thiscall EdgeGLInterface::Open(int,unsigned long,unsigned long)" (?Open@EdgeGLInterface@@QAEJHKK@Z)


Thanks again,
John
Hi John,

The problem is the OpenGL profile (library) you're using. Use libgles_cl.lib instead of libgles_cm.lib.