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

C++ renderFrame函数代码示例

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

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



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

示例1: ofClear

void ofxWater::update(){
    // Calculate the difference between buffers and spread the waving
    updateFbo.begin();
    ofClear(0);
    updateShader.begin();
    updateShader.setUniformTexture("buffer1Sample", pingPong.src->getTextureReference(), 0);
    updateShader.setUniformTexture("buffer2Sample", pingPong.dst->getTextureReference(), 1);
    updateShader.setUniform1f("damping", (float)density );
    renderFrame();
    updateShader.end();
    updateFbo.end();
    
    // Blur the waving in order to make it smooth
    pingPong.src->begin();
    blurShader.begin();
    blurShader.setUniformTexture("tex", updateFbo.getTextureReference(), 0);
    blurShader.setUniform1f("fade_const", (float)(blurFade));
    renderFrame();
    blurShader.end();
    pingPong.src->end();
    
    // Use the buffer as a bumpmap to morph the surface of the background texture
    renderFbo.begin();
    ofClear(0);
    renderShader.begin();
    renderShader.setUniformTexture("tex", *texture , 0);
    renderShader.setUniformTexture("heightMap", updateFbo.getTextureReference(), 1);
    renderFrame();
    renderShader.end();
    renderFbo.end();
    
    // Switch buffers
    pingPong.swap();
}
开发者ID:burningneutron,项目名称:ofxFX,代码行数:34,代码来源:ofxWater.cpp


示例2: checkWindowResized

void Engine::updateFrame(bool interactible, long deltaTime)
{
	if (interactible)
	{
		// Each frame, we check to see if the window has resized.  While the
		// various events we get _should_ cover this, in practice, it appears
		// that the safest move across all platforms and OSes is to check at 
		// the top of each frame
		checkWindowResized();

		// We're "interactible", i.e. focused, so we play the music
		playLoopedMusic(true);

		// Time stands still when we're auto-paused, and we don't
		// automatically render
		if (getAppUIMode() == MODE_GAMEPLAY)
		{
			// only advance the "game" timer in gameplay mode
			advanceTime(deltaTime);

			// This will try to set up EGL if it isn't set up
			// When we first set up EGL completely, we also load our GLES resources
			// If these are already set up or we succeed at setting them all up now, then
			// we go ahead and render.
			renderFrame(true);
		}
		else if (isForcedRenderPending()) 
		{
			// forced rendering when needed for UI, etc
			renderFrame(true);
		}
	}
	else
	{
		// Even if we are not interactible, we may be visible, so we
		// HAVE to do any forced renderings if we can.  We must also
		// check for resize, since that may have been the point of the
		// forced render request in the first place!
		if (isForcedRenderPending() && mEgl.isReadyToRender(false)) 
		{
			checkWindowResized();
			renderFrame(false);
		}

		// We're not "interactible", so we'd better stop the music immediately
		playLoopedMusic(false);
	}
}
开发者ID:CZdravko,项目名称:NV-Globe,代码行数:48,代码来源:engine.cpp


示例3: windowProc

static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg) {
	case WM_DESTROY:
		PostQuitMessage(0);
		break;

	case WM_ERASEBKGND:
		return 0;

	case WM_PAINT:
		renderFrame();
		return 0;

	case WM_MOUSEMOVE:		return mouseEvent(lParam, 0);
	case WM_LBUTTONDOWN:	return mouseEvent(lParam, 1);
	case WM_LBUTTONUP:		return mouseEvent(lParam, -1);
	case WM_RBUTTONDOWN:	return mouseEvent(lParam, 2);
	case WM_RBUTTONUP:		return mouseEvent(lParam, -2);

	case WM_SIZE:
		InvalidateRect(hWnd, NULL, FALSE);
		width = LOWORD(lParam);
		height = HIWORD(lParam);
		glViewport(0, 0, width, height);
		break;

	default:
		break;
	}

	return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
开发者ID:fluffyfreak,项目名称:sphere_filling_curve,代码行数:33,代码来源:main.cpp


示例4: WinMain

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	createWindow(hInstance);
	createGLContext();
	imguiRenderGLInit("c:\\windows\\fonts\\calibri.ttf");

	timeBeginPeriod(1);

	ShowWindow(hWnd, SW_SHOW);

	for (;;) {
		MSG msg;
		while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
			if (msg.message == WM_QUIT)
				return 0;

			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}

		renderFrame();
	}

	timeEndPeriod(1);
}
开发者ID:fluffyfreak,项目名称:sphere_filling_curve,代码行数:25,代码来源:main.cpp


