public static bool Render() { graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f); graphics.Clear(); //SampleDraw.ClearSprite(); //FIXME:modified, for preventing memory overflow var motionData = Motion.GetData(0); Vector3 acc = motionData.Acceleration; Vector3 vel = motionData.AngularVelocity; int fontHeight = SampleDraw.CurrentFont.Metrics.Height; int positionX = 256; int positionY = fontHeight * 3; SampleDraw.DrawText("Acceleration X : " + acc.X, 0xffffffff, positionX, positionY); positionY += fontHeight; SampleDraw.DrawText("Acceleration Y : " + acc.Y, 0xffffffff, positionX, positionY); positionY += fontHeight; SampleDraw.DrawText("Acceleration Z : " + acc.Z, 0xffffffff, positionX, positionY); positionY += fontHeight * 2; SampleDraw.DrawText("AngularVelocity X : " + vel.X, 0xffffffff, positionX, positionY); positionY += fontHeight; SampleDraw.DrawText("AngularVelocity Y : " + vel.Y, 0xffffffff, positionX, positionY); positionY += fontHeight; SampleDraw.DrawText("AngularVelocity Z : " + vel.Z, 0xffffffff, positionX, positionY); SampleDraw.DrawText("Motion Sample", 0xffffffff, 0, 0); graphics.SwapBuffers(); return(true); }
public static bool Render() { graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f); graphics.Clear(); foreach (var sprite in spriteList) { SampleDraw.DrawSprite(sprite); } SampleDraw.DrawText("Font Sample", 0xffffffff, 0, 0); graphics.SwapBuffers(); return(true); }
public static bool Render() { graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f); graphics.Clear(); SampleDraw.DrawText("Status : " + bgmPlayer.Status, 0xffffffff, 0, 64); SampleDraw.DrawText("Volume", 0xffffffff, volTextPosX, volTextPosY); playButton.Draw(); stopButton.Draw(); pauseButton.Draw(); resumeButton.Draw(); volumeSlider.Draw(); SampleDraw.DrawText("BgmPlayer Sample", 0xffffffff, 0, 0); graphics.SwapBuffers(); return(true); }
static void Render() { float delta = (float)stopwatch.ElapsedMilliseconds / 1000.0f; stopwatch = Stopwatch.StartNew(); model.RotateX(0.25f * delta); model.RotateY(-0.25f * delta); light.Update(delta); sceneList[id].Update(delta); sceneList[id].Render(graphics, camera, light, model, modelBg); graphics.Enable(EnableMode.CullFace, false); SampleDraw.DrawText("ShaderCatalog Sample", 0xffffffff, 0, 0); SampleDraw.DrawText(sceneList[id].Name, 0xffffffff, 0, 48); graphics.Enable(EnableMode.CullFace, true); graphics.SwapBuffers(); }
public static bool Render() { graphics.SetViewport(0, 0, screenWidth, screenHeight); graphics.SetClearColor(0.0f, 0.0f, 0.0f, 0.0f); graphics.Clear(); button0.Draw(); button1.Draw(); button2.Draw(); button3.Draw(); slider.Draw(); inputTextButton.Draw(); SampleDraw.DrawText("PersistentMemory Sample", 0xffffffff, 0, 0); SampleDraw.DrawText("Toggle Button", 0xffffffff, (((screenWidth - (BUTTON_NO * 128)) / 2) + 16), 96); SampleDraw.DrawText("TextDialog", 0xffffffff, ((screenWidth - 480) / 2), 224); SampleDraw.DrawText("Slider", 0xffffffff, ((screenWidth - 384) / 2), 330); graphics.SwapBuffers(); return(true); }