Texture Rendering works on Windows but not Mac OS? - java

So I am building this game and a map editor / sdk type deal to go with it. On my desktop pc running w7 and my buddies laptop running w10 everything works absolutely fine. I can add objects and move them around (there is also an auto updating properties window to go with each obj) and everything is great.
I am currently traveling so I decided to copy the project over to my macbook. Everything UI wise still works with the exception of things stopped rendering. I know the objects exist within the app because I can click where they would be and the properties update like the would on my desktop the textures just simply are not rendering. I am using a standard orthographic camera and spritebatch setup i've done 1million times and i have all the matricies being forwarded to the batch from the camera as well as your standard color buffer bit glclear call and glclearcolor calls. Why would moving this project to my macbook make textures quit rendering?
Using jdk / jre 1.8_91 on both machines and the same ver of eclipse (mars).
EDIT: ShapeRenderer is not working as well. I also have already tried removing the camera entirely and still no-go. During my rendering loop I am able to print out accurate pixel RBG values and width/height of images that should be rendering which means I am not dealing with some odd nullptr or anything of that nature.

I figured out the issue. By resizing my window the jmenus popup and so do all my renderables. For some reason calling pack() is not working on the frame and I have to resize it to refresh everything at first launch of the app now for this problem =P

Related

Programmatically check OpenGL support

My swing application is trying to use OpenGL to get better performance. But on some machines the UI doesnt load at all. How could i determine programmatically if OpenGl is supported so i could switch between xrenderer/OpenGL?
xrenderer works fine on all machines ive tested but id rather use OpenGL
This is what im using to enabled OpenGL
System.setProperty("sun.java2d.opengl","True");
This is what i get on the console:
"OpenGL pipeline enabled for default config on screen 1". I think this means that OpenGL is on, but the UI components wont load and the screen is white. I can still click on the invisible buttoms though.
(source: i.ibb.co)
EDIT: Sort of figured out the problem, OpenGL is enabled on screen 1 but not on screen 0. I dont know how to force it to be enabled on both 0 and 1. Disconnecting the second display caused OpenGL to bve enabled on screen 0, but this did not help and the app is still blank

Slick2D weird focus/graphical window glitch-like issue?

I'm making a basic game with Slick2D, and have pretty much followed thenewboston's tutorials to the line, up to the episode I have linked. However, when I run the code, the game window starts out of focus, in the background of my other windows. When I manually select it to look at it and bring it into focus, it looks like this:
Sometimes it's just a black window, and sometimes it's this glitchy-looking mess. Also, If you'll notice, the window itself has out-of-focus graphical qualities, even while in focus. None of the buttons at the top left do anything or even graphically respond to a click/hover. However, the window does close upon termination of the program.
I run LWJGL v2.9.3, Slick2D build 237, IntelliJ IDEA CE 2016.3.1 (tested with 2016.2.4 as well), and Mac OS 10.12 Sierra. I've tested this separately with Java 7 and 8, and both produce this result. If anyone can help, I thank you wholeheartedly in advance.
Edit: I've tried running a generic Slick2D demo from the internet (which can be found at gist.github.com/massimomusante/5459957), which should work since I assume it's a tested and very simple demo, but the same kind of thing happens with the out-of-focus black window. So I know it has to do with my setup rather than my game. In terms of native Slick2D/LWJGL stuff, I've tried running the original code with both the packaged Slick2D natives and the LWJGL natives, and the issue still persisted, so natives are likely not the issue either.

JavaFX 8 screen rendering freezes when running with hw acceleration enabled

One of our JavaFX 8 freezes quite frequently when running on Microsoft Surface 3, every now and then when running on a different tablet running Windows 8 and once in a blue moon when running on a normal desktop.
If we run it with prism.order=sw, it doesn't freeze but the performance on tablets is a little bit too slow to be usable.
When it the screen freezes, one can still click on the screen and all events and the JavaFX thread appear to be working as usual but it just seems that the prism / quantum rendering or whatever it is that it actually converts the scenegraph to pixels crashed.
I've reported a bug in the old JIRA and new JBS and apparently we need to produce a reproducible test case which we don't have time to prepare.
Any ideas as to why this can be happening? Anyone has had this happening as well? Any hints as to how to get to the root of the problem?

