Exemple #1
0
void RenderState::debugPrint(std::ostream & out, const GLEnums & GLEnumHelper) const
{
	out << GLEnumHelper.getEnum(pname) << ": ";
	switch (type)
	{
		case SS_ENUM:
		out << GLEnumHelper.getEnum(param[0]);
		break;

		case SS_INT:
		out << param[0];
		break;

		case SS_FLOAT4:
		out << fparam[3] << ",";
		out << fparam[2] << ",";

		case SS_FLOAT2:
		out << fparam[1] << ",";

		case SS_FLOAT:
		out << fparam[0];
		break;
	}
}
Exemple #2
0
bool GLWrapper::BindFramebuffer(GLuint fbo)
{
	GLLOG(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo));ERROR_CHECK;
	GLenum status = GLLOG(glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER));ERROR_CHECK;
	if (status != GL_FRAMEBUFFER_COMPLETE)
	{
		logError("Incomplete framebuffer: "+GLEnumHelper.getEnum(status));
		return false;
	}
	else
		return true;
}
Exemple #3
0
RenderState::RenderState(GLenum parameter, RealtimeExportPassInfo::RenderState s, const GLEnums & GLEnumHelper) : pname(parameter)
{
	if (s.type == "enum")
		type = SS_ENUM;
	else if (s.type == "int")
		type = SS_INT;
	else
	{
		switch (s.floatdata.size())
		{
			case 2:
			type = SS_FLOAT2;
			break;

			case 4:
			type = SS_FLOAT4;
			break;

			default:
			type = SS_FLOAT;
			break;
		}
	}

	for (unsigned int i = 0; i < s.intdata.size() && i < 4; i++)
	{
		param[i] = s.intdata[i];
	}

	if (s.type == "enum")
	{
		param[0] = GLEnumHelper.getEnum(s.enumdata);
	}

	for (unsigned int i = 0; i < s.floatdata.size() && i < 4; i++)
	{
		fparam[i] = s.floatdata[i];
	}
}