Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (739)
Games in Android Showcase (224)
games submitted by our members
Games in WIP (820)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  glvertex  (Read 1507 times)
0 Members and 1 Guest are viewing this topic.
Offline zeroin23

Junior Newbie

Java games rock!

« Posted 2004-12-16 02:53:45 »

I am a noob in GL

was wondering since java is used

why cant I just used glvertex(x,y,z)

instead of glvertex3f(x,y,z)
or glvertex2f()  etc forcing me to remember all the different type of parameters I put in ?

etc .. I noticed this is a big problem
and this is the reason I hated C++ yet ... seeing this being done in java really sadden me....
Offline turquoise3232

Junior Devvie

Java (games) rock!

« Reply #1 - Posted 2004-12-16 03:57:20 »


Well it may not be a good answer but since JOGL is a binding to openGl, you find the same method calls and it's a good point for many users.
For me, dealing with glblahblah3f, 2i, 4d is not a great problem and can help you to remember exactly what your are doing in huge projects.
Offline zeroin23

Junior Newbie

Java games rock!

« Reply #2 - Posted 2004-12-16 06:13:24 »

just another idea I had ...

imagine writing a dynamic code
that will generate glvertex dynamically for you

it could generate via different method such as 4 floating pts numbers or 2 double or via vector etc ....

if I were to write a generator, this implies I need a separate code to generate glvertex4f() glvertex2d etc ... instead of just glvertex ....

this the beauty of polymorphism being expressed and used.

the origin glvertex2f etc calling is good when you are porting the codes over from C++ for example to jogl ... but when you are writing a new program or like me trying to learn opengl ... it increases the learning time trying to recalled all the different combinations to called.

dont mind, I am a total noob in programming also ... java is my first and only programming I have done till now.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline domstyledesign

Senior Newbie


« Reply #3 - Posted 2004-12-20 02:37:39 »

i don't think you mean polymorphism, i think you're talking about overloaded methods.

anyways, if you'd really prefer to have 1 function format, just do your own overloaded method

void glVertexAny(int x, int y, int z){ ... }
void glVertexAny(double x, double y, double z){ ... }
void glVertexAny(float x, float y, float z){ ... }
void glVertexAny(int array){ ... }
void glVertexAny(double array){ ... }
void glVertexAny(float array){ ... }

Offline zeroin23

Junior Newbie

Java games rock!

« Reply #4 - Posted 2004-12-20 04:05:17 »

oops ... you are correct I meant overloading.

I can do my own overloading... but was wondering why it wasnt design to be part of it in jogl ....
this is only glvertex ... what about other methods ? do I always have to do my own ? wouldnt it be easier to just remember glvertex ... instead of all the different input parameters ?

this could collapse the number of different function calls I need to remember. it would speed up my programming else I would always need to reference the api for different type of the same function.

Offline turquoise3232

Junior Devvie

Java (games) rock!

« Reply #5 - Posted 2004-12-20 04:30:25 »

In fact it's just the same.
On the one hand you have to remember which parameters can be put into the glVertex() overloaded methods (for example  you can put 3 floats)
On the other hand you have to remember that you can use 3 floats for glVertex3f  and so on...

Once again, JOGL is a binding to the C API, and a lot a developpers are used to use glVertex3f, it's not the biggest problem you will face with openGL :  Wink
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Ecumene (53 views)
2017-09-30 02:57:34

theagentd (76 views)
2017-09-26 18:23:31

cybrmynd (184 views)
2017-08-02 12:28:51

cybrmynd (182 views)
2017-08-02 12:19:43

cybrmynd (189 views)
2017-08-02 12:18:09

Sralse (198 views)
2017-07-25 17:13:48

Archive (747 views)
2017-04-27 17:45:51

buddyBro (881 views)
2017-04-05 03:38:00

CopyableCougar4 (1429 views)
2017-03-24 15:39:42

theagentd (1320 views)
2017-03-24 15:32:08
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!