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


C++ DrawGLScene函数代码示例

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


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

示例1: processMouseActiveMotion

// Fonction d'interaction : choix de l'opération à faire (cinématique directe / inverse)
void processMouseActiveMotion(int x, int y)
{
			
  switch (m_boutton)
    {

      // Cinématique inverse
    case GLUT_LEFT_BUTTON : // Manipulation par cinématique inverse

      //..

      break;





      // Cinématique directe
    case GLUT_MIDDLE_BUTTON : // Manipulation directe du segment UpArm

      //..

      break;

    case GLUT_RIGHT_BUTTON : // Manipulation durecte du segment LowArm
      
      m_LowArm.rot.z = m_Grab_LowArm_Rot_Z + ROTATE_SPEED  * (m_mousepos_x - x);
      DrawGLScene();
      
      break;
    }


}
开发者ID:JulieNguyenD,项目名称:2016-IG,代码行数:35,代码来源:TD_animation_3D_2.c

示例2: update

void update(int value){
	


	DrawGLScene();
	glutPostRedisplay();		
	
//	block_left =block_left +  0.1f;		
//	robot_rot ++ ;
	//	printf("%f\n",Scale);
	_model->advance(0.025f);
	if(flag_scale==0){
		Scale = Scale + 0.1;
		block_left = block_left + 0.1f;
	}
	else{
		block_left = block_left - 0.1f;
		Scale = Scale - 0.1;
	}
	if(Scale >= 2.0 || Scale <= 0.0)
		flag_scale = !flag_scale ;
/*	if(w_flag!=1){
		_model->setAnimation("stand");
		w_flag=0;
	}*/

	glutTimerFunc(100,update,0);
}
开发者ID:ashu1461,项目名称:Projects,代码行数:28,代码来源:copy5.cpp

示例3: OnPaint

void OnPaint(HWND hwnd)
{
	DrawGLScene();
	SwapBuffers(hDC);
	DrawPicture(hwnd);
	DrawFigure();
}
开发者ID:ProfessorWho,项目名称:Draveris,代码行数:7,代码来源:control.c

示例4: main

int main(void) {
//---------------------------------------------------------------------------------
	
        tblu = bluCreate();
	initRes();
	bsp = *((bluSprite*)tblu->System_ResourceFactory());
	tblu->Input_Init();
	tblu->GFX_Initiate();	
	tblu->GFX_LDSprite(&bsp);
	tblu->GFX_InitAnimationFrames(&tban, 2);
	tblu->GFX_AddAnimationFrame(&tban, 0, sgunTiles, sgunPal, sgunTilesLen, sgunPalLen);
	tblu->GFX_AddAnimationFrame(&tban, 1, sgunTiles+512, sgunPal, sgunTilesLen, sgunPalLen);
	tblu->System_SetFunc(FrameProc, BLUFRAMFUNC);
	consoleDemoInit();  //setup the sub screen for printing
	tblu->System_Start();

	tblu->GFX_Init3DDevice();
	while(1){
	DrawGLScene();
	glFlush(0);	

	}

/*	tblu->Release();
	while(1) {

		touchRead(&touch);
		iprintf("Touch y = %04i, %04i\n", touch.rawy, touch.py);

		swiWaitForVBlank();
	}

*/	return 0;
}
开发者ID:leffuy,项目名称:babycthulu,代码行数:34,代码来源:newMoney.cpp

示例5: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
	MSG		msg;								
	BOOL	done=FALSE;						

	init("window",640,480);

	if (CreateGLWindow() == FALSE){
		return 0;									
	}
	elemInit();
	while(!done){
		if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
			if (msg.message==WM_QUIT){
				done=TRUE;
			}else{
				TranslateMessage(&msg);				
				DispatchMessage(&msg);				
			}
		}else{
			if (keys[VK_ESCAPE]){
				done=TRUE;						
			}else{
				DrawGLScene();					
				SwapBuffers(hDC);			
			}
		}
	}

	KillGLWindow();									
	return (msg.wParam);							
}
开发者ID:frozlok,项目名称:kursDesc,代码行数:31,代码来源:init.cpp

示例6: keyPressed

void keyPressed(unsigned char key, int x, int y) 
{
  switch(key) {
    case 27:
      glutDestroyWindow(window); 
      exit(0);                   
    case 'r':
      doRotate = !doRotate;
      break;
    case 't':
      doTranslate = !doTranslate;
      break;
    case 's':
      doScale = !doScale;
      break;
    case '+':
      speed *= 1.1;
      frame = 0;
      break;
    case '-':
      speed /= 1.1;
      frame = 0;
      break;
    default:
      useMyOrtho = !useMyOrtho;
      ReSizeGLScene(windowWidth,windowHeight);
  }      
  DrawGLScene();
}
开发者ID:rkalis,项目名称:graphics,代码行数:29,代码来源:main.c

示例7: callback_display

/***************************************************************************
 callback_display
 ****************************************************************************/
