Interview Questions.

Top 100+ Jogl Interview Questions And Answers

fluid

Top 100+ Jogl Interview Questions And Answers

Question 1. Why Does My Jogl Window Not Play Nicely With Swing?

Answer :

This is a trendy problem that all heavyweight additives have while mixed with Swing.

Question 2. Net.Java.Video games.Jogl.Glexception: Unable To Lock Surface?

Answer :

JOGL seems to have some very weird inner setup timing that reasons problems in atypical methods. This exception comes when you have tried to do something to the GLCanvas before including it to any other element that isn't always already seen. To keep away from this, make certain you name setVisible(authentic) at the containing Frame/Window earlier than adding the GLCanvas.

C++ Interview Questions
Question three. Nothing Is Being Drawn In A Canvas In Fullscreen Mode?

Answer :

A hassle that appears to be inherent in mixing swing with heavyweight additives on a Win32 machine (Java3D suffers from the identical problem, for example). This is because of some interactions with DirectDraw. To get the rendering going on again, set the following property on the command line to disable DirectDraw usage: -Dsun.Java2d.Noddraw=true.

Question 4. When I Use Feature X My Drawing Suddenly Drops To Glacial Speeds.

Answer :

Typically that is a sign that the drivers have defaulted back to software rendering (specifically in the case of shaders). Alternatively, you could not be picking up the best local drivers on your video card (on Win32, this appears to happen alarmingly often). Check that your drivers are up to date and that the features you want are supported in hardware. You may additionally ought to cut back your strategies to hold it in natural hardware.

C++ Tutorial
Question five. What Are The Runtime Opengl Version Requirements ?

Answer :

The present day JOGL2 spec is in WIP country, but often completed. We do now not require any extra features of GL variations > 1.1, hence it shall just paintings.

E.G. If you need to

assist OpenGL platforms not helping a model > 1.2
use GL ≥ 1.3 functions optionally
Just question their availability e.G.:

gl.IsExtensionAvailable("GL_VERSION_1_3")

If you name a > 1.2 GL characteristic wherein it isn't available, a GLException is thrown.

JOGL calls for as a minimum an OpenGL version 1.1, due to its dynamical feature binding beginning with OpenGL 1.2.

Core Java Interview Questions
Question 6. Runtime Version Check?

Answer :

The only verification of a JOGL build is to use the runtime model check and the runtime debug check.

Question 7. Jogl Demos?

Answer :

Let’s expect we're in the take a look at directory ‘check’, from which we perform from this point.

Get jogl-demos.7z. Extract the archive, i.E.
7z x jogl-demos.7z
Get jogamp-all-systems.7z. Extract the archive, i.E.
7z x jogamp-all-platforms.7z

Create a symbolic link or rename the archive
listing from jogamp-all-platforms to jogl, ie

ln -s jogamp-all-structures jogl.
If you like to check the binding to NV’s Cg, down load and install
We expect java is to your binary search path.

On X11/Unix and MaxOSX you can test the build as follows:

sh java-run-newt.Sh demos.Es2.RedSquare -GL2 -GL2 -GL2
sh java-run.Sh demos.Gears.Gears
and with debug output
sh java-dbg-newt.Sh demos.Es2.RedSquare -GL2 -GL2 -GL2
sh java-dbg.Sh demos.Gears.Gears

On Windows you will be capable of run:

java-win32.Bat demos.Es2.RedSquare -GL2 -GL2 -GL2
java-win32.Bat demos.Gears.Gears
and with debug output
java-win32-dbg.Bat demos.Es2.RedSquare -GL2 -GL2 -GL2
java-win32-dbg.Bat demos.Gears.Gears

The windows scripts are pretty simple and flat.

The magic unix scripts offer extra functions and can be used both within the autobuild environment or on your development one.

Setenv-jogl.Sh <JOGL-PROFILE> [<jogl-build-dir>]
Looks up and invokes profile.Jogl, reveals gluegen, units the environment variables (CLASSPATH, LD_LIBRARY_PATH & PATH).
Jogl/and so on/profile.Jogl <JOGL-PROFILE> [<jogl-build-dir>]
JOGL profiles are one of JOGL_ALL, JOGL_ES1_MIN, JOGL_ES1_MAX, JOGL_ES2_MIN, JOGL_ES2_MAX, JOGL_GL2ES12_MIN, JOGL_GL2ES12_MAX, JOGL_GL2_MIN, JOGL_GL2_MAX. Looks up the set of JAR documents important to satisfy the selected JOGL-PROFILE.

This allows you to test a selected surroundings, ie ES2 with out GL2 and AWT, using JOGL_ES2_MIN. For this example I might suggest the local ES2 implementation from imageon SDK_OGLES2_LINUX_PCEMULATION_2.02.22.0756.

Core Java Tutorial C Interview Questions
Question eight. Jogl, Platform And Opengl Version?

