Author Topic: Unknown Windows Version (Just a Nitpick)  (Read 2788 times)

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Unknown Windows Version (Just a Nitpick)
« on: January 13, 2012, 06:35:18 pm »
Egon, you stubborn (occasionally likeable) man, do you think it's odd jpct still calls Windows 7 an "unknown Windows version?"

Also, is it possible to undo calling an enableCanvasRenderer() call? Does it take disabling the renderer and reenabling it (I'm trying to do the hardware fullscreen-only bit on my game)?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Unknown Windows Version (Just a Nitpick)
« Reply #1 on: January 13, 2012, 07:58:14 pm »
Where am i printing the windows version?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Unknown Windows Version (Just a Nitpick)
« Reply #2 on: January 13, 2012, 08:10:12 pm »
Right after "adding lightsource."

Is it possible to undo calling an enableCanvasRenderer() call? Does it take disabling the renderer and reenabling it (I'm trying to do the hardware fullscreen-only bit on my game)?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Unknown Windows Version (Just a Nitpick)
« Reply #3 on: January 13, 2012, 08:15:26 pm »
In which code? I can't find anything that prints out a Windows version.

About the undo...i'm not sure. You can try to disable it using the normal disable/enable-sequence, but i'm not sure how well this will work. Another option is to create a new framebuffer instead.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Unknown Windows Version (Just a Nitpick)
« Reply #4 on: January 13, 2012, 08:17:30 pm »
Must be lwjgl, then.

Thanks for the suggestion.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Unknown Windows Version (Just a Nitpick)
« Reply #5 on: January 13, 2012, 09:14:25 pm »
I realize this is an lwjgl question, but how do I hide the Display once created? Neither Display.releaseContext() nor Display.destroy() does it, so I'm at a loss.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Unknown Windows Version (Just a Nitpick)
« Reply #6 on: January 13, 2012, 09:58:11 pm »
Actually, buffer.disableRenderer(IRenderer.RENDERER_OPENGL); should do this!?

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Unknown Windows Version (Just a Nitpick)
« Reply #7 on: January 14, 2012, 05:27:58 am »
This is a block in the constructor inside a block that has tested for hardware. Neither the try (the fullscreen with hardware) nor the catch (the windowed with hardware after failing at fullscreen) work. How come?

Code: [Select]
      if (engineData.fullScreen) {
GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
this.setUndecorated(true);
this.setIgnoreRepaint(true);
device.setFullScreenWindow(this);
device.setDisplayMode(new java.awt.DisplayMode(engineData.width, engineData.height, 32, java.awt.DisplayMode.REFRESH_RATE_UNKNOWN));
if (!device.isDisplayChangeSupported())
     System.err.println("No support for current mode!");
try {
     buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
     buffer.dispose();
     buffer = new FrameBuffer(engineData.width, engineData.height, FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY);
     buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
     buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
     Display.create();
     Display.setDisplayModeAndFullscreen(new org.lwjgl.opengl.DisplayMode(engineData.width, engineData.height));
}
catch (Exception e) {System.err.println("Problem: "+e.getMessage());
     this.remove(awtGlCanvas);
     buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
     try {Display.releaseContext();}catch (Exception ex) {System.err.println("\n\nProblem?\n");}
     Display.destroy();
     awtGlCanvas = buffer.enableGLCanvasRenderer();
     engineData.fullScreen = false;//AT LEAST PROCEED IN WINDOWED MODE}
     this.add(awtGlCanvas);
     //buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
     //buffer.enableRenderer(IRenderer.RENDERER_OPENGL);
     device.setFullScreenWindow(null);
     this.setUndecorated(false);
     this.setVisible(true);
}
      }
      else this.setVisible(true);//IF NOT engineData.fullScreen
« Last Edit: January 15, 2012, 12:30:57 am by AGP »