void callback_display(void)
{
    //GLint viewport[4];
    //glGetIntegerv(GL_VIEWPORT, viewport);
    
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
	
    //gluPerspective(15.0, aspect, zNear, zFar);
	
    //glOrtho(-1/sdepth*kWindowWidth, 1/sdepth*kWindowWidth, -1/sdepth*kWindowHeight, 1/sdepth*kWindowHeight, zNear, zFar);
    glTranslatef(0.0,0.0,-100);
	
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity(); 
    //glTranslatef(0.0,0.0,-sdepth);
    glRotatef(-stheta, 1.0, 0.0, 0.0);
    glRotatef(sphi, 0.0, 0.0, 1.0);
    
	
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    DrawGLScene();
    
    //glTranslatef(0.0,0.0, sdepth);
    glutSwapBuffers();
}
开发者ID:AlexWoroschilow,项目名称:wurst-alphabet,代码行数:29,代码来源:GeneratePreviewForURL.c

示例8: update_sdl_scene

static gboolean
update_sdl_scene (void *fk)
{
  GstElement *fakesink = (GstElement *) fk;
  GMainLoop *loop =
      (GMainLoop *) g_object_get_data (G_OBJECT (fakesink), "loop");
  GAsyncQueue *queue_input_buf =
      (GAsyncQueue *) g_object_get_data (G_OBJECT (fakesink),
      "queue_input_buf");
  GAsyncQueue *queue_output_buf =
      (GAsyncQueue *) g_object_get_data (G_OBJECT (fakesink),
      "queue_output_buf");
  GstBuffer *buf = (GstBuffer *) g_async_queue_pop (queue_input_buf);

  SDL_Event event;
  while (SDL_PollEvent (&event)) {
    if (event.type == SDL_QUIT) {
      g_main_loop_quit (loop);
    }
    if (event.type == SDL_KEYDOWN) {
      if (event.key.keysym.sym == SDLK_ESCAPE) {
        g_main_loop_quit (loop);
      }
    }
  }

  DrawGLScene (buf);

  /* push buffer so it can be unref later */
  g_async_queue_push (queue_output_buf, buf);

  return FALSE;
}
开发者ID:ego5710,项目名称:gst-plugins-bad,代码行数:33,代码来源:sdlshare.c

示例9: ResizeScene

LRESULT CGLLogoView::OnSize(UINT, WPARAM, LPARAM lParam, BOOL&)
{
	ResizeScene(LOWORD(lParam),HIWORD(lParam));  // LoWord=width, HiWord=height
	DrawGLScene();
	SwapBuffers(hDC);
	return TRUE;								
}
开发者ID:evpobr,项目名称:fictionbookeditor,代码行数:7,代码来源:GLLogo.cpp

示例10: WinMain

int WINAPI WinMain(	HINSTANCE	hInstance,			// Instance
					HINSTANCE	hPrevInstance,		// Previous Instance
					LPSTR		lpCmdLine,			// Command Line Parameters
					int			nCmdShow)			// Window Show State
{
	MSG		msg;									// Windows Message Structure
	BOOL	done=FALSE;								// Bool Variable To Exit Loop

	// Ask The User Which Screen Mode They Prefer
	if (MessageBox(NULL,"Would You Like To Run In Fullscreen Mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)
	{
		fullscreen=FALSE;							// Windowed Mode
	}

	InitVars();                                     // Initialize Variables

	// Create Our OpenGL Window
	if (!CreateGLWindow("Magic Room",640,480,16,fullscreen))
	{
		return 0;									// Quit If Window Was Not Created
	}

	while(!done)									// Loop That Runs While done=FALSE
	{
		if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))	// Is There A Message Waiting?
		{
			if (msg.message==WM_QUIT)				// Have We Received A Quit Message?
			{
				done=TRUE;							// If So done=TRUE
			}
			else									// If Not, Deal With Window Messages
			{
				TranslateMessage(&msg);				// Translate The Message
				DispatchMessage(&msg);				// Dispatch The Message
			}
		}
		else										// If There Are No Messages
		    if (active)
			{
				// Draw The Scene.  Watch For ESC Key And Quit Messages From DrawGLScene()
				if (keys[VK_ESCAPE])	// Active?  Was There A Quit Received?
				{
					done=TRUE;							// ESC or DrawGLScene Signalled A Quit
				}
				else									// Not Time To Quit, Update Screen
				{
					idle();                             // Advance Simulation
					DrawGLScene();                      // Draw Scene
					SwapBuffers(hDC);					// Swap Buffers (Double Buffering)
				}
	
				if (!ProcessKeys()) return 0;
			}
	}

	// Shutdown
	KillGLWindow();									// Kill The Window
    glDeleteTextures(4,texture);
	return (msg.wParam);							// Exit The Program
}
开发者ID:Hengplank,项目名称:kucgbowling,代码行数:60,代码来源:Lesson30.cpp