Answer :

Please carry out a runtime model test, which gives the subsequent records:

Platform
OS & version
Architecture
OpenGL Version
Java model (java -version)
JOGL version
GIT revision
Autobuild version
Send us the ensuing report

test.Log
.
Detailed Debug Log
Please carry out a runtime debug take a look at.
Send us the resulting report
test_dbg.Log
.

Detailed Bug Information

Your Test case
Source code, a junit take a look at would be best.
Invocation command-line
Exceptions, stdout/stderr log record
Applications

Adding a comprehensive junit check could help us the most to breed the computer virus, to talk about it with you and to acquire a good response time.

You might also add it to your bug document without delay or better, supply us your git repository pull request.

If possible, please upload the following machine properties to permit DEBUG logging: -Dnewt.Debug=all -Dnativewindow.Debug=all -Djogl.Debug=all

For example:

java -Djava.Awt.Headless=real tee RedSquare.Record.Log

Attach the log report in your computer virus report ..

Applets and Java Webstart

To take a look at applets and javaws use

the jcontrol panel
or edit the java residences document:
Unix: ~/.Java/deployment.Properties
Windows: Users<username>AppDataLocalLowSunJavaDeploymentdeployment.Homes
in which you add the following JRE Arguments. The jnlp prefix helps the javaws launch approach.

Jcontrol panel:
-Djnlp.Newt.Debug=all -Djnlp.Nativewindow.Debug=all -Djnlp.Jogl.Debug=all
houses file:
deployment.Javaws.Jre.0.Args=-Djnlp.Newt.Debug=all -Djnlp.Nativewindow.Debug=all -Djnlp.Jogl.Debug=all
Of course you need to upload these arguments to all of your JRE lines, ie zero and 1, and so on, if they exist.

You additionally need to

Enable logging/hint
Show the console window, or simply use the trendy log documents in
Unix: ~/.Java/deployment/log/, or
Windows: Users<username>AppDataLocalLowSunJavaDeploymentlog
Hence the java homes document (see region above) shall incorporate the following:

...
Deployment.Log=genuine
deployment.Trace=actual
deployment.Javaws.Jre.0.Args=-Djnlp.Newt.Debug=all -Djnlp.Nativewindow.Debug=all -Djnlp.Jogl.Debug=all
deployment.Javaws.Jre.1.Args=-Djnlp.Newt.Debug=all -Djnlp.Nativewindow.Debug=all -Djnlp.Jogl.Debug=all
...

Best practice:

Close your browser and make sure no JVM is strolling anymore
Delete all antique log documents in above log file folder
Start browser and the test applet
Close browser after check .. Maybe after some time in case you see nothing
Attach all new generated *.Hint documents on your worm record ..
Question nine. How To Build Jogl?

Answer :

Here are the stairs which might be required so that you can build JOGL.

Optain the source code using git:
Gluegen Dev GIT Repo
JOGL Dev GIT Repo
It is crucial which you checkout the source code beneath a commonplace root directory:

/domestic/dude/tasks/jogamp> git clone --recurse-submodules git://jogamp.Org/srv/scm/gluegen.Git gluegen

/domestic/dude/projects/jogamp> git clone --recurse-submodules git://jogamp.Org/srv/scm/jogl.Git jogl                           

Now you ought to have following listing shape:

    /home/dude/tasks/jogamp
    /home/dude/projects/jogamp/gluegen
    /domestic/dude/projects/jogamp/jogl                        

Note-1: The GlueGen supply ought to be fetched using -recurse-submodules, which imports JCPP, now used because the default C preprocessor.

Note-2: In case you do no longer get the JOGL resources with -recurse-submodules, you will leave out the following capabilities:

Note-three: OculusVR Support

Unset your CLASSPATH surroundings variable: 

The Ant construct requires that the JOGL jars no longer be seen on the classpath. On Unix, kind unsetenv CLASSPATH right into a csh or tcsh shell, or unset CLASSPATH into a Bourne shell. On Windows, type set CLASSPATH= into a command set off.

Optional Copy and edit gluegen.Residences: 

To specify specific basic alternatives for additives and compilers, copy gluegen/make/gluegen.Homes into your private home listing (pointed to with the aid of the Java machine belongings consumer.Domestic). 

Optional Copy and edit jogl.Homes: 

To specify different fundamental options for the construct, copy jogl/make/jogl.Houses into your house listing (pointed to by the Java system belongings consumer.Domestic). 

Edit the copy to trade preferred settings.

Build the source tree: 

Open a command shell within the "gluegen/make" directory of the source tree and kind "ant".

Then open a command shell in the "jogl/make" listing of the supply tree and kind "ant".

An experimental binding to the high-stage Cg language by NVidia company may be generated by specifying -Djogl.Cg=1 to ant; e.G. Ant -Djogl.Cg=1. The Cg binding has been examined on Windows, Linux, and Mac OS X.

