Slick Forums

Discuss the Slick 2D Library
It is currently Thu Dec 13, 2018 1:18 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Aug 01, 2013 9:01 pm 
Offline

Joined: Thu Aug 01, 2013 8:45 pm
Posts: 1
Hello! I am new to the library.I was looking for something to help me with my game GUI. But i have a problem. By following the tutorials i tried to create a simple button but i have a problem.

Code:
java.io.IOException: while parsing Theme XML: file:/D:/Workspaces/JavaProjects/Sprite%20Fight%20Client/bin/Game/simple.xml
   at de.matthiasmann.twl.theme.ThemeManager.parseThemeFile(ThemeManager.java:311)
   at de.matthiasmann.twl.theme.ThemeManager.createThemeManager(ThemeManager.java:213)
   at de.matthiasmann.twl.theme.ThemeManager.createThemeManager(ThemeManager.java:173)
   at de.matthiasmann.twl.theme.ThemeManager.createThemeManager(ThemeManager.java:155)
   at Game.Game.initTWL(Game.java:200)
   at Game.Game.<init>(Game.java:484)
   at Multi.MPClient.main(MPClient.java:30)
Caused by: org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
   at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLTexture.<init>(LWJGLTexture.java:152)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLCacheContext.createPNGTexture(LWJGLCacheContext.java:152)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLCacheContext.createTexture(LWJGLCacheContext.java:81)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLCacheContext.loadTexture(LWJGLCacheContext.java:67)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.load(LWJGLRenderer.java:519)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.load(LWJGLRenderer.java:508)
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.loadTexture(LWJGLRenderer.java:379)
   at de.matthiasmann.twl.theme.ImageManager.parseImages(ImageManager.java:134)
   at de.matthiasmann.twl.theme.ThemeManager.parseThemeFile(ThemeManager.java:323)
   at de.matthiasmann.twl.theme.ThemeManager.parseThemeFile(ThemeManager.java:302)
   ... 6 more


I get both exceptions when initialising TWL
Code:
      try {
         LWJGLRenderer renderer = new LWJGLRenderer();
      
         gui = new GUI(this,renderer);
      
        The error is here.>>>  themeManager=ThemeManager.createThemeManager(this.getClass().getResource("simple.xml"), renderer);

          gui.applyTheme(themeManager);
      } catch (LWJGLException e) {
         e.printStackTrace();
      } catch (IOException e) {
         e.printStackTrace();
      }


gui,renderer,themeManager and button are initialised.

For xml files i use the Theme Editor.

I am not posting all the code because it's too much to post here.
So i am asking what can be the reason for the exceptions?

Edit: So i think i found the problem.The thing that causes this error is glEnable(GL_ALPHA); . And after remving it my screen just turns black when i use gui.update(); .

Edit2: After some try and error my screen is not black.I just had to place glColor4d(1,1,1,1); infront of everything.The problem is that i can't see the button now.


Top
 Profile  
 
PostPosted: Sun Aug 04, 2013 7:14 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1242
Hmm strange. I don't think
Code:
glEnable(GL_ALPHA);
is legal in OpenGL - where did you find that code?
TWL changes the current color when rendering. So when you render stuff yourself you need to set this color - but TWL's own rendering takes care of it's own colors.

_________________
TWL - The Themable Widget Library


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Group