Make games that sell. |  |
KSpline
> Introduction
> Examples
> Showcase
> Documentation
| KWindow
| KGraphic
| KMiscTools
| KInput
| KText
| KTrueText
| KSpline
| KWeb
| KIniReader
| KResource
| K3D
| KSound
| KSound2
> History
> Download
> FAQ
> Credits
| Learn how to open a window and display a picture with PTK. #include "ptk.h" KWindow *ourWindow = NULL ; KGraphic *ourPicture = NULL ; //according to your operating sytem the entry point is slightly different #ifdef WIN32 int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPreInst, LPSTR lpszCmdLine, int nCmdShow ) #else int main( void ) #endif { ourWindow = KPTK::createKWindow( K_OPENGL); if( ourWindow == NULL ) return 0 ; ourWindow->createGameWindow( 640,480,-1,true,"test window" ); ourPicture = KPTK::createKGraphic( ) ; ourPicture->loadPicture( KMiscTools::makeFilePath( "image.jpg" ) , true, true ) ; do { ourWindow->setDefaultWorldView( ) ; ourPicture->blitAlphaRect(0,0,640,480,0,0 ) ; ourWindow->flipBackBuffer( ) ; }while( ourWindow->isQuit() == false ) delete ourWindow ; delete ourPicture; return 0 ; }
© 2003-2006, Phelios, inc. - All rights reserved. Trademarks mentioned are the property of their respective owners.