Exmirai Posted April 24, 2016 Posted April 24, 2016 Since OpenJK have modular renderer i think i can suggest following: what about creating class "Surface" which will replace/extend regular 2d draw system. We can draw text, rectangles, images, paint them ( may be even postprocess ( hello rend2 :> ) )In ui/cgame that can look like: Surface sufrace(640, 480); surface.paint( Color.Red ); surface.drawrectangle( 100, 100, 10, 10, Color.Green) surface.drawtext( 200, 200, "Hello World") surface.transform() -- whatever transformation surface.render() -- queue OR trap->RenderSurface(surface) would be good :>
Raz0r Posted April 24, 2016 Posted April 24, 2016 It would make more sense to redesign and expose more of the renderer than tacking on more abstractions that don't really fit.
ensiform Posted April 24, 2016 Posted April 24, 2016 I don't really see the benefit to this at the present time especially without major redesign. The original renderer wouldn't see any improvements using this type of change either.
eezstreet Posted April 24, 2016 Posted April 24, 2016 It would break compatibility. I'd rather see a widget-based system with only one call to start drawing an item and one call to stop drawing an item. This would be a significant improvement.
ensiform Posted April 24, 2016 Posted April 24, 2016 Text, rectangles, all supported already in cgame and ui... @@eezstreet unfortunately what you've suggested would be compat breaking too. As drawing must happen every frame.
eezstreet Posted April 24, 2016 Posted April 24, 2016 Text, rectangles, all supported already in cgame and ui... @@eezstreet unfortunately what you've suggested would be compat breaking too. As drawing must happen every frame.Naturally. I figured that if we were going to break compat, might as well improve efficiency.
Exmirai Posted April 24, 2016 Author Posted April 24, 2016 No. it will not break compat, why? we're could just add class in renderer/engine and link them. In cgame/ui we can just add RenderSurface() to trap->ext and there are wouldn't be any compat issues
ensiform Posted April 24, 2016 Posted April 24, 2016 JA++ is the only mod that is C++ anyway. Plus the GetModuleAPI is extern "C" so it must use C structures or void* afaik. Maybe your method wouldn't necessarily break compat but tbh I don't see it being something we need.
Futuza Posted April 25, 2016 Posted April 25, 2016 JKG is sorta in C++ just FYI. I think a new way of drawing ui elements might be nice, but I'm not sure it'd necessarily belong in openjk...maybe it'd be best to have it as a openjk add-on or something instead.
ensiform Posted April 25, 2016 Posted April 25, 2016 Yeah, this is a suggestion for OJK though not JKG specific.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now