We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › fullscreen api, here u go!
Pages: 1 2 3 4 
fullscreen api, here u go! (Read 39280 times)
Re: Works just fine with me!
Reply #45 - Oct 13th, 2008, 10:28pm
 
blausand wrote on Oct 13th, 2008, 10:09pm:
Remains the quest for a second window for "controls" and GUI/Parameter-display...


that's is what controlp5 is for Smiley
you can have it to display its controls on a separated window.

http://www.sojamo.de/libraries/controlP5/

henri

Re: fullscreen api, here u go!
Reply #46 - Oct 20th, 2008, 1:35pm
 
im still getting the white rectangles problem when using the fullscreen lib.

im using textureIO to load my textures, since i use opengl directly. it works on some videocards and others doesnt.
weird is it just doesnt work in my ati firegl 8600.

im uploading 24bit png images (about 5 of them. 256x256)

that shouldnt be a problem.

anyone still has this problem?
Re: fullscreen api, here u go!
Reply #47 - Oct 22nd, 2008, 1:21am
 
V wrote on Oct 20th, 2008, 1:35pm:
im still getting the white rectangles problem when using the fullscreen lib.

im using textureIO to load my textures, since i use opengl directly.

ok, can you test if the white-rectangle problem disappears when you use PImage directly if you can confirm that that works i'd be happy :)

now for your specific problem: the textures need to be updated every time the resolution changes. the fullscreen api does that by invoking updatePixels() on all PImage instances when going fullscreen. you can try manually updating your own texture implementation by adding the following code to your sketch:

void displayChanged(){
 // insert code for updating
 // your textures HERE!
}

hm... let's see if that fixes it. please remember: the displayChanged callback is a hack and might stop working in future reases of the fullscreen api.

good luck and let me know how it works out for you!
Re: fullscreen api, here u go!
Reply #48 - Oct 22nd, 2008, 12:43pm
 
yes, when using PImage directly it works just fine.

i tried to use glSubTexImage2D() to update the data of my opengl textures but with no luck so far..

i also used pimage to load my textures, but still doesnt work for me in fullscreen.


 void loadPImage( String fName )
 {
   fileName = fName;
   _img = loadImage( fName );

   _width = _img.width;
   _height = _img.height;
   
   int[] tex = { 0 };

   gl._gl.glGenTextures( 1, tex, 0 );
   _id = tex[0];

   gl._gl.glBindTexture( GL.GL_TEXTURE_2D, _id );
//    gl._gl.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR );
//    gl._gl.glTexParameteri( GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR );
   gl._gl.glTexImage2D( GL.GL_TEXTURE_2D, 0, 4, _img.width, _img.height, 0, GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, IntBuffer.wrap(_img.pixels) );
 }

 void update()
 {
   _img.updatePixels();

   gl._gl.glBindTexture( GL.GL_TEXTURE_2D, _id );
   gl._gl.glTexSubImage2D( GL.GL_TEXTURE_2D, 0, 0, 0, _img.width, _img.height, GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, IntBuffer.wrap(_img.pixels) );
   println("updated, id= " + _id );
 }


i should be able to update the data of the opengl texture with update but still it did not work out. i'll have to see what might be going bad with this. the updatepixels and the gl call should update the texture
Re: fullscreen api, here u go!
Reply #49 - Oct 25th, 2008, 2:27pm
 
V wrote on Oct 22nd, 2008, 12:43pm:
i should be able to update the data of the opengl texture with update but still it did not work out. i'll have to see what might be going bad with this. the updatepixels and the gl call should update the texture


afaik the opengl context gets deleted everytime you move the sketch to another monitor or change resolution (this is typical opengl behaviour and has nothing to do with processing).

i still haven't figured what the means for the textures, i guess it'd be a safe bet to delete the old texture ids and just get completely new ones.

for instance check out the ImageCache.rebind() method in processing's opengl code:  
http://dev.processing.org/source/index.cgi/trunk/processing/opengl/src/processing/opengl/PGraphicsOpenGL.java?view=markup


maybe at one point i'll add support for other textures than PImage, but i really don't have the time right now... Sad
Re: fullscreen api, here u go!
Reply #50 - Oct 25th, 2008, 7:18pm
 
here's another error i get now when compiling using fullscreen (this happens on the object creation):

Code:

