Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (672)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
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  
  OpenGL: Can you use a mixture of old and new OpenGL functions?  (Read 995 times)
0 Members and 1 Guest are viewing this topic.
Offline tom_mai78101
« Posted 2013-12-26 04:05:44 »

Like this, for example:

   public void initialize() {
      try {
         Display.setDisplayMode(new DisplayMode(WIDTH, HEIGHT));
      catch (LWJGLException e) {
   public void start() {
      Random random = new Random();
      while (!Display.isCloseRequested()) {
         GL11.glViewport(0, 0, WIDTH, HEIGHT);
         GL11.glClearColor(random.nextFloat(), random.nextFloat(), random.nextFloat(), 1.0f);
         //Some other codes irrelevant to this in-between these commented periods.
         int vertexShader = GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
         GL20.glShaderSource(vertexShader, vertexShaderCode);

And possible go from GL20 to GL30 and back to GL20, etc.? I know some functions were deprecated, but what if you can reuse old specifications and put them together in the new specifications of a program?
Offline Opiop
« Reply #1 - Posted 2013-12-26 04:17:54 »

You can use whatever functions you want as long as they work together. Nothing is going to stop you from using shaders with display lists, or buffer objects mixed with immediate mode etc... OpenGL is just a graphics library with a bunch of functions for the programmer to use. It's up to you to choose which ones will fit your needs, or the standards you employ.

I would like to note that some programmers do like to only use certain versions of OpenGL, for instance only using 4.x or above, which deprecates a lot of old code. Some people don't care what version number they use, and that's fine too.
Offline ra4king

JGO Kernel

Medals: 422
Projects: 3
Exp: 5 years

I'm the King!

« Reply #2 - Posted 2013-12-26 04:19:57 »

New versions build (or deprecate) on older versions. LWJGL simply has the functions and enums grouped into the version they were introduced in. You can use all that's appropriate and necessary.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom_mai78101
« Reply #3 - Posted 2013-12-26 04:22:37 »

For that case, I have come across an annoyance.

For deprecated OpenGL functions that were deprecated in the newer OpenGL specifications, but not in the older specifications, how do I disable the deprecated strikethrough and to limit the deprecation detection by specific classes only? As in, I'm only limiting myself to use OpenGL 2.0 and less, so please don't tell me that they are deprecated, as I know they are in the newer versions of OpenGL.
Offline Opiop
« Reply #4 - Posted 2013-12-26 04:25:02 »

No, they are not included in the new versions of OpenGL. Some functions are deprecated, some are outright removed, but when you use old deprecated functions, you are actually using the old OpenGL packages, not the new ones.

I do not know strikethroughs you're getting though, what IDE are you using?
Offline tom_mai78101
« Reply #5 - Posted 2013-12-26 08:17:22 »

Eclipse Java, Kelper.

Offline ra4king

JGO Kernel

Medals: 422
Projects: 3
Exp: 5 years

I'm the King!

« Reply #6 - Posted 2013-12-26 08:28:35 »

That OpenGL function is not deprecated. That LWJGL method is deprecated. It is now called glGetShaderi(int, int) Smiley

See here for more details about this change:;topic=4721.0

Offline tom_mai78101
« Reply #7 - Posted 2013-12-26 09:27:58 »

Ah, thanks.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

IanParcs (54 views)
2016-04-18 14:18:53

KaiHH (50 views)
2016-04-18 08:35:41

KaiHH (80 views)
2016-04-15 12:43:58

theagentd (83 views)
2016-04-14 02:16:17

theagentd (98 views)
2016-04-14 02:15:43

IanParcs (120 views)
2016-04-12 03:51:16

IanParcs (52 views)
2016-04-12 03:50:03

IanParcs (48 views)
2016-04-12 03:49:54

IanParcs (46 views)
2016-04-12 03:49:52

IanParcs (55 views)
2016-04-12 03:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30 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!