示例5: while

bool LeverControl::process(uint32 deltaTimeInMillis) {
	if (!_enabled) {
		return false;
	}

	if (_isReturning) {
		_accumulatedTime += deltaTimeInMillis;
		while (_accumulatedTime >= ANIMATION_FRAME_TIME) {
			_accumulatedTime -= ANIMATION_FRAME_TIME;
			if (_returnRoutesCurrentFrame == *_returnRoutesCurrentProgress) {
				_returnRoutesCurrentProgress++;
			}
			if (_returnRoutesCurrentProgress == _frameInfo[_currentFrame].returnRoute.end()) {
				_isReturning = false;
				_currentFrame = _returnRoutesCurrentFrame;
				return false;
			}

			uint toFrame = *_returnRoutesCurrentProgress;
			if (_returnRoutesCurrentFrame < toFrame) {
				_returnRoutesCurrentFrame++;
			} else if (_returnRoutesCurrentFrame > toFrame) {
				_returnRoutesCurrentFrame--;
			}

			_engine->getScriptManager()->setStateValue(_key, _returnRoutesCurrentFrame);
			renderFrame(_returnRoutesCurrentFrame);
		}
	}
	
	return false;
}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:32,代码来源:lever_control.cpp


示例6: startAtFrame

void AVISurface::playCutscene(const Rect &r, uint startFrame, uint endFrame) {
	bool isDifferent = _movieFrameSurface[0]->w != r.width() ||
		_movieFrameSurface[0]->h != r.height();

	startAtFrame(startFrame);
	_currentFrame = startFrame;

	while (_currentFrame < (int)endFrame && !g_vm->shouldQuit()) {
		if (isNextFrame()) {
			renderFrame();
			++_currentFrame;

			if (isDifferent) {
				// Clear the destination area, and use the transBlitFrom method,
				// which supports arbitrary scaling, to reduce to the desired size
				g_vm->_screen->fillRect(r, 0);
				g_vm->_screen->transBlitFrom(*_movieFrameSurface[0],
					Common::Rect(0, 0, _movieFrameSurface[0]->w, _movieFrameSurface[0]->h), r);
			} else {
				g_vm->_screen->blitFrom(*_movieFrameSurface[0], Common::Point(r.left, r.top));
			}

			g_vm->_screen->update();
			g_vm->_events->pollEvents();
		}

		// Brief wait, and check at the same time for clicks to abort the clip
		if (g_vm->_events->waitForPress(10))
			break;
	}

	stop();
}
开发者ID:DrItanium,项目名称:scummvm,代码行数:33,代码来源:avi_surface.cpp


示例7: main

int main(int argc, char** argv) {
  fullscreen = false;
  grab = false;
  quit = false;
  initScreen();
  initFrameBuffer();
  createGLContext();
  createColorMap();

  createWindow();
  
  createBlankCursor();
  
  int x = 0;
  
  while(x<5000) {
    renderFrame();
    updateWindowTitle();
    x++;
    }
  
  
      /* Cleanup 
    glXDestroyWindow(display, glxwindow);
    xcb_destroy_window(connection, window);
    glXDestroyContext(display, context);
    XCloseDisplay(display);
      */
  
  return 0;
}
开发者ID:lubosz,项目名称:smalldemo,代码行数:31,代码来源:xcb.c


示例8: twang_draw

static unsigned long
twang_draw (Display *dpy, Window window, void *closure)
{
  struct state *st = (struct state *) closure;

  if (st->img_loader)   /* still loading */
    {
      st->img_loader = load_image_async_simple (st->img_loader, 0, 0, 0, 0, 0);
      if (! st->img_loader) {  /* just finished */
        grabImage_done (st);
      }
      return st->delay;
    }

  if (!st->img_loader &&
      st->start_time + st->duration < time ((time_t *) 0)) {
    XWindowAttributes xgwa;
    XGetWindowAttributes (st->dpy, st->window, &xgwa);
    grabImage_start (st, &xgwa);
    return st->delay;
  }

  modelEvents (st);
  updateModel (st);
  renderFrame (st);
  return st->delay;
}
开发者ID:Zygo,项目名称:xscreensaver,代码行数:27,代码来源:twang.c


示例9: seekToFrame