Eclipse not showing UI properly

I have transfered my eclipse project from my pc to a laptop. It is a java 3d project, and it should show the main frame with some buttons on the buttonbar at the top, and on the rest of the screen the display of a SimpleUniverse
What happens is that all the button stuff is displayed, but not the actual java 3d thing, the usual black of the SimpleUniverse and all the interactions supposed to be available are not. Instead, there is just everything gray inside the frame.
Now the wierd thing comes along. When I do a command from the buttons which modifies in any way the BranchGroup atached to the SimpleUniverse, everything is back to normal, all functions work. I think this might be due to the fact that I detach the BranchGroup, do the required changes and then attach is back. But still, the question remains.. Why does not is work properly in the first place?
P.S. All the libraries are included and the laptop works better than the PC, has better video card, 1Gb RAM more and a better processor, so I don't think it is a hardware problem

Java Applet, AWT Refresh, issue on Mac OS X 10.4

We have a Java Applet built using AWT. This applet lets you select pictures from your hard drive and upload them to a server. The applet includes a scrollable list of pictures, which works fine in Windows, Linux and Mac OS X 10.5. We launch this applet via Java Web Start or within a web page.
Our applet does not behave properly in Mac OS X 10.4, regardless of the version of Java (1.4 or 1.5). You can find a screenshot of the incorrect behaviour, when scrolling, here:
http://www.lavablast.com/tmp/ui_error.png
Simply put, sometimes when scrolling the pictures end up overlapping the header or footer of the application. This behaviour does not occur on other platforms. On Mac OS X 10.4, it shows the pictures in the incorrect location when scrolling, which would not be so bad if it refreshed the screen after painting the image at that location. However, it does not appear that the application knows it painted it incorrectly and thus does not refresh.
If the window is minimized, resized or even moved, the application is refreshed and the incorrectly positioned elements vanish and the application resumes normally. I spent quite some time trying to force a refresh of the background image unsuccessfully. (the repaint the image directly, repaint all children of a few panels, etc. ) Thus, I am looking for any tips that would help me resolve this problem under Mac OS X 10.4 or, in the worst case, simply simulate a full applet refresh.
Until recently, everything was compatible with Java 1.1 but this has changed in a few locations which now require 1.4. I don't feel these changes created the issue, I am just providing this as extra information. If you are interested in implementation details of the scroll panel, I will investigate, but I am assuming this is a common platform bug for which workarounds must be known.
To replicate the problem, open the following Java Web Start application:
http://www.lavablast.com/tmp/opal-webstart.php.jnlp
Select a folder containing lots of images and play with the scrollbar. At some point (fairly quickly), you should get the refresh problem.
Edit: I followed the first suggestion here and replaced all my controls that feature background images with a Swing equivalent and the issue is still there. (Plus, there are numerous other fixes I would need to do to do a complete change). Any other ideas? A simple one line of code that forces a full refresh would be great :)
Edit2: The main thread creates the panels and launches X threads. Using an observer/notifier pattern, the threads complete and notify the main control, which adds a panel to the page. This is done via an EventQueue.invokeLater which, unless I am mistaken, should run on the right thread. The issue is at its most severe when scrolling even if no extra threads are running (as during the loading).
It does look like mixing lightweight (usually Swing) and heavyweight (AWT) components together. Moving to Swing you need to replace every last AWT component Swing equivalents (hint: avoid import java.awt.*).
Threading is often a potential problem for odd bugs. Swing components must always be used on the EDT (use java.awt.EventQueue.invokeLater). AWT is thread-safe is theory, but not in practice - also restrict usage to the EDT.
As you already require Java 1.4 you should consider some small changes to take into use SWING GUI instead, it solved our Applet refresh issues with AWT. (Mac, Linux etc)
If you have e.g. Panel, you need to replace it with JPanel etc.
You need this:
import javax.swing.*;

Categories

Resources