Flashlight For Gp2X Wiz


jwm2

Still Fresh
Joined
Jul 20, 2009
Messages
12
Heres a flashlight application i created for the GP2X Wiz. It only took 3 lines of code to create :) Now the handheld we all love has a useless app just like the iphone ;)
 
Its up to you folks, i don't mind if its deleted or moved.
 
If you permit me, I want to show some tricks:

You don't need a white bitmap image, you can use a function to fill the screen in white colour.
Then, you can use a little image for the title if you want.

Code:
SDL_Rect rect = {0, 0, 320, 240};
Uint32 colwhite = SDL_MapRGB(screen->format, 255,255,255);
SDL_FillRect(screen, &rect, colwhite);

And finally, don't link with SDL_mixer library, you don't need it.
Regards.
 
Spykez said:
michaeljustman said:
Is it open-source? :p

plan on making it a disco ball light?

Just joking, but actually it wouldn't be a bad idea to have it also do red light, for light discipline in the field. We use red lensed flashlights when we absolutely need to use a light source sometimes (instead of night-vision goggles).

Not that I actually plan on using it in the field, but red light would be easy to see by without waking up one's wife (with a bright white one) when you sneak in the house at 2am. :p
 
Last edited by a moderator:
Actually an app like this should also do a pure yellow screen. Why? Because OLEDs wear out the blue emitters first while the red and green last much longer. So if the screen starts to age after allot of use a yellow screen could be displayed to even out the wear.
 
I used to use the light function on my cell phone all the time, but after upgrading to the newest model of the type of phone I had, they seemed to have removed that feature (despite it still having a light for the camera)! So this is a pretty nice program for me. My only question is: is there some way to quit the app without restarting your Wiz? I tried frantically hitting button combination but none seemed to work.
 
You just push any button and it should quit the app. I did notice that when running it twice in a row the second time it freezes and needs a reboot to get it working again, i'm not sure why. There are literally 3 lines of code, its the simplest app you could possibly make with some function and use. The 3 commands and lines used are the loadbmp, keywait and end, in that order. I also added a line in the beginning to start it fullscreen, even though its not really needed for this app. Anyhow i can add some more features to it in a few days, i'll add a black screen, yellow screen, red screen to it and update the release. Thanks for the feedback. If anyone knows what could be causing it to freeze on exit the second time the app is loaded i'd appreciate the feedback, i can't figure out what would cause that, the code is literally as basic as it gets ;)
 
Hardyx said:
If you permit me, I want to show some tricks:

You don't need a white bitmap image, you can use a function to fill the screen in white colour.
Then, you can use a little image for the title if you want.

Code:
SDL_Rect rect = {0, 0, 320, 240};
Uint32 colwhite = SDL_MapRGB(screen->format, 255,255,255);
SDL_FillRect(screen, &rect, colwhite);

And finally, don't link with SDL_mixer library, you don't need it.
Regards.

The only thing is thats 3 lines of code to do what one loadbmp line does with only a dozen characters. Not to mention i can change the bitmap image to say whatever i want with ease and keeping the code as simple as possible. But i may take your code and use it when i redo the app to display different colors, or i may just make 3 other bitmap images, hard to say right now.
 
Last edited by a moderator:
JWM2 it freezes after the second time you start it because of GLBasic. There is the new GLBasiv v7 Beta where the problem is solved now.
 
momosxp said:
JWM2 it freezes after the second time you start it because of GLBasic. There is the new GLBasiv v7 Beta where the problem is solved now.

Oh cool, ill grab that and recomplie it. Thats a relief, i couldnt figure out what the problem was the other day, it was driving me nuts :/
 
Last edited by a moderator:
Ok well forget it. Someone else has released another flashlight app. From this point on i don't plan on supporting the app any longer. In fact i have several other games and projects i was working on at the same time and don't plan on releasing them for the wiz due to this backstabbing. Goodbye.
 
Well if you are going to act like that then do we really want you here as part of the community? I mean the PSP community may find behaviour like that to be the norm but that is certainly not the case here. Relax, I highly doubt someone released another flashlight app (not a massive feat to create if you know what you are doing - maybe 5 minutes of work?) specifically to spite you. Infact I shall quote the first line from the description of the new app on the archive:
Another flashlight app. (JWM2 already wrote one, He had this idea before :) )
 
greenmikey said:
I keep reading fleshlight instead of flashlight when I read this on the front page.

Me too. My brain must be truely corrupted <_<
 
Last edited by a moderator:
Back
Top