Jump to content
  • Advertisement
Sign in to follow this  
garyfletcher

Small problem with SDL_SetAlpha()

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. I've almost got everything working on my mouse. I've just got 1 small problem. That I've been looking at for HOURS, so I thought I'd ask some of you nice people to lend a hand. Anyway. I've got my SDL engine, that takes over control of the mouse when it's instansiated. I've added functions to disable, enable, toggle the mouse and these work very nicely. My problem seems to be when I change the alpha setting of the mouse sprite to make add transparency. When it's solid (alpha 255) everythings fine, but when the aplha settings anything else I get the mouse cursor being traced all over the screen. The mouse project can be found here. Am sorry that it comes with extra source code but the moudles that are being used are SiSEAnimation, SiSEBaseSprite and SiSECursor, oh and main. It's C++ and built with DEV-C++. If you take a look then I extend my thanks to you...and if not then thanks for reading anyhow. The code is all my current SDL engine source, so please feel free to look and play and improve, comment or whatever with the other stuff as well. Thanks Again. [Edited by - garyfletcher on May 26, 2005 8:39:50 AM]

Share this post


Link to post
Share on other sites
Advertisement
tried to compile but i didnt have boost/function.hpp. well since i cant see how it looks its hard to guess whats wrong.. have you tried with different colorsettings? (16/32bit)

Share this post


Link to post
Share on other sites
Yes...same thing happens...boohoo!!!!

Sorry about the boost library thing...forgot that I was using that...darn. That's going to ct down on the number of people that can try it out...BOOHOO!!!

I would recommend using it. The functionality that I'm using...mapping function pointers...does make things easier.

Share this post


Link to post
Share on other sites
Okay...sorted it out.

If anyone's interested it's because I wasn't working with the correct animation.

To correct it either add the following to the gamePlay() function in main.cpp before trying to set the alpha value:

aCursor->mSetAnimKey(CURSKEY);

Or add the following to the mProcessClrCursor() function in the SiSECursor class before returning:

mAnimKey = mCursAnimKey;

Thanks if you took a look. And anyone interested in contributing to the engine then even better..:)

Now to try to sort out the problems of running FULLSCREEN...anyone?

EDIT: Sorted..:)

[Edited by - garyfletcher on May 26, 2005 11:21:37 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!