Author Topic: Slick_Util rendering disabled while jPCT is rendering?  (Read 1628 times)

Offline CTucker1327

  • byte
  • *
  • Posts: 3
    • View Profile
Slick_Util rendering disabled while jPCT is rendering?
« on: December 30, 2014, 10:10:02 am »
This is fairly strange to me, as I just started venturing into the whole Java3D world yesterday, but I've actually gotten quite a bit done and I'm very proud with the results. I understand that jPCT isn't for 2D development, however almost all 3D games need 2D elements, for things such as interfaces, etc.

I decided I was going to go ahead and start writing my own interface systems (Mainly for the learning experience) using slick_util; However I ran into an immediate problem, anything that I render using slick doesn't show up on-top of the jPCT frame. I made sure to position the calls to my Slick rendering at the end of all of my jPCT rendering, however it's just not wanting to agree with me. I'm not getting any errors whatsoever, even though I'm using a try/catch-all so I don't have a clue where to even start.

Right now I'm using a library a member on this form, corey, created called twod, however it lacks quite a bit of functionality compared to what I'm looking for.

Is drawing on the screen like you would with regular LWJGL not permitted while using jPCT?


----

Also, slightly off-topic, but is there a way to make Object3D collision ignore certain objects? Currently I'm using

Code: [Select]
(Object3D.COLLISION_CHECK_SELF | Object3D.COLLISION_CHECK_OTHERS);
However I want to make it so my players don't collide with other players.
« Last Edit: December 30, 2014, 10:27:38 am by CTucker1327 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Slick_Util rendering disabled while jPCT is rendering?
« Reply #1 on: December 30, 2014, 11:36:27 am »
jPCT doesn't do anything to prevent other libraries from doing their jobs but it doesn't do anything to explicitly enable them either. What this means is that jPCT as well as Slick assume the GL state machine to be in some defined state to do their work. If you want to mix the two, you somehow have to preserve and reset states between calls. I'm not sure how easy/difficult this is going to be and if it's actually worth it.

What exactly are you using slick utils for? Maybe there's some others way...

Offline CTucker1327

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Slick_Util rendering disabled while jPCT is rendering?
« Reply #2 on: December 30, 2014, 12:16:35 pm »
I'm honestly just getting started with graphical development with Java, I've always used Game-Engines such as Unity3D to take care of all the tedious stuff for me, and used Java for my servers. So, I may be jumping through numerous unrequired hoops.

Basically, I'm trying to create a UI for my game; Images that overlay in 2D, Text, etc.

Basic images and strings are support through the TwoD library released on the forum; However they don't allow for much more than that. (From what I can see). I'm mainly just trying to learn how to create interfaces for my game that I've used jPCT for, I'm pretty much at that point in development where interfaces are required to continue. Slick_util isn't required for this, I would assume, (The drawing of images, etc) however it's the most commonly used library, which is why I had attempted it.

If I could find a library that worked with jPCT that supported drag/drop, buttons, and sliders, as-well as input-fields it would be a gold mine(for me anyway), but after a bunch of searching I pretty much gave up and decided to try to create my own using slick_util for image loading/drawing. There's a lot of things I still don't know how to do, but these last few days have been a crazy learning experience.

tl;dr I need to create an interface for my game, I was going to use slick to render the images to use as a base.


 Problems such as clicking going through the interface into the game-world are also things I'm worried about. (However, I have a good idea on how to stop this)
« Last Edit: December 30, 2014, 12:22:52 pm by CTucker1327 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Slick_Util rendering disabled while jPCT is rendering?
« Reply #3 on: December 30, 2014, 01:33:20 pm »
jPCT offers various blit-methods in FrameBuffer for rendering 2d images on top (or behind) the scene. You can render whole textures, parts of textures both scaled and unscaled. That should actually be sufficient to create a simple 2d GUI framework. Are you missing something there?
« Last Edit: December 31, 2014, 12:06:51 am by EgonOlsen »

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Re: Slick_Util rendering disabled while jPCT is rendering?
« Reply #4 on: December 30, 2014, 09:24:12 pm »
I should mention the TwoD library I provided to OP is just an extension of raft's texture/font release, modified to make development a little easier for 3D beginners.

Offline CTucker1327

  • byte
  • *
  • Posts: 3
    • View Profile
Re: Slick_Util rendering disabled while jPCT is rendering?
« Reply #5 on: December 30, 2014, 11:16:45 pm »
jPCT offers various blit-methods in FrameBuffer for rendering 2d images on top (or behind) the scene. You can render while textures, parts of textures both scaled and unscaled. That should actually be sufficient to create a simple 2d GUI framework. Are you missing something there?

After smashing my head against the wall for a few hours, and studying the code provided by corey I've managed to write my own loader for 2D assets, and drawing them has never been easier. I'll continue on with this for the next few days and attempt to make a nice little open-sourced interface library for people to use.

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Re: Slick_Util rendering disabled while jPCT is rendering?
« Reply #6 on: December 31, 2014, 12:34:02 am »
jPCT offers various blit-methods in FrameBuffer for rendering 2d images on top (or behind) the scene. You can render while textures, parts of textures both scaled and unscaled. That should actually be sufficient to create a simple 2d GUI framework. Are you missing something there?

After smashing my head against the wall for a few hours, and studying the code provided by corey I've managed to write my own loader for 2D assets, and drawing them has never been easier. I'll continue on with this for the next few days and attempt to make a nice little open-sourced interface library for people to use.

Open source  ;D