• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GL2ES1类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.jogamp.opengl.GL2ES1的典型用法代码示例。如果您正苦于以下问题:Java GL2ES1类的具体用法?Java GL2ES1怎么用?Java GL2ES1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GL2ES1类属于com.jogamp.opengl包,在下文中一共展示了GL2ES1类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: reshape

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
@Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
	GL2 gl = drawable.getGL().getGL2();
	gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
	gl.glLoadIdentity();
	glu.gluOrtho2D(0, width, 0, height); // left, right, bottom, top
	/* layout components */
	Insets insets = getInsets();
	bodyArea = new Rectangle(insets.left, insets.bottom, width - insets.left - insets.right, height - insets.bottom - insets.top);
	// layout title
	titleArea.x = (width - titleArea.width) / 2;
	titleArea.y = height - (insets.top / 2) - titleArea.height;
	bodyArea.height -= titleArea.height;

	layoutComponents(gl, x, y, width, height);

	/* set cliping area for body: left, right, bottom, top. */
	gl.glClipPlane(GL2ES1.GL_CLIP_PLANE0, new double[]{1.0, 0.0, 0.0, -bodyArea.x}, 0);
	gl.glClipPlane(GL2ES1.GL_CLIP_PLANE1, new double[]{-1.0, 0.0, 0.0, bodyArea.x + bodyArea.width}, 0);
	gl.glClipPlane(GL2ES1.GL_CLIP_PLANE2, new double[]{0.0, 1.0, 0.0, -bodyArea.y}, 0);
	gl.glClipPlane(GL2ES1.GL_CLIP_PLANE3, new double[]{0.0, -1.0, 0.0, bodyArea.x + bodyArea.height}, 0);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:23,代码来源:Chart.java


示例2: reshape

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
@Override
public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
	disp.size[0] = (StaticVars.debugOn & StaticVars.debugWindow2x) ? width / 2 : width;
	disp.size[1] = (StaticVars.debugOn & StaticVars.debugWindow2x) ? height / 2 : height;
	final GL2ES1 gl = glad.getGL().getGL2ES1();
	if (width == 0) {
		width = 1;
	}
	if (height == 0) {
		height = 1;
	}

	gl.glViewport(0, 0, width, height);

	gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
	gl.glLoadIdentity();

	gl.glOrtho(0.0, (StaticVars.debugOn & StaticVars.debugWindow2x) ? width / 2 : width, (StaticVars.debugOn & StaticVars.debugWindow2x) ? height / 2 : height, 0.0, -1, 1);

	gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
	gl.glLoadIdentity();
}
 
开发者ID:XDrake99,项目名称:WarpPI,代码行数:23,代码来源:NEWTWindow.java


示例3: before

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
protected void before(GL gl) {
    if (gl.isGL2()) {
        gl.getGL2().glPushMatrix();
        // gl.glHint(GL2.GL_PERSPECTIVE_CORRECTION_HINT,GL2.GL_NICEST);
        gl.getGL2().glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL);
        // gl.glEnable(GL2.GL_POLYGON_OFFSET_FILL);
        // gl.glPolygonOffset(1.0f, 1.0f);
        gl.glEnable(GL.GL_TEXTURE_2D);
        gl.getGL2().glTexEnvf(GL.GL_TEXTURE_2D, GL2ES1.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
    } else {
        GLES2CompatUtils.glPushMatrix();
        GLES2CompatUtils.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL);
        gl.glEnable(GL.GL_TEXTURE_2D);
        GLES2CompatUtils.glTexEnvf(GL.GL_TEXTURE_2D, GL2ES1.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
    }
}
 
开发者ID:jzy3d,项目名称:bigpicture,代码行数:17,代码来源:AxeTextAnnotation.java


示例4: initialize

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
@Override
public void initialize(GraphicEngine d) {
	try {
		final OpenedTextureData i = GPURenderer.openTexture(texturePath, isResource);
		final GL2ES1 gl = GPURenderer.gl;
		t = GPURenderer.importTexture(i.f, i.deleteOnExit);
		w = i.w;
		h = i.h;
		t.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
		initialized = true;
	} catch (GLException | IOException e) {
		e.printStackTrace();
		System.exit(1);
	}
}
 
开发者ID:XDrake99,项目名称:WarpPI,代码行数:16,代码来源:GPUSkin.java


示例5: init

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
@Override
public void init(GLAutoDrawable drawable) {
	final GL2ES1 gl = drawable.getGL().getGL2ES1();

	//Vsync
	gl.setSwapInterval(2);

	//Textures
	gl.glEnable(GL.GL_TEXTURE_2D);

	//Transparency
	gl.glEnable(GL.GL_BLEND);
	gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
	gl.glShadeModel(GLLightingFunc.GL_FLAT);

	if (onInitialized != null) {
		onInitialized.run();
		onInitialized = null;
	}
	try {
		renderer.currentTex = ((GPUSkin) disp.loadSkin("test.png")).t;
	} catch (final Exception e) {
		e.printStackTrace();
	}

	System.err.println("Chosen GLCapabilities: " + drawable.getChosenGLCapabilities());
	System.err.println("INIT GL IS: " + gl.getClass().getName());
	System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
	System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
	System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
}
 
