Programming 2D Games

The official forum for "Programming 2D Games" the book by: Charles Kelly

It is currently Fri Feb 28, 2020 8:20 am

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Cannot display image
PostPosted: Wed May 31, 2017 9:37 pm 

Joined: Wed Mar 22, 2017 10:33 pm
Posts: 14
Hi. I have been trying to display an image, but it doesn't work. I assume something is wrong with the sprite->Draw function. My spriteData texture is not null, my rectangle has a right and bottom value of 32, the next 2 paramaters are null, and the last parameter is color. i cannot find any discrepancies in my code. What's wrong? The example works by the way. I have compared your code to my code and cannot find any differences.

Reply with quote  
 Post subject: Re: Cannot display image
PostPosted: Fri Jun 02, 2017 1:12 am 
Site Admin
User avatar

Joined: Sat Jan 28, 2012 4:36 pm
Posts: 554
Here are some things to try:

1. Check for errors when loading the texture.

2. Use the open source program "Winmerge" to compare your source code with a working example.

3. Start with a working example and modify it to create your program instead of starting from scratch.

Professor Kelly

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group