us-east-1

Saver Max2D for Blitzmax

Community Forums/Showcase/Saver Max2D for Blitzmax

Red(Posted 2005) [#1]


SaverMax2D module provides a set of commands for coding screensaver.

Download : SaverMax2D.zip
Download : Example.zip (simple example, advanced example, saver tools)


Features :
-----------
- DirectX driver
- Fullscreen mode
- Preview mode
- AboutBox
- AboutBox pixmap logo
- Saver debugger dialogbox
- Saver icon
- Saver longname
- doc
- Saver_Converter.exe ' convert .SCR.EXE file -> .SCR file
- Saver_Resource.exe ' compile windows bbresource : icon & strings

How to install MINGW & SaverMax2D :
---------------------------------------
1. Install Bmax 1.10 or higher
2. Install minGW
Add 'c:/mingw/bin' to your PATH env variable
Add 'c:/mingw' to your MINGW env variable

3. Extract 'winsaver.mod' to your 'mod/pub' directory.
4. sync your docs
5. When you finished setting, you must restart your Bmax IDE.

How to create a fully functionnal saver :
------------------------------------------
' optional part
1. Place a 'bbicon.ico' file in your project directory.
2. Place a 'bbstring.txt' file in your project directory.
3. Start Saver_Resource.exe
-> create bbresource.o

' main part
4. Compile your project: saver.scr.bmx
-> create saver.scr.exe
5. Start Saver_Converter.exe
-> create saver.scr

' Test your saver
6. Right-click on your SCR file and select INSTALL


Red(Posted 2005) [#2]
Strict 
Framework PUB.WinSaver 'Saver directX framework 
Import "bbresource.o"  'Saver resource : icon & longname
Import BRL.PngLoader   'PNG support

' ----------------
' saver config 
' ----------------
Incbin "bblogo.png"    'Saver logo
Local saverLogo:TPixmap=LoadPixmap("Incbin::bblogo.png") 
Local saverTxt:String 
	saverTxt:+" Blitzmax Screensaver "
	saverTxt:+"~n~npowered by~n BlitzResearch.com "
	saverTxt:+"~n~nwritten by~n Ed From Jupiter "
AboutSaver saverTxt,300,250,saverLogo
saverLogo=Null;FlushMem 

' ----------------
' saver graphics 
' ----------------
Local saverMode$  =CreateSaver("Greeny Feeling")
Local saverWidth  =GraphicsWidth()
Local saverHeight =GraphicsHeight()
 
'saver customization : FULLSCREEN / PREVIEW 
Local x#,y#,size
If (saverMode$="FULLSCREEN") 		
	SetClsColor 66,128,66
	size=50
Else 
	SetClsColor 66,200,66
	size=10	
EndIf 

' ----------------
' main loop	
' ----------------
Repeat 
	Cls 
	x=x Mod saverWidth +1
	y=y Mod saverHeight +1
	DrawOval x,y,size,size 
	Flip 
	FlushMem 
Until KeyHit(KEY_ESCAPE)

' ----------------
' end
' ----------------
End 



Paul "Taiphoz"(Posted 2005) [#3]
import brl.d3d7max2d

?? Cant find that.


Steve Elliott(Posted 2005) [#4]
Yavin have you downloaded BlitzMax 1.10 and synced mods?


Fredor(Posted 2005) [#5]
Download the BMAX 1.10 and synchronize Moduls over the Internet. Then it should work. Itīs a new Module.


Boiled Sweets(Posted 2005) [#6]
Doesn't run...

I get ....

Building saver.scr
Building windows icon
bmkOLD.exe makeapp -d -t gui -o C:/tempy/For CD/SaverMax2D/SaverExample/saver example/saver.scr.debug "C:/tempy/For CD/SaverMax2D/SaverExample/saver example/saver.scr.bmx"
bmk commandline error
Usage: bmk operation [options] [parameters]
Operations:
makeapp Make application
makemods Make modules
cleanmods clean modules
listmods List modules
modstatus Module status
syncmods Synchronize modules
zapmod Zap module
unzapmod Unzap module
ranlibdir ranlib dirtree (MacOS)
docmods Create module docs
syncdocs Synchronize doc indexes
convertbb Convert .bb file to .bmx
Options:
-q Quiet mode
-v Verbose mode
-a Make all
-d Debug mode
-r Release mode
-k Kill source (danger!)
-t apptype Specify App type (console,gui)
-o outputfile Specify output file
-f framework Specify framework

Process complete


Boiled Sweets(Posted 2005) [#7]
Now get C:/Program Files/BlitzMax/bin/ld.exe: cannot find

Any idea?


Red(Posted 2005) [#8]
Oops I forgot to upload the new compiler 8-U


Red(Posted 2005) [#9]
- Download Link Fixed -

I plan to add DLL support.


Boiled Sweets(Posted 2005) [#10]
Now get....

C:/blitzmax/mod/pub.mod/winres.mod/winres.o: file not recognized: File truncated


Boiled Sweets(Posted 2005) [#11]
So I have to move my BlitzMax from c:\program files\bltizmax to c:\bmax...

Not nice.

How do I fix the C:/blitzmax/mod/pub.mod/winres.mod/winres.o: file not recognized: File truncated

problem?


Red(Posted 2005) [#12]
I don't know.

Could you show me your RC file content ?


Boiled Sweets(Posted 2005) [#13]
Erm whats RC?


Boiled Sweets(Posted 2005) [#14]
winres.rc is 0 bytes


Red(Posted 2005) [#15]
Is it a read-only file ?


Boiled Sweets(Posted 2005) [#16]
no - should it be?


Boiled Sweets(Posted 2005) [#17]
OK I have copied the winres direcotry back again...

The winres.rc file contains a line...

1 ICON "C:/bmax/samples/PERSO/QUICKS~2/bbicon.ico"

This file does not exist!

AQRRGGHHH!

How does one use this library?????


Boiled Sweets(Posted 2005) [#18]
Renamed the bmk.exe back and works now. Why do we have to rename it?[


Red(Posted 2005) [#19]
My bmk should compile windows resources (icon and/or strings) before calling bmkOLD.
It writes two files 'winres.rc' and 'winres.o' in 'pub.mod/winres.mod' folder

And if you compile a .scr.bmx, it will export directly a .scr file.


Boiled Sweets(Posted 2005) [#20]
Also I have a different bbicon.ico in the directory and it doesn't pick it up. HELP!


Boiled Sweets(Posted 2005) [#21]
But that means that other bmx files won't work?

Where should I put my icon?


Red(Posted 2005) [#22]
Did you install mingw ?

You should put 'bbicon.ico' and/or 'bbstring.txt' in your project directory.

myproject/file.bmx
myproject/bbicon.ico
myproject/bbstring.txt


Boiled Sweets(Posted 2005) [#23]
mingw? No! Should I?


Boiled Sweets(Posted 2005) [#24]
If I rename bmk.exe other bmx don't build. In fact the saver.bmx.scr doesn't build either!


Red(Posted 2005) [#25]
You should install it.
bmk uses MinGW for compiling mods, resources or DLLs


Boiled Sweets(Posted 2005) [#26]
If I rename bmk.exe other bmx don't build. In fact the saver.bmx.scr doesn't build either!


Boiled Sweets(Posted 2005) [#27]
With the bmk.exe renamed to bmkold.exe and the other bmk.exe dropped in there and winGW installed it is does is...

Building saver.scr
Adding windows strings...

Process complete

It does not build an exe though!


Red(Posted 2005) [#28]
In this case, it should build a SCR file not a EXE file.

saver.scr.bmx -> saver.scr
saver.bmx -> saver.exe


Boiled Sweets(Posted 2005) [#29]
It creates nothing - no exe or scr!

HELP!


Red(Posted 2005) [#30]
sorry I've no more ideas about this problem


Paul "Taiphoz"(Posted 2005) [#31]
1.10 wtf ... lol looking for it now.


ImaginaryHuman(Posted 2005) [#32]
Is Mac/Linux compatibility on the way?


Red(Posted 2005) [#33]
No

But Stuc will make cross-platform version : http://www.blitzbasic.com/Community/posts.php?topic=47231&hl=screensaver


MErren(Posted 2005) [#34]
Hi,
can somebody do a little Tool (bridge) to Blitz3d?

Greet Micha


Liquid(Posted 2005) [#35]
Very strange what is happening to me.
I installed the module as was said. when i compile any source i get the error:

Linking:saver.scr.exe
D:/Program Files/BlitzMax/bin/ld.exe: cannot find

I renamed the ldOLD.exe to ld.exe again but the problem persists...

Anyone knows what to do??


Edited:
Ok, I noticed that the problem disappears when i remove the winres.mod. But like this i cant use the saver module. Any ideas?


Red(Posted 2005) [#36]
Did you set your env variables PATH & MINGW ?


Liquid(Posted 2005) [#37]
Yes. That is all set. I had no problems building modules until i tryed to install the saver module.

What is strange is that the path given by the error message is correct...


Boiled Sweets(Posted 2005) [#38]
Liquid,

i had the same trouble - and have given up - it's a shame because this could be a grat tool


Liquid(Posted 2005) [#39]
Is it just me an Boiled Sweets that have this problem?


CoderLaureate(Posted 2005) [#40]
Same problem here. Goes through the build. But produces no output at all.

Man this thing is buggy.

It assumes our BMax installation is in the root directory. I moved it to the root. It keeps telling me that it can't find the winres.o file.


Red(Posted 2005) [#41]
Ok forget BMK addon, I'll make a simple EXEtoSCR converter


Boiled Sweets(Posted 2005) [#42]
Nice one ED. You rock!


netmaestro(Posted 2005) [#43]
This categorically does not work. Please amend the installation instructions or take the software down. I wasted two hours on this trying to get it installed. And please - nobody is going to feel comfortable with replacing bmk.exe and potentially destroying their installation or introducing bugs into their other projects.


Red(Posted 2005) [#44]
@netmaestro
Don't use my BMK.
I said it does not work.

@All
Sorry, the new 'sync' version of bmax has broken my lib again.


Red(Posted 2005) [#45]
Updated saver example & saver module

- added: AboutBox logo
- removed: BMK compiler addon
- added: SaverConverter tool
- added: SaverResource tool
- updated: doc




Boiled Sweets(Posted 2005) [#46]
The two exe's don't do anything!

Also how do you install this?

PLEASE PLEASE PLEASE some simple documentation!


Red(Posted 2005) [#47]
ok


Red(Posted 2005) [#48]
How to use saver tools : look above...


Boiled Sweets(Posted 2005) [#49]
Ed, my humbles apologies!

I'll try it over the weekend and report back. Thanks for all your help


netmaestro(Posted 2005) [#50]
OK I followed all directions faithfully. When I ran saverresource.exe its output was a zero-length file. I then got the following output from the compiler:

Building saver.scr
Compiling:saver.scr.bmx
flat assembler version 1.51
3 passes, 8219 bytes.
Linking:saver.scr.exe
D:/BMAX/SaverMax2D/SaverExample/SaverExample/bbresource.o: file not recognized: File truncated

Process complete

Please help us Ed. A lot of us would be thrilled with this mod if we could JUST get it working!


netmaestro(Posted 2005) [#51]
Just one other thing: I noticed that when I ran the example you provided, the one that works, the little balls raced on the preview screen but when running in normal saver mode they were very slow. I've seen this before and the reason for the difference is usually that the programmer making the saver drew a sized window for when running in preview mode. If you are doing that, I'm happy to tell you it isn't necessary. Your savers will work much better if you don't. All you have to do is set the parent/child relationship of the app window to the preview window, issue your preferred flavor of placement command, ie setwindowplacement, setwindowpos, movewindow, etc. which will also size your window, and that's it. Your 800 x 600 (or whatever) window will automatically be scaled by Windows to run in the space provided for it. So you just have to check for the /p parameter and if you get it, take the window handle that gets passed in the third parameter, use it with your app handle to set parent, set position, then just run normally. Your mod doesn't seem to include source so I can't see what it is you are doing in there, but it really doesn't need to be any more than that. (for preview mode. config mode is something else).


Red(Posted 2005) [#52]
* UPDATE 24/06/2005 *
I included two examples in SaverExample.zip ( simple example and advanced example )

@netmaestro
When I ran saverresource.exe its output was a zero-length file.

Always the same problem... You seems to have a problem with your MinGW installation. Did you set your env variables ?
Env variable system really sux :-/


the little balls raced on the preview screen but when running in normal saver mode they were very slow

- CreateSaver command works like Graphics command ( sync your docs and press F1 to see the command help)
- Unlike Graphics command, some parameters ( hertz, width and height ) are ignored when preview mode is enabled.
- By default, preview mode uses 'nosync' refresh mode and preview window size. That's why it seems to be faster.

If you want a faster fullscreen mode:
CreateSaver$(title$,width=SCR_DESKTOP,height=SCR_DESKTOP,depth=16,NOSYNC,saverflags=SCR_DETECTALL , exitKey=KEY_ESCAPE)



netmaestro(Posted 2005) [#53]
OK, I found the problem. Your instructions say to add c:/mingw to my MINGW environment variable and c:/mingw/bin to my PATH. It should have read:

Add the following to your PATH:

c:/mingw;c:/mingw/bin

Based on your instructions I had created a MINGW environment variable and set it to c:/mingw and that is what my problem was. I deleted that and did the above and it works fine now. Thanks E from J.


Nikko(Posted 2006) [#54]
All the links are dead!


LineOf7s(Posted 2006) [#55]
Since they're all from a year ago then yeah, they probably are.


Grisu(Posted 2006) [#56]
Maybe this module has been updated in the meantime?!?


serverman(Posted 2006) [#57]
These aren't...

http://ed.folio.free.fr/download/SaverMax2D.zip
http://ed.folio.free.fr/download/SaverExample.zip