开发者ID:XDrake99,项目名称:WarpPI,代码行数:32,代码来源:NEWTWindow.java


示例6: initTest

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
protected boolean initTest(GL3 gl3) {

        gl3.glEnable(GL_ALPHA_TEST);
        ((GL2ES1) gl3).glAlphaFunc(GL_GREATER, 0.2f);

        //To test alpha blending:
//        gl3.glEnable(GL_BLEND);
//        gl3.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
        return checkError(gl3, "initTest");
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:11,代码来源:Gl_300_test_alpha.java


示例7: display

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
@Override
public void display(GLAutoDrawable glad) {
	final GL2ES1 gl = glad.getGL().getGL2ES1();

	GPURenderer.gl = gl;
	
	gl.glEnableClientState(GLPointerFunc.GL_COLOR_ARRAY);
	gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
	gl.glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
	
	renderer.updateDrawCycle(true, false);

	disp.repaint();

	renderer.updateDrawCycle(false, true);

	GPURenderer.gl = null;

	gl.glDisableClientState(GLPointerFunc.GL_COLOR_ARRAY);
	gl.glDisableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
	gl.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
}
 
开发者ID:XDrake99,项目名称:WarpPI,代码行数:23,代码来源:NEWTWindow.java


示例8: after

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
protected void after(GL gl) {
    gl.glDisable(GL.GL_TEXTURE_2D);
    gl.getGL2().glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_MODULATE);
    gl.getGL2().glPopMatrix();
}
 
开发者ID:jzy3d,项目名称:bigpicture,代码行数:6,代码来源:AxeTextAnnotation.java


示例9: init

import com.jogamp.opengl.GL2ES1; //导入依赖的package包/类
@Override
public void init(final GLAutoDrawable drawable) {
	WorkbenchHelper.run(() -> getCanvas().setVisible(visible));
	lightHelper = new LightHelper(this);
	gl = drawable.getGL().getGL2();
	openGL.setGL2(gl);
	keystone.setGLHelper(openGL);
	final Color bg = data.getBackgroundColor();
	gl.glClearColor(bg.getRed() / 255.0f, bg.getGreen() / 255.0f, bg.getBlue() / 255.0f, 1.0f);
	gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
	isNonPowerOf2TexturesAvailable = gl.isNPOTTextureAvailable();

	initializeCanvasListeners();
	updateCameraPosition();
	updatePerspective();

	// Putting the swap interval to 0 (instead of 1) seems to cure some of
	// the problems of resizing of views.
	gl.setSwapInterval(0);

	// Enable smooth shading, which blends colors nicely, and smoothes out
	// lighting.
	gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
	// Enabling the depth buffer & the depth testing
	gl.glClearDepth(1.0f);
	gl.glEnable(GL.GL_DEPTH_TEST); // enables depth testing
	gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do
	// Whether face culling is enabled or not
	if (GamaPreferences.Displays.ONLY_VISIBLE_FACES.getValue()) {
		gl.glEnable(GL.GL_CULL_FACE);
		gl.glCullFace(GL.GL_BACK);
	}
	// Turn on clockwise direction of vertices as an indication of "front" (important)f
	gl.glFrontFace(GL.GL_CW);

	lightHelper.initializeLighting(openGL);

	// Perspective correction
	gl.glHint(GL2ES1.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);

	// Enable texture 2D
	gl.glEnable(GL.GL_TEXTURE_2D);
	// Blending & alpha control
	gl.glEnable(GL.GL_BLEND);
	gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
	gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);
	gl.glEnable(GL2.GL_ALPHA_TEST);
	gl.glAlphaFunc(GL2.GL_GREATER, 0.01f);
	// Disabling line smoothing to only rely on FSAA
	// gl.glDisable(GL.GL_LINE_SMOOTH);
	// Enabling forced normalization of normal vectors (important)
	gl.glEnable(GL2.GL_NORMALIZE);
	// Enabling multi-sampling (necessary ?)
	// if (USE_MULTI_SAMPLE) {
	gl.glEnable(GL2.GL_MULTISAMPLE);
	gl.glHint(GL2.GL_MULTISAMPLE_FILTER_HINT_NV, GL2.GL_NICEST);
	// }
	openGL.initializeShapeCache();
	setUpKeystoneCoordinates();
	// We mark the renderer as inited
	inited = true;

}
 
开发者ID:gama-platform,项目名称:gama,代码行数:64,代码来源:JOGLRenderer.java



注:本文中的com.jogamp.opengl.GL2ES1类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TableScanOperator类代码示例发布时间:2022-05-23
下一篇:
Java Component类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap