Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  lwjgl Display remove title bar?  (Read 497 times)
0 Members and 1 Guest are viewing this topic.
Offline PaidGEEK

JGO n00b
*

Posts: 17
Medals: 1



« on: 2012-01-21 19:02:12 »

Hey!

I have a simple question. Is it possible to remove title bar and decoration around lwjgl openGL display when using windowed mode?

similar to JFrame maybe:
1  
2  
3  
4  
5  
JFrame frame = new JFrame("something");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(width,height);
frame.setUndecorated(true));  //here
frame.setVisible(true);


Improvisational programmer.
Online ra4king

JGO Kernel
*****

Posts: 3158
Medals: 196


I'm the King!


« Reply #1 on: 2012-01-21 19:03:15 »

Unfortunately no, at least...not yet Smiley

Try submitting it as an RFE on LWJGL forums!

Online Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5870
Medals: 255


Hand over your head.


« Reply #2 on: 2012-01-21 19:05:01 »

Take a java.awt.Window, put a java.awt.Canvas in it and use Display.setParent(...) to bind your surface to the canvas.

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Games published by our own members! Go get 'em!
Offline Matzon
« League of Dukes »

JGO Kernel
*****

Posts: 1805
Medals: 8


I'm gonna wring your pants!


« Reply #3 on: 2012-01-21 19:56:38 »

-Dorg.lwjgl.opengl.Window.undecorated=true ?

http://certusgames.com (Free Online Multiplayer Java Games)
http://lwjgl.org (OpenGL/OpenAL for Java)
Online Riven
« League of Dukes »

JGO Kernel
*****

Posts: 5870
Medals: 255


Hand over your head.


« Reply #4 on: 2012-01-21 20:07:45 »

-Dorg.lwjgl.opengl.Window.undecorated=true ?
Nice, when will it be part of the API?

Hi, appreciate more people! Σ ♥ = ¾

Learn how to award medals... and work your way up the social rankings
Offline PaidGEEK

JGO n00b
*

Posts: 17
Medals: 1



« Reply #5 on: 2012-02-18 20:22:46 »

Take a java.awt.Window, put a java.awt.Canvas in it and use Display.setParent(...) to bind your surface to the canvas.

I've returned to this project, and made it work. But now I want to know how does resizing of the window work (Display.getWidth or JFrame.getWidth())? If I render something on screen with opengl (I use Display.getWidth/2 to render 2D in center) and then resize this screen everything moves out of place (aspect ratio messes up, before I used Display.wasResized() to renew ratio on gluPerspective). I tryed to use Frame.getWidth() and getHeight() but I get same result. I want to know how are display and jframe connected exactly.

sry for my typing, i need to get some sleep.

parent code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
        Canvas = new Canvas();
        Frame = new JFrame("sup");

        Frame.setSize(1280, 720);
        Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Frame.setBackground(Color.BLACK);
        Canvas.setBackground(Color.BLACK);
        Frame.getContentPane().add(Canvas);
        Frame.setLocationRelativeTo(null);
        Frame.setVisible(true);
      try {
         Display.setVSyncEnabled(true);
         Display.setParent(Canvas);
         Display.create();
      } catch (Exception e) {
         e.printStackTrace();
         Display.destroy();
         System.exit(0);
      }

Improvisational programmer.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.088 seconds with 21 queries.