bool AVISurface::startAtFrame(int frameNumber) {
	if (isPlaying())
		// If it's already playing, then don't allow it
		return false;

	if (frameNumber == -1)
		// Default to starting frame of first movie range
		frameNumber = _movieRangeInfo.front()->_startFrame;
	if (_isReversed && frameNumber == (int)_decoder->getFrameCount())
		--frameNumber;

	// Start the playback
	_decoder->start();

	// Seek to the starting frame
	seekToFrame(frameNumber);

	// If we're in reverse playback, set the decoder to play in reverse
	if (_isReversed)
		_decoder->setRate(Common::Rational(-1));

	renderFrame();

	return true;
}
开发者ID:DrItanium,项目名称:scummvm,代码行数:25,代码来源:avi_surface.cpp


示例10: renderFrame

void Animation::render(int xaxis, int yaxis, const Graphics::Bitmap &work, double scalex, double scaley){
    if (getState().position >= frames.size()){
        return;
    }

    Mugen::Effects effects = frames[getState().position]->effects;
    effects.scalex = scalex;
    effects.scaley = scaley;

    renderFrame(frames[getState().position], xaxis, yaxis, work, effects);

#if 0
    // Modify with frame adjustment
    const int placex = xaxis+frames[position]->xoffset;
    const int placey = yaxis+frames[position]->yoffset;
    try{
        frames[position]->sprite->render(placex,placey,work,frames[position]->effects);
        
        if (showDefense){
            renderCollision( frames[position]->defenseCollision, work, xaxis, yaxis, Bitmap::makeColor( 0,255,0 ) );
        }

        if (showOffense){
            renderCollision( frames[position]->attackCollision, work, xaxis, yaxis,  Bitmap::makeColor( 255,0,0 ) );
        }
    } catch (const LoadException & e){
        Global::debug(0) << "Error loading sprite: " << e.getReason() << endl;
        /* FIXME: do something sensible here */
        frames[position]->sprite = 0;
    }
#endif
}
开发者ID:boyjimeking,项目名称:paintown,代码行数:32,代码来源:animation.cpp


示例11: if

void Animation::render(bool facing, bool vfacing, const int xaxis, const int yaxis, const Graphics::Bitmap &work, const double scalex, const double scaley, Graphics::Bitmap::Filter * filter){
    if (getState().position >= frames.size()){
        return;
    }

    Frame * frame = frames[getState().position];
    Mugen::Effects effects = frame->effects;
    effects.scalex = scalex;
    effects.scaley = scaley;
    /* FIXME: should horizontal facing follow the same logic as vfacing below? */
    effects.facing = facing;

    /* case 1: explode vfacing is true and frame is normal. vfacing = -1
     * case 2: explode vfacing is true and frame is flipped. vfacing = 1
     * case 3: explode vfacing is false and frame is normal. vfacing = 1
     * case 4: explode vfacing is false and frame is flipped. vfacing = -1
     */
    /* TODO: verify case 2 */
    if (!effects.vfacing && vfacing){
        effects.vfacing = true;
    } else if (effects.vfacing && vfacing){
        effects.vfacing = false;
    } else if (!effects.vfacing && !vfacing){
        effects.vfacing = false;
    } else {
        effects.vfacing = true;
    }
    effects.filter = filter;

    renderFrame(frame, xaxis, yaxis, work, effects);
}
开发者ID:boyjimeking,项目名称:paintown,代码行数:31,代码来源:animation.cpp


示例12: run

    //==============================================================================
    void run()
    {
        {
            // Allow the message thread to finish setting-up the context before using it..
            MessageManagerLock mml (this);
            if (! mml.lockWasGained())
                return;
        }

        nativeContext->makeActive();
        initialiseOnThread();

       #if JUCE_USE_OPENGL_SHADERS && ! JUCE_OPENGL_ES
        shadersAvailable = OpenGLShaderProgram::getLanguageVersion() > 0;
       #endif

        while (! threadShouldExit())
        {
            const uint32 frameRenderStartTime = Time::getMillisecondCounter();

            if (renderFrame())
                waitForNextFrame (frameRenderStartTime);
        }

        shutdownOnThread();
    }
开发者ID:sonic59,项目名称:JuceDirect2D,代码行数:27,代码来源:juce_OpenGLContext.cpp


示例13: Control