示例11: keyPressed

void keyPressed(unsigned char key, int x, int y)
{
    switch(key) {
    case 27:
      glutDestroyWindow(window);
      exit(0);
    case 'r':
      x_rotation = 0.0f;
      z_rotation = 0.0f;
      rotation_mode = ROTATE_X_AND_Z;
      printf("X and Z rotation reset to 0 degrees\n");
      printf("Mouse rotates around both X and Z axes\n");
      break;
    case 'x':
      rotation_mode = ROTATE_ONLY_X;
      printf("Mouse rotates only around X axis\n");
      break;
    case 'z':
      rotation_mode = ROTATE_ONLY_Z;
      printf("Mouse rotates only around Z axis\n");
      break;
    }

    DrawGLScene();
}
开发者ID:maarten990,项目名称:Graphics,代码行数:25,代码来源:gimbal.c

示例12: ScreenSaverProc

LONG WINAPI ScreenSaverProc(HWND hwnd,UINT message,WPARAM wparam,LPARAM lparam){
    // Handles screen saver messages
    switch(message)
    {
    case WM_CREATE:
        // Creation of the screen saver window
		hWnd = hwnd;
		SetupOpenGL();
		// Set Timer (Target 60 fps ish (1000/60 = 16)
		uTimer = SetTimer(hwnd, 1, 16, NULL);
        return 0;

    case WM_ERASEBKGND:
        // Erases the screen saver background
		// Not needed with OpenGL
        return 0;

    case WM_TIMER:
        // Handles the timer
		DrawGLScene();
        return 0;

    case WM_DESTROY:
        // Cleans up the screen saver window
		KillTimer(hwnd, uTimer);
		KillGL();
        PostQuitMessage(0);
        return 0;
    }
    return DefScreenSaverProc(hwnd,message,wparam,lparam);
}
开发者ID:sethcoder,项目名称:dlstorm-screensavers,代码行数:31,代码来源:Happening.cpp

示例13: WinMain

int WINAPI WinMain(HINSTANCE hInstance,
	HINSTANCE hPreInstance,
	LPSTR lpCmdLine,
	int cmdShow)
{
	MSG msg;
	BOOL done = false;

	CreateGLWindow("openGL", 640, 480, 32, true);


	while (!done)
	{
		if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
			if (msg.message == WM_QUIT)
			{
				done = TRUE;
			}
			else
			{
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
		}
		else
		{
			if (active)
			{
				if (keys[VK_ESCAPE])
				{
					done = TRUE;
				}
				else
				{
					DrawGLScene();
					SwapBuffers(hDC);
				}
			}
			if (keys[VK_F1])
			{
				keys[VK_F1] = FALSE;
				KillGLWindow();
				fullscreen = !fullscreen;
				if (!CreateGLWindow("NeHe's OpenGL Framework", 640, 480, 16, fullscreen))
				{
					return 0;
				}
			}
		}
	}
	//注册窗口类

	//程序初始化

	//消息循环
	return (msg.wParam);
}
开发者ID:GGBone,项目名称:Nehe,代码行数:58,代码来源:main.cpp

示例14: main

int main() {
		
	// Setup the Main screen for 3D 
	videoSetMode(MODE_0_3D);
		
	// initialize the geometry engine
	glInit();
	
	// enable antialiasing
	glEnable(GL_ANTIALIAS);
	
	// setup the rear plane
	glClearColor(0,0,0,31); // BG must be opaque for AA to work
	glClearPolyID(63); // BG must have a unique polygon ID for AA to work
	glClearDepth(0x7FFF);
	
	// Set our viewport to be the same size as the screen
	glViewport(0,0,255,191);
	
	// setup the view
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(70, 256.0 / 192.0, 0.1, 100);
	
	
	//ds specific, several attributes can be set here	
	glPolyFmt(POLY_ALPHA(31) | POLY_CULL_NONE);
	
	while (1) 
	{
		// Set the current matrix to be the model matrix
		glMatrixMode(GL_MODELVIEW);
		
		glColor3f(1, 1, 1);									// Set the color..not in nehe source...ds gl default will be black
		
		//Push our original Matrix onto the stack (save state)
		glPushMatrix();	

		DrawGLScene();
		
		// Pop our Matrix from the stack (restore state)
		glPopMatrix(1);

		//a handy little built in function to wait for a screen refresh
		swiWaitForVBlank();

		// flush to screen	
		glFlush(0);

		scanKeys();

		int pressed = keysDown();

		if(pressed & KEY_START) break;	
	}
	
	return 0;
}
开发者ID:devkitPro,项目名称:nds-examples,代码行数:58,代码来源:nehe1.cpp

示例15: specialKeyPressed

void
specialKeyPressed(int key, int x, int y)
{
    (void)x;
    (void)y;
    (void)key;

    DrawGLScene();
}
开发者ID:DavidvanErkelens,项目名称:Graphics,代码行数:9,代码来源:main.c


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