# Allegro Question (cursor)

## Recommended Posts

Ok, ive been messing with allegro lately, and im trying to learn more about the mouse functions, so far i havent had much luck. I tried setting a custom cursor, with:
show_mouse(screen);

BITMAP *buffer = create_bitmap(640, 480);  //dk if i even need this line

void set_mouse_sprite(BITMAP *crosshair);
But it didn't work, any suggestions? And one more question, how would i make it so that i can have a GUI in Allegro, like a game menu, or would i have to use something different then allegro. Thanks FOr any help! (what i was using: http://alleg.sourceforge.net/stabledocs/en/alleg004.html)

##### Share on other sites
One of your lines is a function declaration. Guess which one.

##### Share on other sites
void set_mouse_sprite(BITMAP *crosshair);

i think...

But how do i fix it, if i take out void, i get an error.

##### Share on other sites
A good first step would be to read up on functions again, but quickly:
a function declaration:void set_mouse_sprite(BITMAP *crosshair);a function definition:void set_mouse_sprite(BITMAP *crosshair){  // stuff}a function call:set_mouse_sprite(crosshair);

Compare and contrast.

##### Share on other sites
ooooooo, got it now, thanks dude!

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627675
• Total Posts
2978569

• 11
• 11
• 10
• 12
• 22