Slick_Util rendering disabled while jPCT is rendering?

Started by CTucker1327, December 30, 2014, 10:10:02 AM

Previous topic - Next topic

CTucker1327

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

(Object3D.COLLISION_CHECK_SELF | Object3D.COLLISION_CHECK_OTHERS);

However I want to make it so my players don't collide with other players.

EgonOlsen

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

CTucker1327

#2
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)

EgonOlsen

#3
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?

Minigame

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.

CTucker1327

Quote from: EgonOlsen 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 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.

Minigame

Quote from: CTucker1327 on December 30, 2014, 11:16:45 PM
Quote from: EgonOlsen 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 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