PocketMatrix forums

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

Help getting started with PocketGL

Can someone tell me the basic steps in getting started with PocketGL?


I've unzipped everything to c:/PocketGL

I start eVC 3.0 and load the file PocketGl.vcw

I then go File Open and browse to the Src/Demos directory and open Demo1.cpp

I go Build Compile Demo1.cpp and get no errors

I then go Build PocketGl.exe (not sure why the name is different). And I get this error:


--------------------Configuration: PocketGl - Win32 (WCE ARM) Debug--------------------
Performing Custom Build Step on ..\Src\BlitARM.s
Bad command or file name
Compiling...
Board3D.cpp
Bsp.cpp
Color.cpp
Flush.cpp
Font.cpp
FSqrt.cpp
Matrix.cpp
MiniGL.cpp
Render.cpp
Sort.cpp
Vector.cpp
Demo10.cpp
Demo11.cpp
Demo12.cpp
Demo2.cpp
Demo3.cpp
Demo4.cpp
Demo5.cpp
Demo6.cpp
Demo7.cpp
Demo8.cpp
Demo9.cpp
Import.cpp
TgaFile.cpp
WinMain.cpp
Linking...
LINK : fatal error LNK1181: cannot open input file ".\ARMDbg\BlitARM.obj"
Error executing link.exe.

PocketGl.exe - 1 error(s), 0 warning(s)
I can help you get going with PocketGL. Your current problem is just about how your project is set up, not PGL specific. Probably not pointing to where PGL's library file is. See tools /options /directories /library files

Can you confirm that you are using a free version of PocketGL and also which version and where you downloaded? (easier to help if I know)
Thanks you so much Conan!

I purchased the full version on Handango and had a question for Pierre and he ended up sending me: PocketGl121Full.zip

Which directory is PGL's library file in that I need to point to?

I appreciate the help getting started here a great deal.
As you have the full version we are not worried about library files as you will build using the source instead.

In demo1 I assume you have changed the #if 0 to #if 1 to activate this demo & the other demos all say #if 0?

(My PC is running a full system scan so it's real slow. Will be back in 30 minutes or so when it's finished as I don't want to stop it) Do you have ICQ as this might be much quicker way to sort you out?
If so email me your id to ian@sundialsoft.co.uk
Demo1 has #if 1 already - I will email you for help - thanks so much!
Sorry for the delay, my desktop is 'playing up' so as soon as it's rebooted I will copy PGL 1.2 to my laptop & get back to you (wierd stuff, keyboard stopped working etc)
The blitarm object is built from an assembly file. You need to add that source file to your project, edit the custom build for that file, and assemble it with armasm.

Dan East
There is also a C version of the BlitArm file, a good thing since you'll probably want to rewrite a few things. Eg: Add colored fog, 16Bit color, seperate ZBuffer etc...
Conan · 24 Aug 2004, 12:51 UTC — question to gamefreaks
Have you modified PGL 1.2 as described in your suggestions? If so would you consider making your mods available. Happy to pay a reasonable sum
Modifying PocketGL to support 16 bit textures / rendering is a very involved task.

PocketGL converts all textures to 9 bit RGB when they are loaded. During polygon rasterization 7 bits of intensity are applied via gouraud interpolation. So the output buffer consists of a 16 bit depth value, then 7 bits of intensity followed by 9 bits of RGB. When that is blitted to the display each 7+9 bits of intensity + color are looked up in a large table to determine the exact 16 bit 565 color to copy to the display.

So the conversion to full 16 bit rendering involves rewriting all the LineMap routines, not just modifications to Flush.cpp or BlitARM.s.


Dan East
I got a copy of BlitARM.obj and put it in my ARMrel directory and everything compiled fine. I'm not sure why my system would never generate that file but I am ok now enough to start digging into the material at least now.

Modifying PocketGL to support 16 bit textures / rendering is a very involved task.

PocketGL converts all textures to 9 bit RGB when they are loaded. During polygon rasterization 7 bits of intensity are applied via gouraud interpolation. So the output buffer consists of a 16 bit depth value, then 7 bits of intensity followed by 9 bits of RGB. When that is blitted to the display each 7+9 bits of intensity + color are looked up in a large table to determine the exact 16 bit 565 color to copy to the display.

So the conversion to full 16 bit rendering involves rewriting all the LineMap routines, not just modifications to Flush.cpp or BlitARM.s.


Dan East


I have made PGL run in 16bit. However, I added colored fogging too, which partly removed the need for intensity code (the lighting would need re-wrtiign anyway), so we just have a 16bit frame buffer and a ZBuffer. Fog values are calculated using the ZDepth and a global fog color, which is blended with the pixel color to get a final color.

In terms of speed, it's roughly the same as the unmodified PGL. (maybe a hair's width faster)



Have you modified PGL 1.2 as described in your suggestions? If so would you consider making your mods available. Happy to pay a reasonable sum


