Esempio n. 1
0
// 描画.
IZ_BOOL CStateSepia::Render(izanagi::graph::CGraphicsDevice* device)
{
    CStatePostEffect::Render(device);
    RenderName(device, "Sepia");

    return IZ_TRUE;
}
Esempio n. 2
0
// 描画.
IZ_BOOL CStateNegative::Render(izanagi::graph::CGraphicsDevice* device)
{
    CStatePostEffect::Render(device);
    RenderName(device, "Negative");

    return IZ_TRUE;
}
Esempio n. 3
0
IZ_BOOL CStateFbx::Render(izanagi::graph::CGraphicsDevice* device)
{
    IZ_BOOL ret = CStateBase::Render(device);

    RenderName(device, "Fbx");

    return ret;
}
void SelectBoxRenderer::RenderAll(std::ostream &reply, Context &context, const ROAnything &config)
{
	StartTrace(SelectBoxRenderer.Render);
	TraceAny(config, "config");
	ROAnything n = config["Name"];
	if ( !n.IsNull() ) {
		// streams name, size and (if defined) multiple into reply
		reply << "<select name=\"";

		RenderName(reply, context, config);
		reply << "\"";

		RenderOptions(reply, context, config);

		reply << ">\n";

		ROAnything roaListName, roaListData;
		// select list to process
		if ( config.LookupPath(roaListName, "ListName") || config.LookupPath(roaListData, "ListData") ) {
			String strListName, strPrependListName, strAppendListName;
			RenderOnString(strListName, context, roaListName);
			RenderOnString(strPrependListName, context, config["PrependListName"]);
			RenderOnString(strAppendListName, context, config["AppendListName"]);

			ROAnything roaTempList;
			if ( strPrependListName.Length() ) {
				RenderOptionList(reply, context, config, strPrependListName);
			} else if ( context.Lookup("PrependListData", roaTempList) ) {
				strPrependListName = "SelectBoxData";
				Context::PushPopEntry<ROAnything> aEntryData(context, strPrependListName, roaTempList, strPrependListName);
				RenderOptionList(reply, context, config, strPrependListName);
			}

			if ( strListName.Length() ) {
				RenderOptionList(reply, context, config, strListName);
			} else {
				strListName = "SelectBoxData";
				Context::PushPopEntry<ROAnything> aEntryData(context, strListName, roaListData, strListName);
				RenderOptionList(reply, context, config, strListName);
			}

			if ( strAppendListName.Length() ) {
				RenderOptionList(reply, context, config, strAppendListName);
			} else if ( context.Lookup("AppendListData", roaTempList) ) {
				strAppendListName = "SelectBoxData";
				Context::PushPopEntry<ROAnything> aEntryData(context, strAppendListName, roaTempList, strAppendListName);
				RenderOptionList(reply, context, config, strAppendListName);
			}
		}
		reply << "</select>\n";
	} else {
		SystemLog::Warning("SelectBoxRenderer::RenderAll: mandatory 'Name' slot is missing in configuration!");
	}
}
void FieldRenderer::RenderAll(std::ostream &reply, Context &context, const ROAnything &config)
{
	StartTrace(FieldRenderer.Render);
	TraceAny(config, "config");
	if (config.IsDefined("Name")) {
		reply << "<INPUT TYPE=\"" ;
		RenderType(reply, context, config);
		reply << "\" NAME=\"";
		RenderName(reply, context, config);
		reply << "\"";
		RenderOptions(reply, context, config);
		reply << ">";
	} else {
		SystemLog::Error("FieldRenderer::RenderAll: mandatory 'Name' slot is missing in configuration!");
	}
}
void TextAreaRenderer::RenderAll(std::ostream &reply, Context &context,
								 const ROAnything &config)
{
	StartTrace(TextAreaRenderer.Render);
	TraceAny(config, "config");

	ROAnything name = config["Name"];
	if (!name.IsNull()) {
		reply << "<TEXTAREA NAME=\"";

		// render name
		RenderName(reply, context, config);
		reply << "\"";
		// render options
		ROAnything option = config["Width"];
		if (!option.IsNull()) {
			reply << " COLS=" << option.AsString();
		}
		option = config["Height"];
		if (!option.IsNull()) {
			reply << " ROWS=" << option.AsString();
		}
		option = config["Wrap"];
		if (!option.IsNull()) {
			reply << " WRAP=" << option.AsString();
		}

		RenderOptions(reply, context, config);

		reply << (">");

		// render default text
		ROAnything dft = config["Value"];
		if (!dft.IsNull()) {
			Render(reply, context, dft);
		}

		reply << "</TEXTAREA>";
	} else {
		SystemLog::Error("TextAreaRenderer::RenderAll() mandatory 'Name' slot is missing in configuration!");
	}
}
Esempio n. 7
0
// 描画.
IZ_BOOL CStateBevelShader::Render(izanagi::graph::CGraphicsDevice* device)
{
    izanagi::math::SMatrix44 mtxL2W;
    izanagi::math::SMatrix44::SetUnit(mtxL2W);

    m_Shader->Begin(device, 0, IZ_FALSE);
    {
        if (m_Shader->BeginPass(0)) {
            // パラメータ設定
            SetShaderParam(
                m_Shader,
                "g_mL2W",
                (void*)&mtxL2W,
                sizeof(mtxL2W));

            SetShaderParam(
                m_Shader,
                "g_mW2C",
                (void*)&m_Camera.mtxW2C,
                sizeof(m_Camera.mtxW2C));

            izanagi::SParallelLightParam parallelLight;

            // ライトパラメータ
            {
                // Ambient Light Color
                izanagi::SAmbientLightParam ambient;
                ambient.color.Set(0.0f, 0.0f, 0.0f);

                // Parallel Light Color
                parallelLight.color.Set(1.0f, 1.0f, 1.0f);

                // Parallel Light Direction
                parallelLight.vDir.Set(-1.0f, -1.0f, -1.0f);
                izanagi::math::SVector4::Normalize(parallelLight.vDir, parallelLight.vDir);

                // マテリアル
                izanagi::SMaterialParam mtrl;
                {
                    mtrl.vDiffuse.Set(1.0f, 1.0f, 1.0f, 1.0f);
                    mtrl.vAmbient.Set(1.0f, 1.0f, 1.0f, 1.0f);
                    mtrl.vSpecular.Set(1.0f, 1.0f, 1.0f, 20.0f);
                }

                SetShaderParam(m_Shader, "g_vLitParallelColor", &parallelLight.color, sizeof(parallelLight.color));
                SetShaderParam(m_Shader, "g_vLitAmbientColor", &ambient.color, sizeof(ambient.color));

                SetShaderParam(m_Shader, "g_vMtrlDiffuse", &mtrl.vDiffuse, sizeof(mtrl.vDiffuse));
                SetShaderParam(m_Shader, "g_vMtrlAmbient", &mtrl.vAmbient, sizeof(mtrl.vAmbient));
                SetShaderParam(m_Shader, "g_vMtrlSpecular", &mtrl.vSpecular, sizeof(mtrl.vSpecular));
            }

            {
                // ライトの方向をローカル座標に変換する

                // ライトの方向はワールド座標なので World -> Localマトリクスを計算する
                izanagi::math::SMatrix44 mtxW2L;
                izanagi::math::SMatrix44::Inverse(mtxW2L, mtxL2W);

                // World -> Local
                izanagi::math::SVector4 parallelLightLocalDir;
                izanagi::math::SMatrix44::ApplyXYZ(
                    parallelLightLocalDir,
                    parallelLight.vDir,
                    mtxW2L);

                SetShaderParam(
                    m_Shader,
                    "g_vLitParallelDir",
                    (void*)&parallelLightLocalDir,
                    sizeof(parallelLightLocalDir));

                // L2V = L2W * W2V の逆行列を計算する
                izanagi::math::SMatrix44 mtxV2L;
                izanagi::math::SMatrix44::Mul(mtxV2L, mtxL2W, m_Camera.mtxW2V);
                izanagi::math::SMatrix44::Inverse(mtxV2L, mtxV2L);

                // ビュー座標系における視点は常に原点
                izanagi::math::CVector4 eyePos(0.0f, 0.0f, 0.0f, 1.0f);

                // 視点のローカル座標を計算する
                izanagi::math::SMatrix44::Apply(eyePos, eyePos, mtxV2L);

                SetShaderParam(
                    m_Shader,
                    "g_vEye",
                    (void*)&eyePos,
                    sizeof(eyePos));
            }

            m_Shader->CommitChanges(device);

            m_Mesh->Draw(device);
        }
    }
    m_Shader->End(device);

    RenderName(device, "BevelShader");

    return IZ_TRUE;
}