Esempio n. 1
0
// appends to the current aggregate a slice from a given aggregate from position i1 to position i2
void Aggregate::insertSlice(Aggregate a,Word pos,Word i1,Word i2){
	ADJUSTOFFSET(elements(),pos);ADJUSTOFFSET2(a.elements(),i1,i2);assert0(i1<=i2,"appendSlice");
	Word sz=i2-i1;checkResize(sz);
	elements(elements()+sz);
	WordMove(dataP()+pos+sz,dataP()+pos,elements()-pos);
	WordCpy(dataP()+pos,a.dataP()+i1,sz);
}
Esempio n. 2
0
GLES2Renderer::GLES2Renderer(const RendererDesc &desc, const char* assetDir) :
	Renderer(DRIVER_GLES2, assetDir), m_platform(SampleFramework::SamplePlatform::platform())
{
	m_displayWidth  = 0;
	m_displayHeight = 0;

    m_quadRender = false;

	m_viewMatrix	= PxMat44::createIdentity();
	m_platform->initializeOGLDisplay(desc, m_displayWidth, m_displayHeight);

#if defined RENDERER_ANDROID
	glMapBufferOES =   (PFNGLMAPBUFFEROESPROC)   eglGetProcAddress("glMapBufferOES");
    glUnmapBufferOES = (PFNGLUNMAPBUFFEROESPROC) eglGetProcAddress("glUnmapBufferOES");

	if (!glMapBufferOES || !glUnmapBufferOES)
    {
        GLEW_ARB_vertex_buffer_object = false;
    }
#endif

	checkResize();

    RendererColor& clearColor = getClearColor();
    glClearColor(clearColor.r/255.0f, clearColor.g/255.0f, clearColor.b/255.0f, clearColor.a/255.0f);
	glEnable(GL_CULL_FACE);
	glCullFace(GL_BACK);
	glFrontFace(GL_CW);
	glEnable(GL_DEPTH_TEST);
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
	glDepthMask(GL_TRUE);
	glDepthFunc(GL_LESS);
}
Esempio n. 3
0
void TileList::addTile(Tile tile)
{
    checkResize();
    m_elements[m_size] = tile;
    m_size++;

}
Esempio n. 4
0
// presents the current color buffer to the screen.
bool GLES2Renderer::swapBuffers(void)
{
	if(begin())
	{
        m_platform->swapBuffers();
		checkResize();
	}
	end();
	return false;
}
Esempio n. 5
0
void gameLoop(XStuff* xs, GameState* gs, InputState* is) {
	
	checkResize(xs,gs);
	
	preFrame(gs);
	
	handleInput(gs, is);
	
	setUpView(gs);
	
	// update world state
	
	
	// depth and picking pre-pass
	glDepthFunc(GL_LESS);
	glBindFramebuffer(GL_FRAMEBUFFER, gs->framebuffer);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	
	
	depthPrepass(xs, gs, is);
	
	glBindFramebuffer(GL_FRAMEBUFFER, 0);
	glBindFramebuffer(GL_READ_FRAMEBUFFER, gs->framebuffer);
	
	checkCursor(gs, is);
	
	glBindFramebuffer(GL_FRAMEBUFFER, gs->framebuffer);
	
	
	// clear color buffer for actual rendering
	//glClear(GL_COLOR_BUFFER_BIT);
	glerr("pre shader create 1d");
	glDepthFunc(GL_LEQUAL);
	glerr("pre shader create e");
	
	renderFrame(xs, gs, is);

	glBindFramebuffer(GL_FRAMEBUFFER, 0);
	glBindFramebuffer(GL_READ_FRAMEBUFFER, gs->framebuffer);
	
	
	// draw to the screen
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	
	
	shadingPass(gs);
	
	renderUI(xs, gs);
	
	gs->screen.resized = 0;
	
	glXSwapBuffers(xs->display, xs->clientWin);

}
Esempio n. 6
0
void Aggregate::push(Word w) const{
	checkResize(1);
	hP()->data(hP()->n++)=w;
}
Esempio n. 7
0
// the routine must be changed and allow a variable number of pos and word for insertion
Word* Aggregate::ins_backdel(Word pos,Word n) const{
	checkResize(n);ADJUSTOFFSET(elements(),pos);
	if(pos<elements()) 
		memmove(&data(pos+n),&data(pos),sizeof(hAggregate::el_t)*(elements()-pos));
	elements(elements()+n);return &data(pos);
}
	void D3D9WPFRenderer::onResize( PxU32 newWidth, PxU32 newHeight )
	{
		mDesiredWidth = newWidth;
		mDesiredHeight = newHeight;
		checkResize( false );
	}