Yes, I have. Feel free to contact me on msn.(gamefreak@orange.net) (im on for a while most nights)
ok, will get in touch, I'm in the UK on GMT. What time zone are you? (ie: when's your evening)I'm doing an isometric game next then another 3D game which is part designed already. Dependant on available 3D engines I would keep on with PGL or buy another if cheap enough.
Im in the UK too, so same here. Trouble with most commercial 3d engines (FatHammer et al) is that they are prohibitivly expensive.
Please bear with me as I am a relative newbie to eVC++ 3.0, I had a semester of VC++ 6.0 but it was all console programming. I know some basics of Win32 API programming but not in eVC++.

My question right now is why do the demos not look like complete windows apps? They do not have the Winmain, etc. It appears you jump right into the coding.

Thanks!
Chris
That is in src\WinMain.cpp. If you are using the evaulation version then that routine may be inside the dll.

Dan East
the PocketGL demos are called by the main system so you have to look through all the code that's there.
See 'WinMain.cpp' etc
Thanks! I see it now, you guys are great! A big help.

In terms of reference is the book "The OpenGL Programming Guide 4th Edition The Official Guide to Learning OpenGL Version 1.4" a good one? I've seen "OpenGL Game Programming" and a "Beginner's guide to OpenGL" (or something like that) - any recommendations? Or is OpenGL too different than PocketGL for it's reference to work?

Thanks,
Chris
For most of my learning I used the NeHe OpenGL tutorials available throught www.gamedev.net
In most cases I was able to transfer the concepts from OGL to PGL. There are of course various things which OGL can do that PGL cannot.

I have not tried the books
I just picked up "OpenGL Game Programming" it is by Kevin Hawkins the CEO of GameDev.net and Dave Astle the COO of GameDev.net. The series editor is Andre LaMothe.

So far from what I read it is an excellent book! I am getting alot out of it.
trajecto wrote:Or is OpenGL too different than PocketGL for it's reference to work?

PocketGL has only very little in common with OpenGL (ES). PocketGL is best for working directly with BSPs and meshes. If you are interested in OpenGL (ES) programming, any of the resources listed here http://www.khronos.org/devu/opengles_challenge/gettingstarted.html
will get you further. In particular, there is going to be a new book by Astle et al. on OpenGL ES for game programming.

- hm
The "BSP" implementation in PocketGL is not a BSP.

Dan East
I looked at that OpenGL ES link. It looks like all you need is eVC 4.0 SP3 and the two include files and you can start programming OpenGL for Pocket PC?
trajecto wrote:I looked at that OpenGL ES link. It looks like all you need is eVC 4.0 SP3 and the two include files and you can start programming OpenGL for Pocket PC?

Well, you also need a library/dll to link against. The interesting info from the link above is that Hybrid is going to make their commercial OpenGL ES implementation freely available for Pocket PC (before 9/17). The other options at this point are klimt (initiated by Daniel or drgoldie in this forum), and Vincent (initiated by myself, also linked from the Khronos page).

Anyway, my point was more that PocketGL needs to be programmed sufficiently differently from OpenGL that the books mentioned above would be of only very little help. Of course, the basic concepts of 3d rendering apply, but for those any text on CG without specific reference to OpenGL would do as well.

- hm
I don;t want to contradict the above post however as a PocketGL user (and one of the very few to publish a game using PGL other than the author Pierre) I would like to re-state that I have successfully converted several of the OpenGL NeHe tutorials to PGL and those tutorials being crammed with general knowledge about 3D are of use to everyone using PocketGL or any similar package.

On a separate tack, can you explain what dll is needed for Vincent over & above the source download & if it's available?

I will check out the other implementations mentioned.
Conan wrote:On a separate tack, can you explain what dll is needed for Vincent over & above the source download & if it's available?

The binary download linked there is all you need. It's only that Khronos has a link on their website that says something like
Download the include files here and get started today!

and that only gets you started when you plan to develop your own implementation of the whole thing, not to use it. In particular, those files should not be used at all by a non-implementation developer, because they have not been adapted to the platform conventions yet. (Calling standards, platform types for windows and bitmaps, etc.)

- hm
trajecto wrote:Thanks you so much Conan!

I purchased the full version on Handango and had a question for Pierre and he ended up sending me: PocketGl121Full.zip

Which directory is PGL's library file in that I need to point to?

I appreciate the help getting started here a great deal.


Does this means 1 license unlimited games?
Yup...just buy the licence and you get the sources. Free to do whatever with them. Read the EULA though!
I suggest using OpenGL ES instead of PocketGL, simply because you can take advantage of hardware acceleration if available. (ie: X50v and future devices)

Tala
Unless of course you want your game to run on any of the several million other PPCs on the market besides the single model with OpenGL ES support (which still has to be hacked because they haven't even provided an SDK for it yet).

Dan East
Unless of course you want your game to run on any of the several million other PPCs on the market besides the single model with OpenGL ES support (which still has to be hacked because they haven't even provided an SDK for it yet).


I expect at the time the game is finished, there will be more devices with hardware OpenGL ES acceleration. So if one have the choice, which API to chose right now for future development, there is no way around OpenGL ES imo. Vincent ensures compatibility with legacy devices.

In addition, software 3d engines will be most likely very slow on VGA devices (without 3d acceleration). Again the solution is hardware acceleration, which can be accessed via OpenGL ES.

Tala