Jump to content

Recommended Posts

Posted

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?

simpleSigPNG.png

 

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

Posted

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.

simpleSigPNG.png

 

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...