当前位置: 首页>>代码示例>>C++>>正文


C++ GLFrame类代码示例

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


在下文中一共展示了GLFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Java_android_filterfw_core_GLFrame_setNativeTextureParam

jboolean Java_android_filterfw_core_GLFrame_setNativeTextureParam(JNIEnv* env,
                                                                  jobject thiz,
                                                                  jint param,
                                                                  jint value) {
  GLFrame* frame = ConvertFromJava<GLFrame>(env, thiz);
  return frame ? ToJBool(frame->SetTextureParameter(param, value)) : JNI_FALSE;
}
开发者ID:0omega,项目名称:platform_frameworks_base,代码行数:7,代码来源:jni_gl_frame.cpp

示例2: RenderScene

void RenderScene(void) {
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
	glEnable( GL_DEPTH_TEST ) ;
	glUseProgram(shader);
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

	float angle = timer.GetElapsedSeconds();

	M3DVector3f eye = {cos(angle)*4.0f,sin(angle)*4.0,sin(angle)*4.0f}; 
	M3DVector3f at = {0,0,0}; 
	M3DVector3f up = {0.0f,0.0f,1.0f};

	GLFrame cameraFrame;
	LookAt(cameraFrame, eye, at, up);
	cameraFrame.GetCameraMatrix(cameraMatrix);
	
	m3dMatrixMultiply44(matrix, viewFrustum.GetProjectionMatrix(), cameraMatrix);

	M3DMatrix44f tMatrix;
	m3dTranslationMatrix44(tMatrix, 0, 0, 0);
	m3dMatrixMultiply44(matrix, tMatrix, matrix);

	if((sin(angle) < 0 && sin(angle-0.003) > 0) || (sin(angle) > 0 && sin(angle-0.003) < 0)) {
		debugMatrix44(matrix);
	}

	glUniformMatrix4fv(MVPMatrixLocation,1,GL_FALSE,matrix);

//	drawGrid(0.1);
	drawPyramid();

	glutSwapBuffers();
	glutPostRedisplay();
}
开发者ID:rodriger,项目名称:Procesory-graficzne,代码行数:34,代码来源:piramida1.cpp

示例3: SetUpFrame

void SetUpFrame(GLFrame &frame,const M3DVector3f origin, const M3DVector3f forward, const M3DVector3f up) {
	frame.SetOrigin(origin);
	frame.SetForwardVector(forward);
	M3DVector3f side,oUp;
	m3dCrossProduct3(side,forward,up);
	m3dCrossProduct3(oUp,side,forward);
	frame.SetUpVector(oUp);
	frame.Normalize();
}
开发者ID:mateuszbartczak,项目名称:PPG1,代码行数:9,代码来源:triangle.cpp

示例4: Java_android_filterfw_core_GLFrame_setNativeViewport

jboolean Java_android_filterfw_core_GLFrame_setNativeViewport(JNIEnv* env,
                                                              jobject thiz,
                                                              jint x,
                                                              jint y,
                                                              jint width,
                                                              jint height) {
  GLFrame* frame = ConvertFromJava<GLFrame>(env, thiz);
  return frame ? ToJBool(frame->SetViewport(x, y, width, height)) : JNI_FALSE;
}
开发者ID:0omega,项目名称:platform_frameworks_base,代码行数:9,代码来源:jni_gl_frame.cpp

示例5: SetUpFrame

void SetUpFrame(GLFrame &cameraFrame,const M3DVector3f origin,
				const M3DVector3f forward,
				const M3DVector3f cameraUpDirection) {
					cameraFrame.SetOrigin(origin);
					cameraFrame.SetForwardVector(forward);
	M3DVector3f side,oUp;
	m3dCrossProduct3(side,forward,cameraUpDirection);
	m3dCrossProduct3(oUp,side,forward);
	cameraFrame.SetUpVector(oUp);
	cameraFrame.Normalize();
};
开发者ID:tbprojects,项目名称:pkg,代码行数:11,代码来源:excercise4.cpp

示例6: Java_android_filterfw_core_GLFrame_getNativeData

jbyteArray Java_android_filterfw_core_GLFrame_getNativeData(JNIEnv* env, jobject thiz) {
  GLFrame* frame = ConvertFromJava<GLFrame>(env, thiz);
  if (frame && frame->Size() > 0) {
    jbyteArray result = env->NewByteArray(frame->Size());
    jbyte* data = env->GetByteArrayElements(result, NULL);
    frame->CopyDataTo(reinterpret_cast<uint8_t*>(data), frame->Size());
    env->ReleaseByteArrayElements(result, data, 0);
    return result;
  }
  return NULL;
}
开发者ID:0omega,项目名称:platform_frameworks_base,代码行数:11,代码来源:jni_gl_frame.cpp

