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 / dbMouseClick not working.

Author
Message
Seife
6
Years of Service
User Offline
Joined: 20th Jan 2013
Location:
Posted: 20th Jan 2013 19:54
Hello guys, i'm planning to start coding 2D games with Dark GDK but im stuck with an issue. My code is as follows:

It doesn't do anything though. When i remove the (int) in front of dbMouseClick it gives me an error message even though, as the documentation says, dbMoveSprite returns an integer. It says that it's impossible to convert an integral number into a pointer value. I'm stuck with that now, hope some of you guys can help me. Tanks
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 20th Jan 2013 23:42 Edited at: 20th Jan 2013 23:44
dbMouseClick() is a function. As such it must be called using parantheses, like so:


The function itself returns an int, so there's no reason to cast it to that.

Edit: oh and if you are interrested, that error is because if you use a function name without the "invokation" brackets, what you are referring to is the function pointer. You can use that to for example pass the function pointer to another function that will invoke the passed in function.


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2019-11-17 14:54:22
Your offset time is: 2019-11-17 14:54:22