Test your build: Stay on your command shell in the "jogl/make" directory of the supply tree and kind "ant junit.Run".

Build Javadoc: Stay to your command shell within the "jogl/make" listing of the source tree and sort "ant javadoc.All". This will produce the stop-person documentation for JOGL at the side of a few auxiliary software packages.

Note that there are a lot of warnings produced by ANTLR approximately the C grammar and our changes to some of the signatures of the productions; the C grammar warnings have been documented by way of the author of the grammar as having been investigated completely and innocent, and the warnings about our changes also are innocent.

Android Interview Questions
Question 10. How To Contribute?

Answer :

Basic contributions

Reporting a computer virus on our discussion board: This is useful and an awesome first step to getting a bug constant. If you are not pretty sure what you're seeing is a trojan horse, this is the quality way to record it, in place of going immediately to the worm database.
Submitting a bug record to our database: This is a totally valuable contribution. A complete worm document offers us a permanent file of the worm in a imperative location in which we can effortlessly consult with it later. You should usually attach failing Java code to the computer virus record to help us reproduce it.
At this level, you most effective want with the intention to down load and use a JogAmp project like JOGL. Here are a few useful hyperlinks:

Downloading and installing JOGL
Setting up a JogAmp mission on your favourite IDE
Advanced contributions

Submitting a trojan horse record with a unit take a look at: This no longer most effective documents the worm, but gives us a way to breed it in our automatic check suite. This insures that once the computer virus is fixed, it won't happen again later as the code is changed.
Submitting a worm record with a unit test and a repair: This is the pleasant feasible manner to insure that a computer virus gets fixed fast, seeing that you've submitted a whole bundle which the maintainer just needs to observe and approve.
Adding a brand new feature: This is the closing degree of contribution to JogAmp. Before starting at this degree, you must consult the module maintainer to make sure there may be settlement about the route you need to move. But apart from that, you're limited only via your imagination.
C Tutorial
Question 11. How To Develop Cross-device Applications?

Answer :

First you need to pick your lowest common denominator of an OpenGL profile, ie OpenGL ES1 or ES2. For either we offer an intersecting desktop GL profile, GL2ES1 or GL2ES2. Use the latter even as creating your GLCapabilities. Build and run your application with the minimal GL profile JARS, e.G. On the desktop use:

~/jogl-demos> . ./setenv-jogl.Sh JOGL_GL2ES12_MIN ../jogl/construct

Here you are on a Unix platform (not Window) and your commonplace build subdirectory is 'build'. Jogl-demos/setenv-jogl.Sh is supplied inside jogl-demos, which itself utilizes jogl/and so forth/profile.Jogl.

This makes use of the GlueGen/JOGL JARS:

gluegen-rt.Jar
jogl-all.Jar
This uses the GlueGen/JOGL atomic JARS for minimal deployment:

gluegen-gl.Jar
nativewindow-center.Jar
jogl-core.Jar
jogl-util.Jar
jogl-util-fixedfuncemu.Jar
newt-core.Jar
newt-awt.Jar
Now, the same Java software shall run on all gadgets, computer and mobile. See demos.Es1.RedSquare of the jogl-demos repository.

On the computing device you could run the ES1 demo:

~/jogl-demos> sh java-run-newt.Sh demos.Es1.RedSquare -GL2ES1

and the output is:

null RedSquare.Run() zero
User display screen size 0x0
Detected screen size 1920x1200
GLProfile[GL2ES1/GL2ES12] Entering initialization

GLProfile[GL2ES1/GL2ES12] GL Profile: GLProfile[GL2ES1/GL2ES12]

GLProfile[GL2ES1/GL2ES12] GL:com.Sun.Opengl.Impl.Gl2es12.GL2ES12Impl@b815859

GLProfile[GL2ES1/GL2ES12] GL_VERSION=3.Zero.0 NVIDIA 185.18.14

GLProfile[GL2ES1/GL2ES12] GL_EXTENSIONS: ..

Active Directory Interview Questions
Question 12. What Is Newt's Threading Model For Native Window Events ?

Answer :

As of nowadays, Newt's default threading version to deal with native occasions is the event dispatch thread (EDT) version.

Newt's EDT impl. Creates one EDT in step with NEWT Display, because the Display is a unique abstraction of a snap shots device connection serving all of it's Screens and Windows.

EDT is getting used to

dispatch native Screen and Window events
lifecycle Screen and Window capability
create / break
reparenting
local repaint calls (if no AnimatorControl is attached and animating)
..
EDT is not

blockading your rendering with occasion dispatching,
needed for pipelining your rendering instructions,
as a result now not hindering your excessive overall performance rendering in it is personal thread, eg an Animator
Using EDT isn't always obligatory, and you can turn it off inside the NewtFactory, and address the occasion dispatch manually.

