View Full Version : PTK - How to?
EpicBoy
10-14-2004, 10:25 AM
I downloaded PTK last night and had a quick play. Thanks to the amazing tutorial written up at Laughing Dragon, I had a test harness up and running in no time flat. I loaded a few textures, displayed them, etc. Just putzing around and it seems like a nice library for 2D games.
Is there a decent set of tutorials anywhere on the net? The examples they provide are kind of bland and their forums are all but dead...
Mark Fassett
10-14-2004, 10:37 AM
You can check out my Antigen game - it's got the source code with it http://www.laughing-dragon.com/antigen.aspx which you can use all you want. Tutorials are in short supply, though. I have plans to write some more, but I just don't have the time at the moment.
Dan MacDonald
10-14-2004, 10:41 AM
Ironically most of the support for PTK comes over msn messenger. Between running his own business, building games, and supporting PTK Patrice is pretty busy. I will say this though, he is always fast to respond if there is something that would make your life easier or if you find a bug. Mark and I both try to help out when we can with tutorials and such (I recently posted the animation and picturegrid classes I used in Little Soldiers) we find it's easiest just to help people out directly. If you have any questions feel free to add me to your msn danmac@rainfallstudios.com or ICQ# 539334
EDIT: Bring it on spammers! i'm ready for ya!
EpicBoy
10-14-2004, 10:48 AM
OK, fair enough.
Just as a curiosity ... can you guys tell me your top pet peeve about PTK? What drives you crazy and you wish it handled it better? :)
Dan MacDonald
10-14-2004, 10:56 AM
The only issue I ran into recently is that the windows message pump and the mac equivelant aren't exactly the same. For instance there's no WM_MOUSE_MOVE equivelant on mac. You can work around it by querying the mouse coordinates and comparing it with the last known; but it makes porting require you to think a little bit. It's not much effort to make the fix, maybe 10 m in of work but still it would be nice if there was a platform independent way to not have to worry about it. I've been talking to Patrice and we have a good solution for it, he's visiting his parents right now but should be able to implement it when he gets back.
In general though, anything I've found annoying has been quickly fixed by Patrice, he's very good about that.
Mark Fassett
10-14-2004, 10:58 AM
The sound library is a bit immature compared to the rest of it, in my opinion. It works well for most things, but it doesn't yet compare to fmod. However, it's certainly usable if you don't want to fork out the extra cash for fmod.
Mark Fassett
10-14-2004, 11:03 AM
Oh - and I sent you a PM with my messenger ID - I'm not nearly as brave as Dan :)
lakibuk
10-14-2004, 12:33 PM
Made the mac port of my game with PTK together with patrox.
Found it pretty easy and intuitive to use.
The most annoying thing? That you can't blit to offscreen surfaces. Patrox told me it's not possible in opengl.
Dan MacDonald
10-14-2004, 01:54 PM
Well, PTK uses openGL, so it doesn't quite have the concept of memory buffers the way a typical 2D library does. PTK operates under the principle of quad's and textures, to be able to blit to a buffer in the PTK world would be like blitting to a texture. That's not an operation most 3d API's or Graphics cards support.
PTK does have a makePictureFromArray( ) function that can create a texture from a chunk of memory, so technically if you really wanted the feature you could blit stuff to the memory buffer then make a picture (texture) from it and display it. I find the cards are fast enough that you can just combine blits on the screen's backbuffer and it's plenty fast, even if you do it every frame.
lakibuk
10-14-2004, 01:57 PM
@Dan: good to know,thanks.
Bluecat
10-14-2004, 03:57 PM
Dan,
Just a couple of questions. You seem rather taken with PTK. What's so good about it? Can you tell me why PTK is better than SDL?
Mark Fassett
10-14-2004, 04:11 PM
In my experience, it's faster and easier and works better. It has good alpha support (do to using 3d hardware), and rotation. The shadows in my game Derelict would have been near impossible to do fast in SDL, but in PTK, it's just making a glColor call and calling KGraphic::blitArbitraryRect() to skew the image. And if you're paid up, you can usually get bug fixes or feature requests in a day.
Dan MacDonald
10-14-2004, 04:15 PM
Well I was using Allegro before, a native 2d library and while it was easy to use it just wasn't all that performant. SDL is reasonable, however it just provides direct access to memory etc with a few simple operations (last I checked, I'll admit to not using it much). PTK is HW accelerated so you can easily use things like 16bit graphics and alpha blending stored in the image format, it also provides a host of bitting features for drawing just about any way you can imagine. The PTK distribution also includes lua so that is available to you right of the bat as well.
For me PTK is great because of
1.Ease of portability (most of my sales are mac)
2.Ease of use
3.HW Accelerated performance
I know the artists I've worked witih have really apreciated being able to work in 16bit color and just drop their art into the game without having to worry about matching it to some global palette before viewing it in game.
Bluecat
10-14-2004, 04:30 PM
Thanks guys,
I'm downloading it now for a look.
Pyabo
10-14-2004, 11:02 PM
Does PTK use OpenGL on Windows as well as Mac? If so, don't you run into the same trouble that Cas has with his game, where some people just aren't set up for OpenGL support? What was Cas's statistic, something like 20% of users had trouble with this?
Mark Fassett
10-14-2004, 11:23 PM
It uses OpenGL everywhere. There is a way to detect whether or not the software drivers are being used, and then you can pop up a page telling them how to update their drivers, or whatever else you might want to do. Unfortunately, I don't have any way to track how many people can't play on windows because of crappy drivers or whatever.
Jack Norton
10-15-2004, 03:57 AM
Here is someone who passed from knowing NOTHING of C (I was using blitzbasic) to make a game every 2 month with Visual C+PTK...
So it is really very easy to use. It is also fast in my experience.
never had someone complaining that they couldn't run the game because of OpenGL problems, instead I still get 1-2 mails / month from people that has problem running USM (that was written in blitzbasic and should support DX7...ahem... :mad: )
princec
10-15-2004, 04:25 AM
...which is kinda strange really because quite a lot of Windows users don't have GL drivers installed.
Cas :)
20thCenturyBoy
10-15-2004, 05:40 AM
...which is kinda strange really because quite a lot of Windows users don't have GL drivers installed.
But ATI and Nvidia users will as OpenGL is included in the drivers you get with the card or d/l from their sites. Do you mean Windows users who have S3/Intel cards etc?
20thCB
princec
10-15-2004, 06:35 AM
Yes. There's a suprising and dismaying number of horrible Intel chipsets about. I couldn't care less about S3 or Matrox, as they have such a pitiful share of the market (and that's hardly surprising given how poor their offerings are compared to the competition)
Cas :)
EpicBoy
10-18-2004, 04:42 PM
I'm -finally- getting around to having a bash with PTK. Am I correct in my understanding so far that in order to change the color of any quads I'm blitting, I need to use glColor functions?
Or, I guess my question really is ... is it expected/normal that if I don't find something I need in the PTK API, I'll just use the appropriate OpenGL command myself?
patrox
10-18-2004, 11:31 PM
I'm -finally- getting around to having a bash with PTK. Am I correct in my understanding so far that in order to change the color of any quads I'm blitting, I need to use glColor functions?
Or, I guess my question really is ... is it expected/normal that if I don't find something I need in the PTK API, I'll just use the appropriate OpenGL command myself?
That's right.
pat.
princec
10-19-2004, 02:00 AM
It is possible, he's just too lazy to implement it ;)
Cas :)
EpicBoy
10-19-2004, 04:32 AM
patrox
OK, thanks! Just wanted to make sure I wasn't doing something monumentally stupid. :D
Powered by vBulletin™ Version 4.1.3 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.