Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  turn your demos into (win32) screensavers  (Read 5295 times)
0 Members and 1 Guest are viewing this topic.
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Posted 2004-03-22 21:11:02 »

JScreenSaver (41kb)

---

The little package contains a bunch of files:

A little demo:
demo/demo.jar
demo/demo.scr

And the source:
src/icon.ico (ultrasweet 80ie flavoured icon Grin)
src/jsaver.cpp
src/PlasmaFS.java

---

It's pretty simple and easy to use. The doubleclickable jar and the scr need to be in the same directory and both files must have the same basename (eg moo.scr -> moo.jar or test.scr -> test.jar). So... there is no need to recompile it. Rename it and you are done Wink

The scr does absolutly nothing except launching a jar file with the same basename as itself. It doesnt care about a preview, password, change password, configuration or exiting of your programm. Just make sure that your java application exits if any event occurs (key, mouse or mousemotion) and it will just behave like any other screensaver.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
enableEvents
(
      AWTEvent.KEY_EVENT_MASK|
      AWTEvent.MOUSE_EVENT_MASK|
      AWTEvent.MOUSE_MOTION_EVENT_MASK
);
[...]
public final void processEvent(AWTEvent e)
{
      run=false; //die! die! die!
}


That usually does the trick (for Java2D stuff)... well ok <tab> and mwheelup/down doesn't exit the programm, but I guess it's good enough for a little demo.

---

The license is - do what you wanna do with it and don't sue me Tongue

That process creation part is (iirc) from jbanes, that for(;; ) snipped is from a forum and the other ugly pieces of bad C code were added by me... oh and I pixelated that icon Wink

If you add something usefull, make it public for the community. Thanks Grin

弾幕 ☆ @mahonnaiseblog
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #1 - Posted 2004-03-23 11:44:54 »

Ahem... just did a google search... there is already a sf project called the same and it also does the same... Roll Eyes

Well... mine is smaller and I learned something very important: C/C++ is damn ugly Grin

弾幕 ☆ @mahonnaiseblog
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #2 - Posted 2004-03-27 04:50:59 »

well C/C++ with Microsoft API's is more ugly than your usual garden variety ugly C/C++ Wink

Cool program I must say.  It ran for me fine when I tested it (by double click on the .src) - but for some reason it wouldn't start after 1min like the SS normally does.  I tried other SS's and they worked so I don't know why yours wouldn't autostart.

Also - I know you don't have a preview, but could you just have a static image?  That would make it look much cooler.  Say demo.jpg?

Cheers,

Will.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #3 - Posted 2004-03-31 05:36:04 »

>but for some reason it wouldn't start after 1min like the SS normally does.

Hmm... that's odd. It was successfully tested under 98, 2k and XP. The starting itself is handled by the operating system... everything it actually does is calling the src (like an exe) with an "s" switch. (It's called every time. For preview, configure, changepassword and running - each time with another switch).

However, it should just work if you choose right click -> install (screensaver configuration dialog pops up) and press then ok.

>Also - I know you don't have a preview, but could you
>just have a static image?  That would make it look much
>cooler.  Say demo.jpg?

That would be indeed pretty neat. But I would need to care about that on the C/C++ side... and I'm rather clueless. TGA loading would be much easier (already done that), but drawing into that... erm... thing looked kinda odd (couldn't figure out how it works).

弾幕 ☆ @mahonnaiseblog
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #4 - Posted 2004-04-03 12:35:23 »

probably just a crappy windows install (it is) but I'll try the right click thing too.

again, great stuff - the drawing thing'd be a nice feature but it's still good without it.  I wounder if there is a screensaver forum that could help?

I did a quick google - is this of any help? http://www.alexchirokov.narod.ru/HOWTOSCR.HTM#RunningFullScreenAndPreview


Cheers,

Will.

Offline zulo

Junior Member




Java games rock!


« Reply #5 - Posted 2004-04-06 11:50:07 »

hi

I tried this and it worked, now i'm making a screensaver that shows pictures. A slideshow-screensaver.

But i'm not sure about fullscreen, should I use fullscreen or just use a Frame and maximize it?

And when it is finnished, how can it be automatically installed on a computer?
Offline zulo

Junior Member




Java games rock!


« Reply #6 - Posted 2004-04-06 17:31:08 »

hey onyx, how did you compile the cpp file for the screensaver? I have visual c++ studio and it compiled with no errors but i didnt get a .scr screensaver file..I have cygwin, do you know how i can compile it there?
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #7 - Posted 2004-04-06 18:29:23 »

Well, you get an "exe" - it's the same. You just have to rename it Wink

For fullscreen you'll need 1.4+ and a little introduction can be found here:
http://java.sun.com/docs/books/tutorial/extra/fullscreen/

For further fullscreen questions check the java2d forum Smiley

Oh if you don't want to change the resolution you can use a JWindow - it's like a frame without borders/titlebar (also perfect for making splash screens).

弾幕 ☆ @mahonnaiseblog
Offline zulo

Junior Member




Java games rock!


« Reply #8 - Posted 2004-04-07 11:05:36 »

hi thanks, i think ill try the JWindow.

The screensaver works when I click preview, or start it directly, but it doesnt start after 1 minute. It looks like windows tries to start it but it stops, because i can see on the cursor that the computer works for a moment..
do you have any idea why it acts like this? i tested it on two computers with windows xp on both.
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #9 - Posted 2004-04-07 17:18:53 »