LeverControl::LeverControl(ZVision *engine, uint32 key, Common::SeekableReadStream &stream)
		: Control(engine, key),
		  _frameInfo(0),
		  _frameCount(0),
		  _startFrame(0),
		  _currentFrame(0),
		  _lastRenderedFrame(0),
		  _mouseIsCaptured(false),
		  _isReturning(false),
		  _accumulatedTime(0),
		  _returnRoutesCurrentFrame(0) {

	// Loop until we find the closing brace
	Common::String line = stream.readLine();
	trimCommentsAndWhiteSpace(&line);

	while (!stream.eos() && !line.contains('}')) {
		if (line.matchString("*descfile*", true)) {
			char levFileName[25];
			sscanf(line.c_str(), "%*[^(](%25[^)])", levFileName);

			parseLevFile(levFileName);
		} else if (line.matchString("*cursor*", true)) {
			char cursorName[25];
			sscanf(line.c_str(), "%*[^(](%25[^)])", cursorName);

			_cursorName = Common::String(cursorName);
		}

		line = stream.readLine();
		trimCommentsAndWhiteSpace(&line);
	}

	renderFrame(_currentFrame);
}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:35,代码来源:lever_control.cpp


示例14: updateFrame

bool EngineManager::updateUnitily()
{
	updateFrame();
	renderFrame();
	presentFrame();
	return !isExitRequested();
}
开发者ID:lriki,项目名称:Lumino,代码行数:7,代码来源:EngineManager.cpp


示例15: calculateVectorAngle

bool LeverControl::onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
	if (!_enabled) {
		return false;
	}
	
	bool cursorWasChanged = false;

	if (_mouseIsCaptured) {
		// Make sure the square distance between the last point and the current point is greater than 64
		// This is a heuristic. This determines how responsive the lever is to mouse movement.
		// TODO: Fiddle with the heuristic to get a good lever responsiveness 'feel'
		if (_lastMousePos.sqrDist(backgroundImageSpacePos) >= 64) {
			int angle = calculateVectorAngle(_lastMousePos, backgroundImageSpacePos);
			_lastMousePos = backgroundImageSpacePos;

			for (Common::List<Direction>::iterator iter = _frameInfo[_currentFrame].directions.begin(); iter != _frameInfo[_currentFrame].directions.end(); ++iter) {
				if (angle >= (int)iter->angle - ANGLE_DELTA && angle <= (int)iter->angle + ANGLE_DELTA) {
					_currentFrame = iter->toFrame;
					renderFrame(_currentFrame);
					break;
				}
			}
		}
	} else if (_frameInfo[_currentFrame].hotspot.contains(backgroundImageSpacePos)) {
		_engine->getCursorManager()->changeCursor(_cursorName);
		cursorWasChanged = true;
	}

	return cursorWasChanged;
}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:30,代码来源:lever_control.cpp


示例16: calculateVectorAngle

bool LeverControl::onMouseMove(const Common::Point &screenSpacePos, const Common::Point &backgroundImageSpacePos) {
	if (_engine->getScriptManager()->getStateFlag(_key) & Puzzle::DISABLED)
		return false;

	bool cursorWasChanged = false;

	if (_mouseIsCaptured) {
		// Make sure the square distance between the last point and the current point is greater than 16
		// This is a heuristic. This determines how responsive the lever is to mouse movement.
		if (_lastMousePos.sqrDist(backgroundImageSpacePos) >= 16) {
			int angle = calculateVectorAngle(_lastMousePos, backgroundImageSpacePos);
			_lastMousePos = backgroundImageSpacePos;

			for (Common::List<Direction>::iterator iter = _frameInfo[_currentFrame].directions.begin(); iter != _frameInfo[_currentFrame].directions.end(); ++iter) {
				if (angle >= (int)iter->angle - ANGLE_DELTA && angle <= (int)iter->angle + ANGLE_DELTA) {
					_currentFrame = iter->toFrame;
					renderFrame(_currentFrame);
					_engine->getScriptManager()->setStateValue(_key, _currentFrame);
					break;
				}
			}
		}
		_engine->getCursorManager()->changeCursor(_cursor);
		cursorWasChanged = true;
	} else if (_frameInfo[_currentFrame].hotspot.contains(backgroundImageSpacePos)) {
		_engine->getCursorManager()->changeCursor(_cursor);
		cursorWasChanged = true;
	}

	return cursorWasChanged;
}
开发者ID:86400,项目名称:scummvm,代码行数:31,代码来源:lever_control.cpp


示例17: switch