FullScreen API: Warning, OPENGL Support is experimental!
Keep checking http://www.superduper.org/processing/fullscreen_api/ for updates!
java.lang.NoSuchFieldError: canvas
at processing.core.GLFullScreenHelper.addOpenGLSupport(GLFullScreenHelper.java:48)
at fullscreen.FullScreenBase.<init>(FullScreenBase.java:39)
at fullscreen.FullScreen.<init>(FullScreen.java:84)
at fullscreen.FullScreen.<init>(FullScreen.java:106)
at WeareinHelsinki_Minim.setup(WeareinHelsinki_Minim.java:154)
at processing.core.PApplet.handleDraw(PApplet.java:1372)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Unknown Source)


i cant get fullscreen mode to work now.. but i could try to retrieve the opengl context again and build my textures in the method displayChanged() that might work.
but i cant only test it if fullscreen mode works.

im not sure what happened now, i opened my project and tried to use FS after reading your post.. it just crashed the app


this is another error when it tries to go into app's mainloop:


GLException: Unable to create context for device context 0x3d010858

Code:

Exception in thread "Animation Thread" javax.media.opengl.GLException: Unable to create OpenGL context for device context 0x3d010858
at com.sun.opengl.impl.windows.WindowsGLContext.create(WindowsGLContext.java:122)
at com.sun.opengl.impl.windows.WindowsGLContext.makeCurrentImpl(WindowsGLContext.java:150)
at com.sun.opengl.impl.windows.WindowsOnscreenGLContext.makeCurrentImpl(WindowsOnscreenGLContext.java:66)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:134)
at processing.opengl.PGraphicsOpenGL.detainContext(PGraphicsOpenGL.java:294)
at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:335)
at processing.core.PApplet.handleDraw(PApplet.java:1370)
at processing.core.PApplet.run(PApplet.java:1305)
at java.lang.Thread.run(Thread.java:595)
Re: fullscreen api, here u go!
Reply #51 - Oct 25th, 2008, 7:33pm
 
V wrote on Oct 25th, 2008, 7:18pm:
here's another error i get now when compiling using fullscreen (this happens on the object creation): [...]



I think you're on version 0.95 of the fullscreen api, can you fetch the latest version and retry...
http://www.superduper.org/processing/fullscreen_api/versions/fullscreen-0.96.zip

Sorry for the inconvinience, you have to understand that this fullscreen api deeply integrates with processing, so pretty much every major update of processing potentially breaks it.
i should propably start writing down which version of my api is compatible with what version of processing...
Re: fullscreen api, here u go!
Reply #52 - Oct 26th, 2008, 12:54am
 
ok hansi you were right
i changed processing version and copied wrong version of the fullscreen lib.

when i use the displayChanged() call to load my textures it just doesnt work. like u said it might be the opengl context being renewed.

what i did was to hold the application for few seconds inside the draw() call, enough time to load textures.

not good coding practice but it works. atleast i get fullscreen and textures.

thanks for all the support. and keep up the good work
Re: fullscreen api, here u go!
Reply #53 - Mar 23rd, 2009, 9:53am
 
hi,guys
could you leave an example?i met the same problem,i couldn't load my textures.i'm poor in opengl.
                                 thanks, sun
Re: fullscreen api, here u go!
Reply #54 - Sep 2nd, 2009, 8:26am
 
AAAAAAAAHHHHHH!!!!

Sorry everyone, but apperently the fullscreen library causes huge problems with newer versions of processing.
If you run into compilation/export issues please try deleting the fullscreen library and see if that fixes your problem.

I'm working on this, if you are curious about updates to this issues just subscribe to this thread, i will post the solution (if there is one) here.


Thanks everyone for all the feedback!

best, hansi.
Re: fullscreen api, here u go!
Reply #55 - Oct 17th, 2009, 6:01am
 
The fix is (almost) finished. If you are interrested in testing it please send me a forum message!
Re: fullscreen api, here u go!
Reply #56 - Nov 26th, 2009, 7:19am
 
Hello once again!

There has been a testing-version for quite a few weeks and people reported that it's stable.

The most important news are:
hot news!  Cheesy
  • Doesn't break processing 1.0.6+ anymore (not sure if that's a feature...)
  • SoftFullScreen now supports choosing a specific screen
  • Recompiled the tiny-bit of a native library for snow leopard

As always, fetch it from
http://www.superduper.org/processing/fullscreen_api/
Pages: 1 2 3 4