Dark GDK tutorial issue... :s

Tutorial not even working..

Page 1 of 1

2 Replies - 2255 Views - Last Post: 04 March 2010 - 06:11 PM Rate Topic: -----

#1 TorontoKnuckles  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 24-January 10

Dark GDK tutorial issue... :s

Posted 27 February 2010 - 09:15 PM

I just got it and did the original Hello World tutorial, and I get an error with the dbLoadImage("animatedsprite.png", 1); thing, i did everything else in the tutorial and theres always a problem with that one image. I don't know if I have things setup wrong, but I have DirectX SDK august 07, I have VC++ Express, I have Dark GDK obviously too. I don't know what's wrong, help please.

// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
{
	// turn on sync rate and set maximum rate to 60 fps
	dbSyncOn   ( );
	dbSyncRate ( 60 );

	dbCreateAnimatedSprite ( 1, “animatedsprite.png”, 4, 4, 1 );
	dbSprite ( 1, 0, 0, 1 );

	// our main loop
	while ( LoopGDK ( ) )
	{
		// update the screen
		dbPlaySprite ( 1, 1, 16, 200 );
		dbSync ( );
	}

	// return back to windows
	return;
}

got these errors, same errors as all other examples:
1>------ Build started: Project: Hello World, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>c:\...\documents\visual studio 2008\projects\hello world\hello world\main.cpp(17) : error C2065: '“animatedsprite' : undeclared identifier
1>c:\...\documents\visual studio 2008\projects\hello world\hello world\main.cpp(17) : error C2228: left of '.png”' must have class/struct/union
1>        type is ''unknown-type''



Now I tried the last example in the first tutorial again and I don't get the right image on screen I just get a white screen.
 
// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
{
	// turn on sync rate and set maximum rate to 60 fps
	dbSyncOn   ( );
	dbSyncRate ( 60 );

	dbLoadImage ( "animatedsprite.png", 1 );
	dbSprite ( 1, 0, 0, 1 );

	// our main loop
	while ( LoopGDK ( ) )
	{
		// update the screen
		dbPlaySprite ( 1, 1, 16, 200 );
		dbSync ( );
	}

	// return back to windows
	return;
}

This post has been edited by TorontoKnuckles: 27 February 2010 - 09:16 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Dark GDK tutorial issue... :s

#2 lesPaul456  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 173
  • View blog
  • Posts: 729
  • Joined: 16-April 09

Re: Dark GDK tutorial issue... :s

Posted 27 February 2010 - 10:21 PM

Your code looks perfectly fine. However, from the error you're getting, it seems like you just made a typo. Try copying and pasting the code directly from the tutorial and see what happens.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Cody Oebel*


Reputation:

Re: Dark GDK tutorial issue... :s

Posted 04 March 2010 - 06:11 PM

View PostTorontoKnuckles, on 27 February 2010 - 08:15 PM, said:

I just got it and did the original Hello World tutorial, and I get an error with the dbLoadImage("animatedsprite.png", 1); thing, i did everything else in the tutorial and theres always a problem with that one image. I don't know if I have things setup wrong, but I have DirectX SDK august 07, I have VC++ Express, I have Dark GDK obviously too. I don't know what's wrong, help please.

// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
{
	// turn on sync rate and set maximum rate to 60 fps
	dbSyncOn   ( );
	dbSyncRate ( 60 );

	dbCreateAnimatedSprite ( 1, “animatedsprite.png”, 4, 4, 1 );
	dbSprite ( 1, 0, 0, 1 );

	// our main loop
	while ( LoopGDK ( ) )
	{
		// update the screen
		dbPlaySprite ( 1, 1, 16, 200 );
		dbSync ( );
	}

	// return back to windows
	return;
}

got these errors, same errors as all other examples:
1>------ Build started: Project: Hello World, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>c:\...\documents\visual studio 2008\projects\hello world\hello world\main.cpp(17) : error C2065: '“animatedsprite' : undeclared identifier
1>c:\...\documents\visual studio 2008\projects\hello world\hello world\main.cpp(17) : error C2228: left of '.png”' must have class/struct/union
1>        type is ''unknown-type''



Now I tried the last example in the first tutorial again and I don't get the right image on screen I just get a white screen.
 
// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
{
	// turn on sync rate and set maximum rate to 60 fps
	dbSyncOn   ( );
	dbSyncRate ( 60 );

	dbLoadImage ( "animatedsprite.png", 1 );
	dbSprite ( 1, 0, 0, 1 );

	// our main loop
	while ( LoopGDK ( ) )
	{
		// update the screen
		dbPlaySprite ( 1, 1, 16, 200 );
		dbSync ( );
	}

	// return back to windows
	return;
}



Take the animatedsprite.png, and edit it in mspaintshop, once you loaded it into mspaint shop just simply save it as animatedsprite.bmp.
then change it in your code to reflect the .bmp extension.
That should work!
Was This Post Helpful? 0

Page 1 of 1