示例7: Java_android_filterfw_core_GLFrame_nativeAllocateExternal

jboolean Java_android_filterfw_core_GLFrame_nativeAllocateExternal(JNIEnv* env,
                                                                   jobject thiz,
                                                                   jobject gl_env) {
  GLEnv* gl_env_ptr = ConvertFromJava<GLEnv>(env, gl_env);
  if (!gl_env_ptr) return JNI_FALSE;
  GLFrame* frame = new GLFrame(gl_env_ptr);
  if (frame->InitWithExternalTexture()) {
    return ToJBool(WrapObjectInJava(frame, env, thiz, true));
  } else {
    delete frame;
    return JNI_FALSE;
  }
}
开发者ID:0omega,项目名称:platform_frameworks_base,代码行数:13,代码来源:jni_gl_frame.cpp

示例8: Java_android_filterfw_core_GLFrame_getNativeBitmap

jboolean Java_android_filterfw_core_GLFrame_getNativeBitmap(JNIEnv* env,
                                                            jobject thiz,
                                                            jobject bitmap) {
  GLFrame* frame = ConvertFromJava<GLFrame>(env, thiz);
  if (frame && bitmap) {
    uint8_t* pixels;
    const int result = AndroidBitmap_lockPixels(env, bitmap, reinterpret_cast<void**>(&pixels));
    if (result == ANDROID_BITMAP_RESUT_SUCCESS) {
      frame->CopyDataTo(pixels, frame->Size());
      return (AndroidBitmap_unlockPixels(env, bitmap) == ANDROID_BITMAP_RESUT_SUCCESS);
    }
  }
  return JNI_FALSE;
}
开发者ID:0omega,项目名称:platform_frameworks_base,代码行数:14,代码来源:jni_gl_frame.cpp

示例9: Java_android_filterfw_core_GLFrame_nativeAllocateWithFbo

jboolean Java_android_filterfw_core_GLFrame_nativeAllocateWithFbo(JNIEnv* env,
                                                                  jobject thiz,
                                                                  jobject gl_env,
                                                                  jint fbo_id,
                                                                  jint width,
                                                                  jint height) {
  GLEnv* gl_env_ptr = ConvertFromJava<GLEnv>(env, gl_env);
  if (!gl_env_ptr) return JNI_FALSE;
  GLFrame* frame = new GLFrame(gl_env_ptr);
  if (frame->InitWithFbo(fbo_id, width, height)) {
    return ToJBool(WrapObjectInJava(frame, env, thiz, true));
  } else {
    delete frame;
    return JNI_FALSE;
  }
}
开发者ID:0omega,项目名称:platform_frameworks_base,代码行数:16,代码来源:jni_gl_frame.cpp

示例10: setupRC

void setupRC()
{
	expCounter = counterLoader();

	//BG:
	glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

	//Enable depth testing so things won't look effed up:
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_SRC_COLOR);

	//Initialize stock shaders from GLTools:
	shaderManager.InitializeStockShaders();
	
	//Move cam back:
	cameraFrame.MoveForward(-30.0f);
	cameraFrame.MoveRight(-5.0f);
	cameraFrame.MoveUp(-8.0f);

	newDeskButton.init(20, 80, 165, 70, "Assets/button_new_desk165x70.tga");
	removeDeskButton.init(208, 80, 175, 67, "Assets/button_remove_desk175x67.tga");
	exportButton.init(403, 80, 168, 67, "Assets/button_export168x67.tga");

	M3DVector4f deskShine = {0.5, 0.5, 0.5, 1.0};
	M3DVector4f deskColor = {0.0f, 0.0f, 0.5f, 1.0f};

	hlGrid.init(0.0f, 0.0f, 0.0f, C_DM/2);
	cRoom.init();
	stuDesks.init(deskColor, deskShine, C_DM/2);
}
开发者ID:Errim,项目名称:Datorsalsplaneraren,代码行数:31,代码来源:main.cpp

示例11: mouseCameraFunc

void mouseCameraFunc(int x, int y)
{
	if (mouseActive)
	{
		GLfloat angle = 0.005f;

		if (x > W_WIDTH/2)
		{
			cameraFrame.RotateWorld(-angle*(x-W_WIDTH/2), 0, 0, 1);
			glutWarpPointer(W_WIDTH/2, W_HEIGHT/2);
		}
		else if (x < W_WIDTH/2)
		{
			cameraFrame.RotateWorld(angle*(W_WIDTH/2-x), 0, 0, 1);
			glutWarpPointer(W_WIDTH/2, W_HEIGHT/2);
		}
		if (y > W_HEIGHT/2 && pitch < 90)
		{
			cameraFrame.RotateLocalX(-angle*(W_HEIGHT/2-y));
			glutWarpPointer(W_WIDTH/2, W_HEIGHT/2);
			pitch = pitch + (-angle*(W_HEIGHT/2-y));
		}
		else if (y < W_HEIGHT/2 && pitch > -90)
		{
			cameraFrame.RotateLocalX(angle*(y-W_HEIGHT/2));
			glutWarpPointer(W_WIDTH/2, W_HEIGHT/2);
			pitch = pitch + (angle*(y-W_HEIGHT/2));
		}
	}
}
开发者ID:Errim,项目名称:Datorsalsplaneraren,代码行数:30,代码来源:main.cpp

