Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Please help. I cannot load image for cube texture

Author
Message
hungvv
15
Years of Service
User Offline
Joined: 22nd Feb 2009
Location:
Posted: 22nd Feb 2009 19:01
Hi everybody. I'm just learn Dark for a few days and i don't know much. Yesterday i make this code
#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);

dbMakeObjectCube(1,50);
SetCurrentDirectory("media");
dbLoadImage("texture1.jpg",2);
dbTextureObject(1,2);
dbPositionCamera(0,30,-100);
// our main loop
while ( LoopGDK ( ) )
{
dbTurnObjectRight(1,1);
// update the screen
dbSync();
}

// return back to windows
return;
}

My problem is the texture of the cube; sometime the cube is textured and sometime is not.
The cube must be this:

But it sometime be this:


Could u please tel me why?
Thank u very much! and sorry for my bad english!
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 22nd Feb 2009 19:54
When you say sometimes, you means during the run it changes, or different times you run it. The only thinf I can think of is that sometimes you have the texture open in an editor, and GDK cannot load it then.
hungvv
15
Years of Service
User Offline
Joined: 22nd Feb 2009
Location:
Posted: 24th Feb 2009 03:15
Sorry if I didn't said clearyly.
I mean different times i run; Almost times i debug it's a white box but a few times it show texture. Even after I stop debugging a fine texture box and run again, it's a white box.

One again I get problem with the Terrain sample. When I run the original sample everything was fine but when I code myseft (ofcourse I copy skybox2.x in to project folder) the skybox is only white no clour, no mountain, no river... nothing except a white box only the terrain still shows.

Could somebody help me. Thanks

Login to post a reply

Server time is: 2024-09-30 19:26:51
Your offset time is: 2024-09-30 19:26:51