Ejemplo n.º 1
0
void VkeCamera::initCameraData(){
	m_projection_needs_update = true;
	m_transform_needs_update = true;
	m_view_projection_needs_update = true;
	m_usage_flags = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
	m_memory_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;

	initBackingStore(sizeof(VkeCameraUniform));
	initVKBufferData();
}
Ejemplo n.º 2
0
void VkeScreenQuad::initQuadData(){
	m_usage_flags = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
	m_memory_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
	initBackingStore(sizeof(QuadUniform));

	float ww = 1800.0;
	float hh = 1000.0;

	m_backing_store->view_matrix.identity();

	initVKBufferData();

	float quadVerts[] = {
	-1.0,-1.0,0.0,1.0,	0.0,0.0,
	1.0,-1.0,0.0,1.0, 1.0,0.0,
	1.0,1.0,0.0,1.0,	1.0,1.0,
	-1.0,1.0,0.0,1.0,	0.0,1.0
	};

	uint32_t quadIdxs[] = {
		0,1,2,
		0,2,3
	};

	size_t dataSize = 4 * sizeof(VertexObjectUV);

	m_vbo.initBackingStore(dataSize);

	float *vData = m_vbo.getBackingStore();
	memcpy(vData, (const void*)quadVerts, dataSize);


	dataSize = sizeof(uint32_t) * 6;
	m_ibo.initBackingStore(dataSize);
	uint32_t *iData = m_ibo.getBackingStore();
	memcpy(iData, (const void *)quadIdxs, dataSize);

	m_vbo.initVKBufferData();
	m_ibo.initVKBufferData();


}