//extern int	g_iHeartTest;
void Engine::handleCommand(int cmd)
{
    switch (cmd)
    {
		//save player data.
		 case APP_CMD_SAVE_STATE:
 // The system has asked us to save our current state.  Do so.
			 {
				//this->mApp->savedState = malloc(sizeof(int));
				//int*l_pNumHeart = (int*)this->mApp->savedState;
				//*l_pNumHeart = g_iHeartTest;
				//mApp->stateSaved = sizeof(int);
			 }
			 break;
		// The window is being shown, get it ready.
		// Note that on ICS, the EGL size will often be correct for the new size here
		// But on HC it will not be.  We need to defer checking the new res until the
		// first render with the new surface!
        case APP_CMD_INIT_WINDOW:
        case APP_CMD_WINDOW_RESIZED:
			mEgl.setWindow(mApp->window);
        	break;

        case APP_CMD_TERM_WINDOW:
            // The window is being hidden or closed, clean it up.
			mEgl.setWindow(NULL);
			break;

        case APP_CMD_GAINED_FOCUS:
			g_bLostFocus = false;
			mEgl.setWindow(mApp->window);
			if( cGameApp::m_spSoundParser )
				cGameApp::m_spSoundParser->Pause(false);
			break;
		case APP_CMD_STOP:
        case APP_CMD_LOST_FOCUS:
			if(cGameApp::m_spSoundParser)
			{
				//cGameApp::m_spSoundParser->Stop();
				cGameApp::m_spSoundParser->Pause(true);
			}
			g_bLostFocus = true;
			break;
		case APP_CMD_PAUSE:
        	// Move out of gameplay mode if we are in it.  But if we are
			// in another dialog mode, leave it as-is
            if (mGameplayMode)
				setGameplayMode(false);
            break;

		// ICS does not appear to require this, but on GB phones,
		// not having this causes rotation changes to be delayed or
		// ignored when we're in a non-rendering mode like autopause.
		// The forced renders appear to allow GB to process the rotation
		case APP_CMD_CONFIG_CHANGED:
			renderFrame(true);
			break;
    }
}
开发者ID:fatmingwang,项目名称:FM79979,代码行数:60,代码来源:engine.cpp


示例18: Draw

void Draw(ESContext *esContext)
{
	//

	renderFrame();

	eglSwapBuffers(esContext->eglDisplay, esContext->eglSurface);
} 
开发者ID:fomonster,项目名称:crossplatform-cpp,代码行数:8,代码来源:main.cpp


示例19: Java_ondrej_platek_bind_NativeRenderer_step

/////////// JNICALL .._step ////////////
JNIEXPORT void JNICALL Java_ondrej_platek_bind_NativeRenderer_step(JNIEnv * env, jobject mythis) {
    AppCtx * c =  reinterpret_cast<AppCtx*>(extractInt(env, mythis, "pAppCtx"));
    if(c == NULL) {
      LOGE("NativeRender_step context is NULL");
    }
    else {
        renderFrame(c);
    }
}
开发者ID:mtschoen,项目名称:opengl-android,代码行数:10,代码来源:natRenderer_jni.cpp


示例20: runGame

//-------------------------------------------------------------------------
char runGame()
{
	int offset;
	char i, willyCollideSprites = ColNoCol;
	BOOL willyCollideBackground = NO;
	if(m_keysFound == m_keysToFind)
	{
		++m_keysFound;
		for(i = level2Sprite[m_level].index ;; ++i)
		{
			SpriteData *sprt = &spriteData[i];
			if(sprt->spriteClass & SPClass_Door)
			{
				sprt->curEnabled = 1;
				m_doorToggle = 0;
				break;
			}
			else if(sprt->spriteClass & SPClass_Eugene)
			{
				sprt->curDirection = 1;
				sprt->curLocalStorage = 1;
			}
		}
	}
	else
	{
		for(i = 0; i < MaxKeysPerLevel; ++i)
		{
			offset = screenRowStart[keyPositions[m_level][i].y]+keyPositions[m_level][i].x ;
			if(WorldEmpty != SCREEN_RAM[offset])
				incColourRamBy(offset, (i+1));
		}
	}
	
	if(!--m_airAmount)
		return ColDie;
	
	moveSprites();
	
	if(LEVEL_Solar_Power_Generator == m_level)
	 	buildPowerBeamPath();

	if(GSTATE_Demo != m_gameState)
		willyCollideBackground = moveWilly();
	
	renderFrame();
	
	if(willyCollideBackground || (willyCollideSprites = checkSpriteCollisions()))
	{
		if(willyCollideSprites & ColDoor)
			return ColDoor;
			
		return ColDie;
	}
	
	return ColNoCol;
}
开发者ID:StewBC,项目名称:manicminer,代码行数:58,代码来源:game.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ renderLater函数代码示例发布时间:2022-05-30
下一篇:
C++ render函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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