Nanashi-soft○プログラマ専用○PSSuite開発○
private static ShaderProgram createSimpleTextureShader() { /*ここから string ResourceName = "SampleLib.shaders.Texture.cgx"; Assembly resourceAssembly = Assembly.GetExecutingAssembly(); if (resourceAssembly.GetManifestResourceInfo(ResourceName) == null) { throw new FileNotFoundException("File not found.", ResourceName); } Stream fileStreamVertex = resourceAssembly.GetManifestResourceStream(ResourceName); Byte[] dataBufferVertex = new Byte[fileStreamVertex.Length]; fileStreamVertex.Read(dataBufferVertex, 0, dataBufferVertex.Length); var shaderProgram = new ShaderProgram(dataBufferVertex); */ここまでを削除 //元からコメントアウトされていたものを生かす var shaderProgram = new ShaderProgram("/Application/shaders/Texture.cgx");
private static ShaderProgram createSimpleColorShader() { /*ここから string ResourceName = "SampleLib.shaders.Simple.cgx"; Assembly resourceAssembly = Assembly.GetExecutingAssembly(); if (resourceAssembly.GetManifestResourceInfo(ResourceName) == null) { throw new FileNotFoundException("File not found.", ResourceName); } Stream fileStreamVertex = resourceAssembly.GetManifestResourceStream(ResourceName); Byte[] dataBufferVertex = new Byte[fileStreamVertex.Length]; fileStreamVertex.Read(dataBufferVertex, 0, dataBufferVertex.Length); var shaderProgram = new ShaderProgram(dataBufferVertex); */ここまでを削除 //元からコメントアウトされていたものを生かす var shaderProgram = new ShaderProgram("/Application/shaders/Simple.cgx");
using Sample; //SampleDrawクラスを呼び出す為 using Sce.Pss.Core.Imaging; //Fontクラスを呼び出す為を追加する
SampleDraw.Init(graphics);
SampleDraw.Term();そのままだと,そこは通過しないと怒られるので,サンプルに書いてある通り対処する
public class AppMain { private static GraphicsContext graphics; static bool loop = true; //追加 Mainの,whileループを loopで判定変更する public static void Main (string[] args) { Initialize (); while (loop) { //trueをloopに変更
public static void Main (string[] args) { Initialize (); while (loop) { //trueをloopに変更
public class AppMain { private static GraphicsContext graphics; static bool loop = true; static Font usefont; //追加
usefont = new Font(FontAlias.System, 70, FontStyle.Regular);70のところがフォントサイズです
public static void Render () { // Clear the screen graphics.SetClearColor (0.0f, 0.0f, 0.0f, 0.0f); graphics.Clear (); SampleDraw.DrawText("日本語でOK?", 0xffffffff, usefont, 0, 0); // Present the screen graphics.SwapBuffers (); }
SampleDraw.DrawText(文字列, カラー, 使用フォント, X座標, Y座標);文字列:普通にstring型です。改行などは効きません