Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved around and renamed a few things

Other than that no dramatic changes

git-svn-id: http://svn.gna.org/svn/fullscreen-p5/trunk@8 2047cd6a-46a1-4efc-9f20-c343b47ea501
  • Loading branch information...
commit fb0c5a0dc2a6deea218c89614754a4fff877197b 1 parent 0f4136c
kritzikratzi authored
View
38 CHANGES
@@ -1,38 +0,0 @@
-Version 0.95:
--------------
-* Another try on the opengl issue : Now updating textures from the init() method called
- by opengl, let's hope that finally fixes it!
-* SoftFullScreen support, is like a "always on top" window. So you can't change resolution,
- but you can span across multiple monitors.
-* Shortcuts are still enabled by default, but you can turn them off using
- disableKeys()
-
-Version 0.94:
--------------
-* This is a proper library now
-* Improved OpenGL support, still very experimental.
-
-
-Version 0.93:
--------------
-* Add opengl support (works in osx 10.4, crashes in linux, windows???)
-* Fixed demo (change "rand" to "random")
-
-
-Version 0.92:
---------------
-* Change framerate to frameRate in the demo file
-
-
-Version 0.9.1:
---------------
-* Fixed linux version
-* Fixed windows version, even though it hangs every now and then. However, it
- works most of the time.
-* Added the famous Alt+Enter combination for the windows platform
-* ESC key leaves fullscreen mode or exists the application if running in window mode
-
-
-Version 0.9:
---------------
-* Thats the start
View
11 build.xml
@@ -20,6 +20,7 @@
Boston, MA 02111-1307 USA
-->
<project name="Processing Fullscreen API" default="dist">
+ <!-- path to the processing installation -->
<property name="processing.path" value="/Applications/Processing"/>
<property name="version" value="0.95"/>
@@ -28,15 +29,18 @@
<fileset dir="." includes="dependencies/*.jar"/>
</path>
+ <!-- empty the binary folder -->
<target name="clean">
<delete dir="bin"/>
</target>
+ <!-- compile the sources, place the class files in the bin folder -->
<target name="compile">
<mkdir dir="bin"/>
<javac srcdir="src" destdir="bin" classpathref="cp"/>
</target>
+ <!-- create the files for the website -->
<target name="dist" depends="compile">
<mkdir dir="dist"/>
<mkdir dir="fs_api"/>
@@ -69,6 +73,10 @@
<!-- now create the source snapshot -->
<mkdir dir="fs_src"/>
+ <copy todir="fs_src/dependencies">
+ <fileset dir="dependencies"/>
+ </copy>
+
<copy todir="fs_src/src">
<fileset dir="src"/>
</copy>
@@ -79,6 +87,8 @@
<fileset dir="lib"/>
</copy>
<copy todir="fs_src/" file="build.xml"/>
+ <copy todir="fs_src/" file="COPYING"/>
+
<zip destfile="dist/fullscreen-src.zip">
<fileset dir="fs_src" excludes="**/.*"/>
</zip>
@@ -87,6 +97,7 @@
<delete dir="fs_src"/>
</target>
+ <!-- install the library, the processing folder (at the top) has to be specified! -->
<target name="install" depends="dist">
<unzip dest="${processing.path}/libraries/fullscreen/">
<fileset file="dist/fullscreen.zip"/>
View
0  docs/changes.txt
No changes.
View
41 docs/readme.txt
@@ -1,4 +1,4 @@
-Fullscreen API for Processing, Version 0.94
+Fullscreen API for Processing, Version 0.95
-------------------------------------------
Thanks for download the Fullscreen API for Processing, this is still
@@ -6,6 +6,45 @@ experimental software, especially if you are considering to use it in
combination with opengl. For examples, documentation and the latest version
see http://www.superduper.org/processing/fullscreen_api/
+ To install this drag the whole fullscreen folder into processing/libraries.
+If you have <processing>/libraries/fullscreen/library/fullscreen.jar in place
+after copying the folder over you did everything right. After relaunching
+processing check if sketch > import has an item labeled fullscreen. That means
+everything is perfectly fine. Now copy and paste this code into processing
+to get started:
+
+import fullscreen.*;
+
+FullScreen fs;
+
+void setup(){
+ // set size to 640x480
+ size(640, 480);
+
+ // 5 fps
+ frameRate(5);
+
+ // Create the fullscreen object
+ fs = new FullScreen(this);
+
+ // enter fullscreen mode
+ fs.enter();
+}
+
+
+void draw(){
+ background(0);
+ fill(255, 0, 0);
+
+ for(int i = 0; i &lt; 10; i++){
+ fill( random(255), random(255), random(255) );
+ rect(
+ i*10, i*10,
+ width - i*20, height - i*20
+ );
+ }
+}
+
If you have any questions, suggestions or other trouble you can email me
to it-didnt-work@superduper.org.
View
43 src/fullscreen/FullScreen.java
@@ -20,18 +20,9 @@
*/
package fullscreen;
-import java.awt.Color;
-import java.awt.Dimension;
import java.awt.DisplayMode;
import java.awt.GraphicsDevice;
-import java.awt.Frame;
-import java.awt.Toolkit;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import processing.core.GLFullScreenHelper;
import processing.core.PApplet;
/**
@@ -202,7 +193,7 @@ else if( fullScreen ){
*
* @returns true if resolution change succeeded, false if not
*/
- public boolean setResolution( int xRes, int yRes ){
+ public void setResolution( int xRes, int yRes ){
if( xRes > 0 && yRes > 0 ){
fsResolutionX = xRes;
fsResolutionY = yRes;
@@ -211,14 +202,14 @@ public boolean setResolution( int xRes, int yRes ){
// only change in fullscreen mode
if( !isFullScreen() ){
- return false;
+ return;
}
// Change resolution only if values are somehow meaningfull
if( fsResolutionX <= 0 || fsResolutionY <= 0 ){
dad.setLocation( ( fsDevice.getDisplayMode().getWidth() - dad.width ) / 2, ( fsDevice.getDisplayMode().getHeight() - dad.height ) / 2 );
- return false;
+ return;
}
DisplayMode modes[ ] = fsDevice.getDisplayModes();
@@ -238,7 +229,7 @@ public boolean setResolution( int xRes, int yRes ){
if( theMode == null ){
System.err.println( "FullScreen API: Display mode not supported: " + fsResolutionX + "x" + fsResolutionY );
dad.setLocation( ( fsDevice.getDisplayMode().getWidth() - dad.width ) / 2, ( fsDevice.getDisplayMode().getHeight() - dad.height ) / 2 );
- return false;
+ return;
}
@@ -250,37 +241,13 @@ public boolean setResolution( int xRes, int yRes ){
catch( Exception e ){
System.err.println( "FullScreen API: Failed to go to fullScreen mode" );
e.printStackTrace();
- return false;
+ return;
}
dad.setLocation( ( fsDevice.getDisplayMode().getWidth() - dad.width ) / 2, ( fsDevice.getDisplayMode().getHeight() - dad.height ) / 2 );
- return true;
}
-
- /**
- * A thread that invokes the setFullScreen() functionality delayed,
- * in case it's called from setup()
- */
- /*class FSWaitForInitThread extends Thread{
- public void run(){
- while( dad.frameCount < 5 ){
- try{
- Thread.sleep( 1000 );
- }
- catch( Exception e ){
- System.err.println( "FullScreen API: Failed to go to fullscreen mode" );
- return;
- }
- }
-
- if( !setFullScreen( true ) ){
- System.err.println( "FullScreen API: Failed to go to fullscreen mode" );
- }
- }
- }*/
-
/**
* Returns the current refresh rate
*/
View
15 src/fullscreen/FullScreenBase.java
@@ -6,6 +6,7 @@
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import java.net.URL;
import processing.core.GLFullScreenHelper;
import processing.core.PApplet;
@@ -50,7 +51,15 @@ public FullScreenBase( PApplet dad ){
public abstract boolean isFullScreen();
-
+ /**
+ * Set resolution
+ *
+ * @param xRes x resolution
+ * @param yRes y resolution
+ */
+ public abstract void setResolution( int xRes, int yRes );
+
+
/**
* Enters fullscreen mode
*
@@ -75,7 +84,7 @@ public void leave(){
*
* @param state yes if true, no if false.
*/
- public void allowShortcuts( boolean state ){
+ public void setShortcutsEnabled( boolean state ){
enableKeyEvents = state;
}
@@ -87,7 +96,7 @@ protected void registerFrame( Frame f ){
// Key Listener
f.addKeyListener( new KeyAdapter(){
public void keyPressed( KeyEvent e ){
- keyEvent( e );
+ keyEvent( e );
}
});
View
29 src/fullscreen/NativeOSX.java
@@ -18,43 +18,24 @@
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
-//
-// NativeOSX.java
-//
-// Created by hansi on 29.10.07.
-// Copyright (c) 2007 __MyCompanyName__. All rights reserved.
-//
package fullscreen;
-import javax.swing.*;
+/**
+ * This class hides/shows the menubar on osx system.
+ *
+ * @author hansi
+ */
public class NativeOSX {
static {
- System.out.println( "loading libhide..." );
- System.out.println( System.getProperty( "java.library.path" ) );
// Ensure native JNI library is loaded
System.loadLibrary("hide_menubar");
}
public NativeOSX() {
- System.out.println("JNIWrapper instance created");
}
native void setVisible( boolean arg );
-
- public static void main (String args[]) {
- // insert code here...
- System.out.println("Started JNIWrapper");
- NativeOSX newjni = new NativeOSX();
- newjni.setVisible(false);
-
- JFrame frame = new JFrame( "hey" );
- frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
- frame.setSize( 320, 240 );
- frame.setLocation( 0, 0 );
- frame.setUndecorated( true );
- frame.setVisible( true );
- }
}
View
30 src/fullscreen/SoftFullScreen.java
@@ -21,22 +21,10 @@
package fullscreen;
import java.awt.Color;
-import java.awt.DisplayMode;
+import java.awt.Frame;
import java.awt.GraphicsDevice;
-import java.awt.Frame;
-import java.awt.Toolkit;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLCanvas;
-import javax.media.opengl.GLEventListener;
-
-import processing.core.GLFullScreenHelper;
import processing.core.PApplet;
-import processing.opengl.PGraphicsOpenGL;
/**
* FullScreen support for processing.
@@ -91,12 +79,12 @@
public SoftFullScreen( PApplet dad ){
super( dad );
this.dad = dad;
-
fsFrame.setTitle( "FullScreen" );
fsFrame.setUndecorated( true );
fsFrame.setBackground( Color.black );
fsFrame.setLayout( null );
- fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
+ //fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
+ fsFrame.setSize( dad.width, dad.height );
registerFrame( fsFrame );
}
@@ -150,7 +138,8 @@ else if( fullScreen ){
dad.width + dad.frame.insets().left + dad.frame.insets().right,
dad.height + dad.frame.insets().top + dad.frame.insets().bottom
);*/
- fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
+ //fsFrame.setSize( fsDevice.getDisplayMode().getWidth(), fsDevice.getDisplayMode().getHeight() );
+ fsFrame.setSize( dad.width, dad.height );
fsFrame.add( dad );
@@ -190,4 +179,13 @@ else if( fullScreen ){
return;
}
}
+
+
+ @Override
+ public void setResolution( int xRes, int yRes ) {
+ System.err.println( "Changing resolution is not supported in SoftFullScreen mode. " );
+ System.err.println( "Use the normal FullScreen mode to make use of that functionality. " );
+ }
+
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.