use of maspack.util.Logger in project artisynth_core by artisynth.
the class GLViewer method init.
/**
* Called any time GL context is switched! e.g. moving window to new display
*/
public void init(GLAutoDrawable drawable) {
GL gl = drawable.getGL();
String renderer = gl.glGetString(GL.GL_RENDERER);
String version = gl.glGetString(GL.GL_VERSION);
Logger logger = Logger.getSystemLogger();
logger.info("GL Renderer: " + renderer);
logger.info("OpenGL Version: " + version);
setMultiSampleEnabled(true);
myActiveColor = ActiveColor.DEFAULT;
}
use of maspack.util.Logger in project artisynth_core by artisynth.
the class GL3JPanelTest method init.
@Override
public void init(GLAutoDrawable drawable) {
GL3 gl = drawable.getGL().getGL3();
gl.glViewport(0, 0, width, height);
resources.init(drawable);
progManager.init(gl, lightManager.numLights(), 0);
// initialize buffers
initPrograms(gl);
initBuffers(gl);
String glslVersion = gl.glGetString(GL3.GL_SHADING_LANGUAGE_VERSION);
Logger logger = Logger.getSystemLogger();
logger.info("GLSL Version: " + glslVersion);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
}
use of maspack.util.Logger in project artisynth_core by artisynth.
the class GL3Viewer method init.
@Override
public void init(GLAutoDrawable drawable) {
super.init(drawable);
this.drawable = drawable;
this.gl = GL3Utilities.wrap(drawable.getGL().getGL3());
String glslVersion = gl.glGetString(GL3.GL_SHADING_LANGUAGE_VERSION);
Logger logger = Logger.getSystemLogger();
logger.info("GLSL Version: " + glslVersion);
gl.setSwapInterval(1);
int[] buff = new int[1];
gl.glGetIntegerv(GL3.GL_MAX_CLIP_DISTANCES, buff, 0);
maxClipPlanes = buff[0];
selectEnabled = false;
selectTrigger = false;
setLightingEnabled(true);
setDepthEnabled(true);
setColorEnabled(true);
setVertexColoringEnabled(true);
setTextureMappingEnabled(true);
setFaceStyle(FaceStyle.FRONT);
setShading(Shading.SMOOTH);
setGammaCorrectionEnabled(true);
gl.glClearColor(backgroundColor[0], backgroundColor[1], backgroundColor[2], backgroundColor[3]);
resetViewVolume(gl);
invalidateModelMatrix();
invalidateProjectionMatrix();
invalidateViewMatrix();
myProgManager.init(gl, lightManager.numLights(), 0);
myProgManager.setMatrices(gl, projectionMatrix, viewMatrix, modelMatrix, modelNormalMatrix, textureMatrix);
myProgManager.setLights(gl, lightManager.getLights(), 1.0f / lightManager.getMaxIntensity(), viewMatrix);
myProgManager.setMaterials(gl, myCurrentMaterial, myCurrentMaterial);
// trigger update of materials
myCurrentMaterialModified = true;
myTextRenderer = GLTextRenderer.generate(gl, GL3PipelineRenderer.generate(gl, myGLResources.getVertexNormalAttribute().getLocation(), myGLResources.getVertexColorAttribute().getLocation(), myGLResources.getVertexTexcoordAttribute().getLocation(), myGLResources.getVertexPositionAttribute().getLocation()));
// create a basic position-based flexible object
gloFlex = GL3FlexObject.generate(gl, myGLResources.getVertexPositionAttribute(), myGLResources.getVertexNormalAttribute(), myGLResources.getVertexColorAttribute(), myGLResources.getVertexTexcoordAttribute());
eaFlex = ElementArray.generate(gl);
// trigger rebuild of renderables
buildInternalRenderList();
Logger.getSystemLogger().debug("GL3 initialized");
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
this.gl = null;
this.drawable = null;
}