C++ Interview Questions
Question thirteen. How To Use Newt With Multiple Windows & Threads?

Answer :

Newt is capable of coping with multiple threads and windows.

For great performance, you may create one thread in step with window, if feasible.

Below you notice the invocation of the ES2 RedSquare jogl-demos using more than one threads.

Single thread (Unix, Win32)
java -Djava.Awt.Headless=actual demos.Es2.RedSquare -GL2
Single thread (MacOSX)
java -XstartOnFirstThread -Djava.Awt.Headless=proper demos.Es2.RedSquare -GL2
Multiple threads & home windows (Unix, Win32)
java -Djava.Awt.Headless=actual demos.Es2.RedSquare -GL2 -GL2 -GL2 -GL2
Multiple threads & home windows (MacOSX)
java -XstartOnFirstThread -Djava.Awt.Headless=proper com.Sun.Javafx.Newt.Util.MainThread demos.Es2.RedSquare -GL2 -GL2 -GL2 -GL2
The serialization of the main Java magnificence thru com.Sun.Javafx.Newt.Util.MainThread can be used for all structures, because it only takes impact on MacOSX. This permits you an nearly platform impartial invocation of your multithreaded Java applications.

Android Tutorial
Question 14. Why Using Awt For High Performance Is Not A Good Idea ?

Answer :

AWT (on many implementations) holds the lock to the underlying native assets, e.G. X11 show, display and window floor, consequently we should obey these locks for any GL action sure to such.

This continues to be pretty standard matter as long these locks simplest ought to be carried out to the actual aid in use.

On AWT, it turns out that we need to use the worldwide JAWT toolkit lock for any native operation, ie OpenGL. This won't be a problem for a single threaded GL utility, however in case you start a multithreaded beast, you will apprehend that it's going to stumble around.

You can affirm this conduct with the ES1 RedSquare demo:

AWT - No VSync - One Thread
 java demos.Es1.RedSquare -awt -swapi zero -GL2
 5s: 3379f, 675 fps, 1 ms/f; total: 5s, 675 fps, 1 ms/f

Even right here you may revel in a few stuttering ..

If you pressure disabling the toolkit lock:

java -Dnativewindow.Nolocking=true demos.Es1.RedSquare -awt -swapi zero -GL2

The demo might also freeze all the time .. Due to native locking.

NEWT - No VSync - One Thread
java -Djava.Awt.Headless=proper demos.Es1.RedSquare -swapi 0 -GL2
5s: 5958f, 1191 fps, zero ms/f; general: 5s, 1191 fps, 0 ms/f

Runs an awful lot smoother .. Without the stuttering locking revel in ..

This will become a good deal clearer with extra threads:

AWT - No VSync - Three Threads
 java demos.Es1.RedSquare -awt -swapi zero -GL2 -GL2 -GL2
 5s: 772f, 151 fps, 6 ms/f; total: 5s, 151 fps, 6 ms/f

NEWT - No VSync - Three Threads
java -Djava.Awt.Headless=proper demos.Es1.RedSquare -swapi zero -GL2 -GL2 -GL2
5s: 1669f, 333 fps, 2 ms/f; overall: 5s, 333 fps, 2 ms/f

Question 15. Why Using Swing For High Performance Is Not A Good Idea ?

Answer :

First, all this inherents all arguments from 'Why the use of AWT for high performance isn't a good concept 

Second, it involves compositioning the usage of one of a kind methods, a few might not be to be had on a few structures.

From fast to gradual:

1.) External Java2D's GLContext and FBO object. 

GL stuff HW multiplied.
Available on some platforms: Linux/Windows Sun's Java2D impl.
Setup with System assets 'solar.Java2d.Opengl' to 'proper'.
Renders immediately into Java2D's FBO item, if available. 
2.) Own PBuffer GLContext, which has to be composed.

GL stuff HW improved.
Available on maximum systems: No dependency to Java2D implementation.
Renders into an own offscreen drawable, and copies it over to AWT's BufferedImage.
Three.) Own Pixmap GLContext, which needs to be composed.

GL stuff not likely hw extended.
Available on most platforms: No dependency to Java2D impl.
Renders into an very own offscreen drawable, and copies it over to AWT's BufferedImage.
As you notice, no straight forward HW rendering is worried, assuming that even the windowing supervisor is the usage of offscreen surfaces - you would have 2 compositions here already.

At least (1) could be 'appropriate' here, if available, but if simplest (2) is available - the overall performance might now not suit the state of the art!

Sure, it might be enough for a few UIs or static photos .. Or so, otherwise, I could opt for the 'overlay' technique, ie using a GLCanvas inside a Swing component, whilst no menu is being proven.

However you do it .. The prevalent AWT 'restrictions' follow here as properly.

Java Interview Questions




CFG