Hm... it could be, that windows copies the file over to another directory. So use search to locate all *.scr files. See if you can find the scr (wich you've installed) twice. If so you'll need to copy the jar over to that directory, too.

The common locations for scrs under win9x are windows and windows/system. However, under 9x no files are copied at all (maybe that's the broken install routine I've heard about?).

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #10 - Posted 2004-04-07 23:58:09 »

Quote
hi thanks, i think ill try the JWindow.

The screensaver works when I click preview, or start it directly, but it doesnt start after 1 minute. It looks like windows tries to start it but it stops, because i can see on the cursor that the computer works for a moment..
do you have any idea why it acts like this? i tested it on two computers with windows xp on both.


This is what happened to me too Sad

Will.

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #11 - Posted 2004-04-14 19:11:08 »

Well, I guess xp copies the src file (if you choose rightclick->install) into another directory. Then, when the src is started, it can't find the jar, because that file wasn't copied.

Try to locate the directory of the src file via search function, copy the jar and test it again.

I can't try this by myself, because I don't have XP.

(Win9x doesn't copy the src btw)

弾幕 ☆ @mahonnaiseblog
Offline g666

Junior Member





« Reply #12 - Posted 2007-12-06 18:10:08 »

i know its been a few years Cheesy, but could you re-up it?

desperately seeking sanity
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #13 - Posted 2007-12-06 19:32:03 »

URL updated.

The demo.jar seems to have some issues here (it complains about the display mode), other than that it works fine.

弾幕 ☆ @mahonnaiseblog
Offline g666

Junior Member





« Reply #14 - Posted 2007-12-06 23:27:12 »

ta

desperately seeking sanity
Offline gouessej

« In padded room »



TUER


« Reply #15 - Posted 2008-02-20 13:20:13 »

There is a cross-platform way to do this, isn't it? I don't see why you need to use C++ to do this. In Java, the class java.awt.Robot can be used to perform a screenshot and in JOGL, the class com.sun.opengl.util.Screenshot can help too.

Offline erikd

JGO Ninja


Medals: 15
Projects: 4
Exp: 14 years


Maximumisness


« Reply #16 - Posted 2008-02-21 14:41:53 »

If you actually read this thread you'd see that nobody's talking about taking screenshots  Tongue

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #17 - Posted 2008-02-23 09:16:41 »

WTF Smiley

弾幕 ☆ @mahonnaiseblog
Offline gouessej

« In padded room »



TUER


« Reply #18 - Posted 2008-02-24 21:48:09 »

Ok... Don't you think there is a cross-platform way to "turn your demos into screensavers"? At work, one of my colleague created a small program to record a short sequence, generate a Java archive containing both the movie and the program to read it and to send the whole by email.

Offline erikd

JGO Ninja


Medals: 15
Projects: 4
Exp: 14 years


Maximumisness


« Reply #19 - Posted 2008-02-24 22:33:50 »

Quote
Ok... Don't you think there is a cross-platform way to "turn your demos into screensavers"?

No, I don't think so.
A screensaver is a platform specific thing: A screensaver in Windows is a native program with a .scr extension, therefor you need to follow that convention if you want to create a screensaver written in java (i.e. write a native program with a .scr extension which starts java, which is exactly what oNyx created).
It probably works differently on Linux, so there you'd again need a platform specific intermediate step to use a java program as screensaver.

Quote
At work, one of my colleague created a small program to record a short sequence, generate a Java archive containing both the movie and the program to read it and to send the whole by email.
That's nice, but not a screensaver  Smiley

Offline bienator

Senior Member




OutOfCoffeeException


« Reply #20 - Posted 2008-02-24 22:55:51 »

https://screensavers.dev.java.net/

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #21 - Posted 2008-02-25 00:31:08 »

Heh. Well, this thread is pretty old (March 22, 2004, 12:11:02 pm). Wink

弾幕 ☆ @mahonnaiseblog
Offline gouessej

« In padded room »



TUER


« Reply #22 - Posted 2008-02-25 07:02:32 »

Thanks. I was right  Grin

Offline erikd

JGO Ninja


Medals: 15
Projects: 4
Exp: 14 years


Maximumisness


« Reply #23 - Posted 2008-02-25 10:16:52 »

Thanks. I was right  Grin

I'd argue that a 'cross-platform' solution for screensavers that doesn't support OSX is hardly cross platform  Smiley

Offline gouessej

« In padded room »



TUER


« Reply #24 - Posted 2008-02-25 21:05:57 »

I'd argue that a 'cross-platform' solution for screensavers that doesn't support OSX is hardly cross platform  Smiley
You're right but it is still "better" than a full-Windows solution like JScreenSaver in term of platform independence. Moreover, if it works on some Linux and Unix, there should be a way of making it work under Mac.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (32 views)
2014-04-15 18:08:23

BurntPizza (29 views)
2014-04-15 03:46:01

UprightPath (44 views)
2014-04-14 17:39:50

UprightPath (27 views)
2014-04-14 17:35:47

Porlus (44 views)
2014-04-14 15:48:38

tom_mai78101 (65 views)
2014-04-10 04:04:31

BurntPizza (125 views)
2014-04-08 23:06:04

tom_mai78101 (225 views)
2014-04-05 13:34:39

trollwarrior1 (190 views)
2014-04-04 12:06:45

CJLetsGame (198 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!