Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 1025 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 Member




Java (games) rock!


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

Hi,

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




raR.


« 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 Member




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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (24 views)
2014-09-19 03:14:18

Dwinin (39 views)
2014-09-12 09:08:26

Norakomi (68 views)
2014-09-10 13:57:51

TehJavaDev (93 views)
2014-09-10 06:39:09

Tekkerue (47 views)
2014-09-09 02:24:56

mitcheeb (68 views)
2014-09-08 06:06:29

BurntPizza (51 views)
2014-09-07 01:13:42

Longarmx (38 views)
2014-09-07 01:12:14

Longarmx (44 views)
2014-09-07 01:11:22

Longarmx (40 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!