示例12: NonASCIIKeyboardPress

void NonASCIIKeyboardPress(int key, int mouseXPosition, int mouseYPosition)
{	
  switch (key) {
    case UP_KEY:
      cameraFrame.MoveForward(CAMERA_LINEAR_STEP);
      break;

    case DOWN_KEY:
      cameraFrame.MoveForward(-CAMERA_LINEAR_STEP);
      break;

    case LEFT_KEY:
      cameraFrame.RotateWorld(CAMERA_ANGULAR_STEP, 0.0f, 1.0f, 0.0f);
      break;

    case RIGHT_KEY:
      cameraFrame.RotateWorld(-CAMERA_ANGULAR_STEP, 0.0f, 1.0f, 0.0f);
      break;

    case F1_KEY:
      fullscreen = !fullscreen;
      fullscreen ? glutFullScreen() : glutReshapeWindow(ORIG_WINDOW_SIZE[0], ORIG_WINDOW_SIZE[1]);
      break;

    default:
      break;
  }
}
开发者ID:marksands,项目名称:Themepark,代码行数:28,代码来源:FerrisWheelTextured.cpp

示例13: SpecialKeys

void SpecialKeys(int key, int x, int y)
{
	float linear = 0.1f;
	float angular = float(m3dDegToRad(5.0f));

	if (key == GLUT_KEY_UP)
	{
		cameraFrame.MoveForward(linear);
	}

	if (key == GLUT_KEY_DOWN)
	{
		cameraFrame.MoveForward(-linear);
	}

	if (key == GLUT_KEY_LEFT)
	{
		cameraFrame.RotateWorld(angular, 0.0f, 1.0f, 0.0f);
	}

	if (key == GLUT_KEY_RIGHT)
	{
		cameraFrame.RotateWorld(-angular, 0.0f, 1.0f, 0.0f);
	}
}
开发者ID:wjingzhe,项目名称:OpenGL_SB5_static,代码行数:25,代码来源:SphereWorld.cpp

示例14: RenderScene

///////////////////////////////////////////////////////////////////////////////
// Called to draw scene
void RenderScene(void)
	{    
    static GLfloat vLightPos [] = { 1.0f, 1.0f, 0.0f };
    static GLfloat vWhite [] = { 1.0f, 1.0f, 1.0f, 1.0f };
    
	// Clear the window with current clearing color
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

	modelViewMatrix.PushMatrix();
		M3DMatrix44f mCamera;
		cameraFrame.GetCameraMatrix(mCamera);
		modelViewMatrix.MultMatrix(mCamera);

        M3DMatrix44f mObjectFrame;
        objectFrame.GetMatrix(mObjectFrame);
        modelViewMatrix.MultMatrix(mObjectFrame);

        glBindTexture(GL_TEXTURE_2D, textureID);
        shaderManager.UseStockShader(GLT_SHADER_TEXTURE_POINT_LIGHT_DIFF, 
                                     transformPipeline.GetModelViewMatrix(),
                                     transformPipeline.GetProjectionMatrix(), 
                                     vLightPos, vWhite, 0);

        pyramidBatch.Draw();

		
	modelViewMatrix.PopMatrix();

	// Flush drawing commands
	glutSwapBuffers();
    }
开发者ID:1085075003,项目名称:oglsuperbible5,代码行数:33,代码来源:Pyramid.cpp

示例15: SpecialKeys

void SpecialKeys(int key, int x, int y)
{
    if(key == GLUT_KEY_UP) objectFrame.RotateWorld(m3dDegToRad(-5.0f), 1.0f, 0.0f, 0.0f);
    if(key == GLUT_KEY_DOWN) objectFrame.RotateWorld(m3dDegToRad(5.0f), 1.0f, 0.0f, 0.0f);
    if(key == GLUT_KEY_LEFT) objectFrame.RotateWorld(m3dDegToRad(-5.0f), 0.0f, 1.0f, 0.0f);
    if(key == GLUT_KEY_RIGHT) objectFrame.RotateWorld(m3dDegToRad(5.0f), 0.0f, 1.0f, 0.0f);
    
    glutPostRedisplay();
}
开发者ID:XadillaX,项目名称:opengl-superbible-learning,代码行数:9,代码来源:primitives.cpp


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