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 / Help with black screen!!

Author
Message
Terrestrial Productions
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 24th Dec 2009 19:20
Hello mates, I am having a problem with the code viewer. When I debug after the screen pops up it is completely black, without any of the blue it's supposed to be without an image. Here is my code.

Thanks if someone could help me out here.


Terrestrial Productions
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Dec 2009 19:35
where's the parenthesis after dbShowObject and the others in the while loop?

Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 25th Dec 2009 00:45
Quote: "if ( JeopardyChart = true )"


'=' is for assignment; Use '==' for comparison.

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
Terrestrial Productions
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 25th Dec 2009 04:12
jason sorry but i have no clue what you're talking about. I'm kind of an ammature at c++.
Bran so are you saying that I should change it "=="?
Thanks for the help although it still doesn't solve my problem about a black screen.
Thanks gents!


Terrestrial Productions
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Dec 2009 05:00
Brian is saying that. In C++,

this is an assignment: a=1

while this is a comparison: a==1

What's also neat in C++ (and a pain ) is that an assignment returns the value of the assignment:

if(( a=1 )==1){ Will be true }

that means first in the parenthesis, the ASSIGNING of "a" by putting a "1" in it... is like a function returning "1".. which is why the == thing (comparison) will be true.

Now Brian is saying where you might of thought you were testing:

if(a=1){ do something }

you actually were assigning a value instead of comparing it against something else. So...

if(a=1)

is the same as

if(1)

with the side effect that "a" now has a value if "1" in it!!! It's both CONFUSING and super powerful! Now if only C++ had the testing capabilities of FreePascal... FreePascal guarantees that and if statement STOPS being processed once a condition of false is met. C++ I think processes the whole IF statement but I'm digressing.



Ok... NOW on to what I was asxking about. Now, I have a saying I use: Know way to many languages, master of none so I might be wrong here because I haven't been hitting C++ hard lately.. but I think like javascript you need to call functions with parenthesis even when there aren't parameters:

dbShowObject; <---- BAD (unless you want the address of the function and I don't think you are at that level of crazyness yet)

dbShowObject(); <---- Much better - you are at least calling the function... however I though with dbShowObject you have to pass the ID of the object.. but I forget...

I hope my 11pm ramblings are somewhat helpful to ya... and if they are not, there is http://www.cplusplus.com/ the tutorials there helped me greatly when I finally decided to hit C++ hard... You have to force yourself to understand the low level junk first - then things start to click when you come back to DarkGDK - I Promise!

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 28th Dec 2009 02:01
Quote: " FreePascal guarantees that and if statement STOPS being processed once a condition of false is met. C++ I think processes the whole IF statement but I'm digressing."


No, C++ has a lazy evaluator, it stops if it hits a false statement.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Dec 2009 13:29 Edited at: 28th Dec 2009 13:30
All that has been said above are true, plus: an image is not a 3D object. You won't be able to show a jpg image using dbLoadObject, dbShowObject because those are for 3D models. Use dbLoadImage, then either make sprites from the images or use dbPasteImage to display them.
bloodmage2
15
Years of Service
User Offline
Joined: 14th Jun 2009
Location:
Posted: 13th Jan 2010 04:02
maybe its just me, but
?

int is 1,2,3 etc. bool is true, false

-to the optimist, the glass is half full. to the pessimist, it is half empty, to the engineer, it is twice as big as it needs to be.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 14th Jan 2010 22:02
Quote: "int is 1,2,3 etc. bool is true, false"


Yes, but this should nevertheless work because the compiler automatically converts between bool and int. It does not look nice, though.
Terrestrial Productions
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 15th Jan 2010 03:11
I'm a ammatuer programmer. I know that now cause i'm reading the www.cplusplus.com tutorials . Old project. Like everyone else I tried to start big but i'm working on a tetris copy.


Terrestrial Productions
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 15th Jan 2010 12:56
@Zuka - Thanx for the C++ tip on lazy evaluator.

@bloodmage2 - I too find the int JeapordyChart=true; a little rough. I'm not a nut for conventions; but I do try to keep code matching the rules for the datatype. If I need to breach that; I typecast so it reads like what I'm doing.

@Terrestrial - No shame in that at all! Making a working Tetris clone is quite an accomplishment in it of it self! Don't let anyone tell you different... if they do don't listen. We all started somewhere... and FYI - the learning doesn't stop.. it's a journey.

--Jason

Terrestrial Productions
15
Years of Service
User Offline
Joined: 23rd Jul 2009
Location:
Posted: 17th Jan 2010 21:38
Thanks Jason. Most programmers I've heard of did a tetris clone as their first project. For a heads up I'm doing (respectively) Tetris, Breakout, Pac-Man, Side Scroller (like origanal Mario games), and then finally a 2-d adventure game like Runescape. If theres any tips anyone has please post


Terrestrial Productions
Cetobasilius
14
Years of Service
User Offline
Joined: 29th Dec 2009
Location: Mexico
Posted: 26th Jan 2010 10:25
As someone said above, your object is not showing because it does not even exist!, an image is not a 3d object so it is not being created. first make a plain, and then texture it with your JPG. and a boolean variable can be both FALSE, TRUE, 0 or 1 .

hi

Login to post a reply

Server time is: 2024-10-01 23:40:33
Your offset time is: 2024-10-01 23:40:33