Slick Forums

Discuss the Slick 2D Library
It is currently Thu May 23, 2013 8:27 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu May 24, 2012 6:56 am 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 195
Location: United State of California
Hey folks. I'm using the latest dev version of Slick using JDK 1.7 and Netbeans to build my project. I'm working on a Windows 7 64-bit system with a dual monitor setup. Primary screen is 1920x1080 resolution oriented on the right side. My secondary screen is 1600x900 resolution oriented on the left. I'm building a sprite editing tool that will probably not make a public release using Swing and CanvasGameContainer to show animation. I'm not going to switch to TWL or any other OpenGL only solutions.

The trouble I'm having is when I maximize my window on my secondary screen, Slick crashes and I'm left with an empty window. The window still operates and the program quits successfully. This also happens when I resize the window and make it larger on my secondary screen. This does not occur when I use my primary screen. I made a test case to show this:

TestGame.java
Code:
package slickguitest;

import org.newdawn.slick.*;

public class TestGame extends BasicGame {
   
    public TestGame(String name) {
        super(name);
    }

    @Override
    public void init(GameContainer container) throws SlickException {
       
    }

    @Override
    public void update(GameContainer container, int delta) throws SlickException {
       
    }

    @Override
    public void render(GameContainer container, Graphics g) throws SlickException {
        g.setColor(Color.gray);
        g.fillRect(0.0f, 0.0f, container.getWidth(), container.getHeight());
    }
}


Main.java
Code:
package slickguitest;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.GridLayout;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.GroupLayout;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import org.newdawn.slick.CanvasGameContainer;
import org.newdawn.slick.SlickException;

public class Main extends javax.swing.JFrame {
    private JPanel pnl_animationPanel;
    private CanvasGameContainer canvasGC;

    public Main() {
        initComponents();
        try {
            canvasGC = new CanvasGameContainer(new TestGame("test"));
            canvasGC.getContainer().setAlwaysRender(true);
            canvasGC.setMinimumSize(new Dimension(0, 0));
            canvasGC.start();
            pnl_animationPanel.add(canvasGC);
        } catch (SlickException ex) {
            Logger.getLogger(TestJFrame.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
                   
    private void initComponents() {

        pnl_animationPanel = new JPanel();

        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

        pnl_animationPanel.setBackground(new Color(255, 0, 0));
        pnl_animationPanel.setLayout(new GridLayout(1, 0));

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnl_animationPanel, GroupLayout.DEFAULT_SIZE, 813, Short.MAX_VALUE)
                .addContainerGap())
        );
       
        layout.setVerticalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnl_animationPanel, GroupLayout.DEFAULT_SIZE, 537, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }
   
    public static void main(String args[]) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Main().setVisible(true);
            }
        });
    }
}


And this is the error message that I get:
Code:
run:
Wed May 23 23:30:10 PDT 2012 INFO:Slick Build #236
Wed May 23 23:30:10 PDT 2012 INFO:LWJGL Version: 2.8.2
Wed May 23 23:30:10 PDT 2012 INFO:OriginalDisplayMode: 1920 x 1080 x 32 @60Hz
Wed May 23 23:30:10 PDT 2012 INFO:TargetDisplayMode: 500 x 500 x 0 @0Hz
Wed May 23 23:30:10 PDT 2012 INFO:Starting display 500x500
Wed May 23 23:30:10 PDT 2012 INFO:Use Java PNG Loader = true
Wed May 23 23:30:10 PDT 2012 INFO:Starting display 813x537
Wed May 23 23:30:12 PDT 2012 ERROR:Unable to setup mode 1576x854 fullscreen=false
org.newdawn.slick.SlickException: Unable to setup mode 1576x854 fullscreen=false
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Cannot determine minimized state of uncreated window
   at org.newdawn.slick.AppGameContainer.setDisplayMode(AppGameContainer.java:207)
   at org.newdawn.slick.CanvasGameContainer$Container.checkDimensions(CanvasGameContainer.java:195)
   at org.newdawn.slick.CanvasGameContainer$2.run(CanvasGameContainer.java:104)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
   at java.awt.EventQueue.access$000(EventQueue.java:101)
   at java.awt.EventQueue$3.run(EventQueue.java:666)
   at java.awt.EventQueue$3.run(EventQueue.java:664)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: org.lwjgl.LWJGLException: Could not make context current
   at org.lwjgl.opengl.WindowsContextImplementation.nMakeCurrent(Native Method)
   at org.lwjgl.opengl.WindowsContextImplementation.makeCurrent(WindowsContextImplementation.java:94)
   at org.lwjgl.opengl.Display.isVisible(Display.java:584)
   at org.lwjgl.opengl.ContextGL.makeCurrent(ContextGL.java:194)
   at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:450)
   at org.lwjgl.opengl.DrawableGL.makeCurrent(DrawableGL.java:110)
   at org.newdawn.slick.CanvasGameContainer$2.run(CanvasGameContainer.java:100)
   at org.lwjgl.opengl.Display.makeCurrent(Display.java:731)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
   at org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval(Display.java:1050)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
   at org.lwjgl.opengl.Display.setDisplayMode(Display.java:251)
   at org.newdawn.slick.AppGameContainer.setDisplayMode(AppGameContainer.java:188)
   at java.awt.EventQueue.access$000(EventQueue.java:101)
   ... 16 more
   at java.awt.EventQueue$3.run(EventQueue.java:666)
   at java.awt.EventQueue$3.run(EventQueue.java:664)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
