Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,393 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Buttons calling functions w/ parameters, and vsync... #404172
07/04/12 04:21
07/04/12 04:21
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
Is it possible to set a parameter for a function a button is calling? For example, I want to do this:
Code:
PANEL* allthebuttons ={
   button(0,0,blah,blah,blah,NULL,NULL,superfunction(1));
   button(0,0,blah,blah,blah,NULL,NULL,superfunction(2));
}


This doesn't work, but if it did I'd be able to have one function know which button is calling it, and have it do something slightly different.

Also, I have a question about vsync. If I understand correctly, the engine will automatically activate vsync if triple buffering is not on. Is there any way to disable/enable vsync no matter what? Some people don't mind tearing, and might not want the game automatically activating vsync depending on other settings.

Re: Buttons calling functions w/ parameters, and vsync... [Re: Valdsator] #404174
07/04/12 05:54
07/04/12 05:54
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
the button id number and the panel pointer are passed as parameters to the button function:

Code:
function fncButton ( var button, PANEL *panel )



Salud!

Re: Buttons calling functions w/ parameters, and vsync... [Re: txesmi] #404218
07/05/12 05:01
07/05/12 05:01
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
Cool, thanks. laugh


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1