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 / im stuck trying to get dbBlurBitmap to work in my program

Author
Message
im not really here
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location: iowa
Posted: 14th Oct 2010 11:51
Hello,this is my first post. In currently a student going into comp sci. I'm not really going to deep in the graphics part of programming but i guess it would help to know a little.

anyway,to the point.

I have to make a program using .bmp images and land a ship on a planet.which is pretty simple...but one part im stuck...i have it looping to move my image across the screen...at the end of the loop i have to display an image make it blur...flip(pretty much do a few basic image functions)....im going to post my code so u can see and attach my file if anyone has time to help or look.

Attachments

Login to view attachments
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 14th Oct 2010 18:26
I've never used it before, but I think you only need to declare dbBlurBitmap(imgnum,amount).... Beware, large images will take a while to blur. If that's a problem, make 2 copies of each image that needs to be blured and do all the bluring before the game loop.

Also, you could stand a bit of cleanup in your code. It's a bad practice to make multiple objects that do the same thing. All of your "landship" procedures can be condensed into one:


You could have smaller code if you do the same thing to your main loop:
First make an array at the start of your code for "Times"
int Times[8];
Times[0]=2;Times[1]=3;Times[2]=4;.... and so on
then in your main loop:


I know they don't add up exactly, but you get the idea.... You'll need to modify what I gave you to match your exact needs.

The fastest code is the code never written.
im not really here
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location: iowa
Posted: 14th Oct 2010 20:32
Ok thanks for the reply, i get to that and get back with my results...might take me a while to figure out the loop you speak of...thanks again
im not really here
14
Years of Service
User Offline
Joined: 14th Oct 2010
Location: iowa
Posted: 15th Oct 2010 03:39
woo! i didn't figure out your loop but i did figure out what u meant by the setup function repeating...that actually was a problem...as soon as i got rid of that my frames were super fast...thanks a lot


got a b+ also =P
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 15th Oct 2010 16:13
np.

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-11-19 18:29:20
Your offset time is: 2024-11-19 18:29:20