API from scratch instead of Java 2D or OpenGL (?)
Hey everyone!
I'm a beginner in Java, but have moderate programming skills. I want to program a basic game(engine) but don't have enough experience with Java 2D or OpenGL to really do what I want to do. So I thought about making my own API so I have full control and understanding over what's happening. But I have two questions regarding this:
1) To make an API for graphics, is basic understanding about coloring individual pixels enough to get started?
Because as far as I can figure, all that you would ever have to do is assign RGB and alpha values to an array of pixels, add or subtract them from other arrays to perform color/alpha blending and then draw the individual pixels from the final composite with a function that draws an individual pixel. Is this the proper way or a possible (basic) way to do this? Or is it far more complex than how I described it?
2) Will custom/improvised API's for graphics inherently be less efficient than established ones like Java 2D and OpenGL?
Are the functions that are accessible to me in a Java SDK enough to make a proper API? Or do the established API's make use of very sophisticated/inaccessible thingies that make them valid or more efficient to use as functional drawing tools?
I hope you could all understand what I meant and I hope that some of you have some good answers for me!
(...and I hope my use of the term 'API' is correct, lol.)
Thanks for reading!
Re: API from scratch instead of Java 2D or OpenGL (?)
Phwoar...! Making your own extensive graphics library is so much more complex than assigning pixel values.
I personally highly recommend you don't approaching this [read: create custom library] at the current time unless you're a math freak :p
My thoughts on the 2nd topic would be as follows:
- As far as Java 2D is concerned, I can only imagine it provides very little overhead as It's developed by Oracle.
- JOGL does have some overhead through binding of JNI, but wouldn't be too noticeable for a small game.
- I have no experience with Java 3D, so wouldn't be able to comment on that.
There are plenty of examples for JOGL and Java2D out there, but you might have a slightly harder learning curve with JOGL.
Re: API from scratch instead of Java 2D or OpenGL (?)
Thanks for your reply! I realize it's a few days old now but I haven't had much time to check this thread again and to thank you. :o