Shard Posted April 21, 2010 Share Posted April 21, 2010 I am trying to draw an image to the screen and when using Framewerk, the image does not show up to the screen. Please see the code below: Code that doesn't [and should] work: #include "leo.h" using namespace LEO; #include "framewerk.h" using namespace leadwerks; int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nShowCmd ) { Engine engine("Zero Hour", 1024, 768) ; // Calls Initialize(), SetAppTitle() and Graphics() internally Framewerk fw; fw.Create(); TTexture texture = LoadTexture("abstract::door1.dds"); while(!KeyHit(KEY_ESCAPE) && !AppTerminate()) { DrawImage(texture); fw.Update(); fw.Render(); Flip(); } return engine.Free(); } Code that works: #include "leo.h" using namespace LEO; #include "framewerk.h" using namespace leadwerks; int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nShowCmd ) { Engine engine("Zero Hour", 1024, 768) ; // Calls Initialize(), SetAppTitle() and Graphics() internally Framewerk fw; fw.Create(); TTexture texture = LoadTexture("abstract::door1.dds"); while(!KeyHit(KEY_ESCAPE) && !AppTerminate()) { DrawImage(texture); fw.Update(); //fw.Render(); //<--------- error caused by this line Flip(); } return engine.Free(); } [Edit] Of course this is a scaled down example version from my actual game, which is very close to being completed, so I can't not use Framewerk now because too much of the project is reliant on it. [Edit] Of course since I'm not using Render, the Game World doesn't update, so I can't move around the world at all. Is this a bug or am I missing something? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Josh Posted April 21, 2010 Share Posted April 21, 2010 Why would you expect the first program to show your image onscreen? Call DrawImage() in between rendering and Flip(). Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Shard Posted April 21, 2010 Author Share Posted April 21, 2010 Why would you expect the first program to show your image onscreen? Call DrawImage() in between rendering and Flip(). Thanks, I still don't know 100% how the rendering works, so this fact slipped my mind. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.