Slick Forums

Discuss the Slick 2D Library
It is currently Fri Aug 23, 2019 3:58 pm

All times are UTC

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

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: while parsing Theme XML: file:/D:/Workspaces/JavaProjects/Sprite%20Fight%20Client/bin/Game/simple.xml
   at de.matthiasmann.twl.theme.ThemeManager.parseThemeFile(
   at de.matthiasmann.twl.theme.ThemeManager.createThemeManager(
   at de.matthiasmann.twl.theme.ThemeManager.createThemeManager(
   at de.matthiasmann.twl.theme.ThemeManager.createThemeManager(
   at Game.Game.initTWL(
   at Game.Game.<init>(
   at Multi.MPClient.main(
Caused by: org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
   at org.lwjgl.opengl.Util.checkGLError(
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLTexture.<init>(
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLCacheContext.createPNGTexture(
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLCacheContext.createTexture(
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLCacheContext.loadTexture(
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.load(
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.load(
   at de.matthiasmann.twl.renderer.lwjgl.LWJGLRenderer.loadTexture(
   at de.matthiasmann.twl.theme.ImageManager.parseImages(
   at de.matthiasmann.twl.theme.ThemeManager.parseThemeFile(
   at de.matthiasmann.twl.theme.ThemeManager.parseThemeFile(
   ... 6 more

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

      } catch (LWJGLException e) {
      } catch (IOException e) {

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.

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

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1242
Hmm strange. I don't think
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

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 8 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