blitzmax demo

Community Forums/Showcase/blitzmax demo

Najdorf(Posted 2005) [#1]
Blitzmax is awesome... this demo shows how fast it is at drawing pixels and the cool effects of changing colors without cls




Perturbatio(Posted 2005) [#2]
nice :)

I get ~6600fps btw.


Amon_old(Posted 2005) [#3]
Cool. Make this in to a screensaver if you can.

:)


Jeremy Alessi(Posted 2005) [#4]
Very cool effect!


Najdorf(Posted 2005) [#5]
thx everyone!

actually it executes the code 50 times every frame, so it can draw without gaps (but if you move the mouse really fast you can see the gaps! i.e. it draws lines, not surfaces)

I dont know how to make it a screensaver :-( (although almost everything I do are screensavers :-P)


wizzlefish(Posted 2005) [#6]
Darn...I wish I had BlitzMAX. Or even the Windows beta. Is there a Windows beta yet?


Najdorf(Posted 2005) [#7]
yes there is the windows beta you can get it if you buy the mac version. It works pretty well although there might be some minor problems


Perturbatio(Posted 2005) [#8]
I dont know how to make it a screensaver :-(

Stick this at the top for a windows screensaver, then just rename the .exe to .scr:
If Len(appargs)>1 Then
	?Win32
		Select appargs[1]
			Case "/p" 'preview mode, next argument should be the window handle
				End
			Case "/c" 'do config mode
				End
			Case "/s" 'screensaver mode
				
			Default
		End Select
	?
EndIf

The preview mode gives the handle of the small preview window in the screensaver properties dialogue

*EDIT*
obviously, making it full screen would be a good idea also.


Najdorf(Posted 2005) [#9]
Thx

I cant make it fullscr because of the bug that flickers fullscreen when you dont call Cls.

And I didnt manage to change the extension!!! .exe is not displayed on the screen, and I dont seem to have access to it.... (Im a new windows user, I had a Mac before)


Perturbatio(Posted 2005) [#10]
in the folder where the executable is, click tools->folder options->View and untick 'hide extensions for know file types'


Najdorf(Posted 2005) [#11]
GREAT!!!!

It works!!!!!

finally I can say goodbye to the sucky windowz screensavers...

But I didnt really get what the code does nor how to display something in the small preview window, nor how to avoid the "console" to appear... Is there some simple template?

Thx again


Perturbatio(Posted 2005) [#12]
Not sure how to get rid of the console window (yet).
the preview thing is a little tricky and might require me to be more awake to do it.

When you do /p it will pass the handle of the little preview box to the screensaver, you then need to draw on top of it (not quite so easy).
A preview however is not really necessary.


Najdorf(Posted 2005) [#13]
ok, thx anyway, its enough for now


Perturbatio(Posted 2005) [#14]
But I didnt really get what the code does

The code doesn't actually make it a screensaver, all a screensaver is, is a standard windows executable renamed.

However, windows passes commandline arguments (passed by BMax into the AppArgs[] Array) which you can then used to respond appropriately.

If you were to type at the command prompt (assuming myScreenSaver.scr was in c:\scrn\):
c:\scrn\myScreenSaver.scr /s
this would launch the executable put /s as the SECOND element in the appargs[] array (the first being the full path to the program).


Boiled Sweets(Posted 2005) [#15]
Running the app in the preview is impossible under Blitz as far as I can tell but you can cheat. I have a wee VB stub that is the screensaver (i.e is called .scr), it handles the config and preview window (runs animation of Blitz program to look like its running in the preview window) and then calls the Blitz app. If you wanna take a look at it click here http://www.boiledsweets.com/vorboils/index.php

[Sorry if I'm seem to be hijacking this thread -- that is not my intention I just have been working on getting a Blitz program to run as a FULL screensaver for the last 6 months and getting close now]

There are some other issues too as a screen saver is not JUST a renamed exe you also have to handle...

Set the registry setting that tells Windows that a screensaver is running.

Disable Ctl-Alt-Delete and Alt-Tab task switching.
So users cannot switch to another application or kill the screen saver if it is password protected.

Make your screen saver always on top.
Set your main form to be always on top.

Hide the cursor.
Using the ShowCursor API so when the screen saver is displayed you do not see it.

Plus you gotta be able to handle the password on resume option.

Also to ensure that the screensaver remains in the screensaver list you have to install it to c:\windows\system32 or c:\windows. Obviously if you do install it there you really ought to...

a) have an uninstaller
b) pack data resources into the exe

And then you gotta handle configuration stuff, i.e. allow the screensaver to run in the desktop resolution. To do this you need to make Windows32 API calls within the Blitz program to determine the desktop depth etc...

Good luck.


Perturbatio(Posted 2005) [#16]
Running the app in the preview is impossible under Blitz as far as I can tell


You do know this is a BMax program not a B3D one yes?


Mr. Write Errors Man(Posted 2005) [#17]
If you get the handle to the preview window, you can get a DC handle for it with GetDC Windows API function. Then you can draw directly into that hDC.

I don't know BlitzMax, so I have no idea if you can blit a BlitzMax surface into a hDC. If you can't, you still could use Windows GDI Api functions to draw ovals and lines on the preview window.


Boiled Sweets(Posted 2005) [#18]
I have heard it can be done but never seen anyone able to do it.