Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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 OS/X, Linux problems  (Read 806 times)
0 Members and 1 Guest are viewing this topic.
Offline sjk

Senior Newbie





« Posted 2013-08-27 22:04:18 »

Hey guys. I finished my first Ludum Dare entry on Sunday and got some problems with cross-platform support. Everything runs fine on Windows machines but it seems to crash on start-up on Mac and Linux. The first problem was that I worked with Java 1.7 but in the meantime I switched to 1.6. I'm using LWJGL and OpenGL 3.2.

Since I don't own a Mac or have a Linux system it's quite hard to find the problem. But through people posting about the crashes it seem to be this part of the code where the error occurs:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
int shaderHandle = GL20.glCreateShader(shaderType);

if (shaderHandle != 0) {
   GL20.glShaderSource(shaderHandle, shaderSource);
   GL20.glCompileShader(shaderHandle);
   int compileStatus = GL20.glGetShaderi(shaderHandle, GL20.GL_COMPILE_STATUS);
   
   if (compileStatus == 0) {
      System.out.println("Error compiling shader: GL20.glGetShaderInfoLog(shaderHandle)");
      GL20.glDeleteShader(shaderHandle);
      shaderHandle = 0;
   }
}

if (shaderHandle == 0) {        
   throw new RuntimeException("Error creating shader.");
}


"GL20.glCreateShader(shaderType)" seems to fail and returns 0.

This is how I'm initiating OpenGL on start-up:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
PixelFormat pixelFormat = new PixelFormat();
ContextAttribs contextAtrributes = new ContextAttribs(3, 2).withForwardCompatible(true).withProfileCore(true);

try {
   Display.setDisplayMode(new DisplayMode(RESOLUTION.width,RESOLUTION.height));
   Display.setTitle(WINDOW_TITLE);
   Display.create(pixelFormat, contextAtrributes);
} catch (LWJGLException e) {
   e.printStackTrace();
   System.exit(-1);
}


Any ideas how to handle this and/or how to approach cross platform games?



All the posts about the errors are located here:
http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid=26860
Offline HeroesGraveDev

JGO Kernel


Medals: 269
Projects: 11
Exp: 2 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #1 - Posted 2013-08-28 05:26:24 »

At least one of the errors is outdated java (unsupported major minor version: 51.0)

Not sure about the others

Offline SHC
« Reply #2 - Posted 2013-08-28 05:31:34 »

Running fine on my hackintosh. Mountain Lion 10.8.3

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2013-08-28 08:45:17 »

OT: Really need to make a Hackintosh. My mac Mini is just so colossally inconvenient to use. Anybody got any tips here?

Cas Smiley

Offline sjk

Senior Newbie





« Reply #4 - Posted 2013-08-28 08:52:18 »

The major minor version was caused because I used 1.7 but in the meantime I switched to 1.6.

At least it's good to know that it runs on some systems.
Offline SHC
« Reply #5 - Posted 2013-08-28 10:10:57 »

@princec

You can easily boot hacked distributions of OS X to work on a normal pc. (Retail dvd is tough to use).

This guide helped me to make my hackintosh and I dual boot windows 8 and mountain lion using NIRESH ISO.

Niresh's OS X 10.8.2 <-- download niresh

And here's the guide.

How to install OS X Mountain Lion on your PC with Niresh

Be sure to install windows 8 and os x on two separate hdds.

Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #6 - Posted 2013-08-28 12:14:21 »

Hm, I don't have a spare HDD, nor even a spare SATA port to bung one in! What a pain. Thanks for the link though.

Cas Smiley

Offline Several Kilo-Bytes

Senior Duke


Medals: 11



« Reply #7 - Posted 2013-08-28 19:15:36 »

You can run different operating systems in a virtual machine. The CPU should run at or near native speed with relatively recent hardware and modern VMs. I am not sure about 3D support, but I would be more surprised if it did not work well enough to use than if it worked perfectly.
Offline princec

JGO Kernel


Medals: 404
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2013-08-28 19:59:01 »

I was planning to try it in VirtualBox. But I expect that it won't work.

Cas Smiley

Offline elamre

JGO Coder


Medals: 17
Projects: 1


hitar!


« Reply #9 - Posted 2013-08-28 20:13:43 »

@princec

You can easily boot hacked distributions of OS X to work on a normal pc. (Retail dvd is tough to use).

This guide helped me to make my hackintosh and I dual boot windows 7 and mountain lion using NIRESH ISO.

Niresh's OS X 10.8.2 <-- download niresh

And here's the guide.

How to install OS X Mountain Lion on your PC with Niresh

Be sure to install windows 7 and os x on two separate hdds.

fixed it for you Smiley
Also i dont see how using hackintosh would be less inconvienient than a mac mini. Especially the drivers are real annoying to get right.

My projects:
Tower Defence!]http://www.java-gaming.org/topics/iconified/25690/view.html]Tower Defence! [lll.......] 30%!
Lightsnakerider! [llllll....] 60%!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zngga
« Reply #10 - Posted 2013-08-30 02:31:36 »

Hijacked threads are hijacked.  Grin

My code never has bugs... it just develops unexpected features!
Offline Z-Man
« Reply #11 - Posted 2013-08-30 04:07:43 »

I was planning to try it in VirtualBox. But I expect that it won't work.

Cas Smiley
I tried doing this with Mac OS X 10.6 and the OpenGL drivers are there but they aren't a very recent version, so you might have trouble with that.
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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!