BUILD SUCCESSFUL (total time: 6 seconds)


Any help would be apperciated. Also, it would be really nice if this forum could minimize code blocks for readability.

_________________
Current Testing Machine:
Windows 7 x64, 4GB RAM DDR3, 3.3ghz AMD Athlon II X3 455, AMD Radeon HD 6800 series.


Top
 Profile  
 
PostPosted: Mon May 28, 2012 9:20 pm 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 195
Location: United State of California
No ideas folks?

_________________
Current Testing Machine:
Windows 7 x64, 4GB RAM DDR3, 3.3ghz AMD Athlon II X3 455, AMD Radeon HD 6800 series.


Top
 Profile  
 
PostPosted: Wed May 30, 2012 4:15 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
Are you using the latest code from the dev branch, and the latest version of LWJGL?
http://slick.cokeandcode.com/wiki/doku. ... ent_branch
https://www.newdawnsoftware.com/jenkins ... job/LWJGL/

Let me know if the problem persists. I can't reproduce the error here.


Top
 Profile  
 
PostPosted: Thu May 31, 2012 1:19 am 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 195
Location: United State of California
I've been using the dev version of Slick. I upgraded to LWJGL 2.8.4 and it still occurs with my test program.

Code:
run:
Wed May 30 18:17:56 PDT 2012 INFO:Slick Build #236
Wed May 30 18:17:56 PDT 2012 INFO:LWJGL Version: 2.8.4
Wed May 30 18:17:56 PDT 2012 INFO:OriginalDisplayMode: 1920 x 1080 x 32 @60Hz
Wed May 30 18:17:56 PDT 2012 INFO:TargetDisplayMode: 500 x 500 x 0 @0Hz
Wed May 30 18:17:56 PDT 2012 INFO:Starting display 500x500
Wed May 30 18:17:56 PDT 2012 INFO:Use Java PNG Loader = true
Wed May 30 18:17:56 PDT 2012 INFO:Starting display 813x537
Wed May 30 18:18:02 PDT 2012 ERROR:Unable to setup mode 1588x866 fullscreen=false
org.newdawn.slick.SlickException: Unable to setup mode 1588x866 fullscreen=false
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Cannot determine minimized state of uncreated window
   at org.newdawn.slick.AppGameContainer.setDisplayMode(AppGameContainer.java:164)
   at org.newdawn.slick.CanvasGameContainer$Container.checkDimensions(CanvasGameContainer.java:176)
   at org.newdawn.slick.CanvasGameContainer$2.run(CanvasGameContainer.java:94)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
   at java.awt.EventQueue.access$000(EventQueue.java:101)
   at java.awt.EventQueue$3.run(EventQueue.java:666)
   at org.lwjgl.opengl.Display.isVisible(Display.java:555)
   at java.awt.EventQueue$3.run(EventQueue.java:664)
   at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:407)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.newdawn.slick.CanvasGameContainer$2.run(CanvasGameContainer.java:90)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
   at java.awt.EventQueue.access$000(EventQueue.java:101)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
   at java.awt.EventQueue$3.run(EventQueue.java:666)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
   at java.awt.EventQueue$3.run(EventQueue.java:664)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
Caused by: org.lwjgl.LWJGLException: Could not make context current
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
   at org.lwjgl.opengl.WindowsContextImplementation.nMakeCurrent(Native Method)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
   at org.lwjgl.opengl.WindowsContextImplementation.makeCurrent(WindowsContextImplementation.java:94)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
   at org.lwjgl.opengl.ContextGL.makeCurrent(ContextGL.java:194)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
   at org.lwjgl.opengl.DrawableGL.makeCurrent(DrawableGL.java:110)
   at org.lwjgl.opengl.Display.makeCurrent(Display.java:703)
   at org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval(Display.java:1022)
   at org.lwjgl.opengl.Display.setDisplayMode(Display.java:248)
   at org.newdawn.slick.AppGameContainer.setDisplayMode(AppGameContainer.java:152)
   ... 16 more

_________________
Current Testing Machine:
Windows 7 x64, 4GB RAM DDR3, 3.3ghz AMD Athlon II X3 455, AMD Radeon HD 6800 series.


Top
 Profile  
 
PostPosted: Mon Jun 04, 2012 4:38 am 
Offline
Regular
User avatar

Joined: Wed Apr 27, 2011 3:29 pm
Posts: 195
Location: United State of California
Would this problem be better suited for the LWJGL folks? If so, how exactly should I present this to them? I'm not savvy when it comes to LWJGL or OpenGL in general.

_________________
Current Testing Machine:
Windows 7 x64, 4GB RAM DDR3, 3.3ghz AMD Athlon II X3 455, AMD Radeon HD 6800 series.


Top
 Profile  
 
PostPosted: Mon Jun 04, 2012 8:58 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
You create the display before the swing window is open? Might that by the problem? Aparat from that, post it on the LWJGL Forum as I'm sure this is not a Slick related problem.

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group