サンプルコード

using System;
using System.Collections.Generic;

using Sce.PlayStation.Core;
using Sce.PlayStation.Core.Environment;
using Sce.PlayStation.Core.Graphics;
using Sce.PlayStation.Core.Input;
using GMLIB;

namespace GAME
{
	public class AppMain
	{
		public static void Main (string[] args)
		{
			GM_Core core = GM_Core.Instance;
			var graphics = GM_Graphic.Instance.Context;

			GM_Shader test_shader = new GM_Shader ("/Application/shaders/Shader2D.cgx", "TEST");
			GM_Shader test_shader3d = new GM_Shader ("/Application/shaders/Shader3D.cgx", "TEST3D");

			GM_Scene main_scene = new GM_Scene (
			new Functoin (delegate(){

				VertexBuffer vertexBuffer = new VertexBuffer (4, 6, VertexFormat.Float3, VertexFormat.Float2, VertexFormat.Float4);
				GM_Debug.Init (graphics);
				return 0;
			}),
			new Functoin (delegate(){
				GM_View.Getinstance().Update();
				return 0;
			}),
			new Functoin (delegate(){
				// Clear the screen
				if (GM_Input.Instance.GetTouchState (TouchStatus.Down, true)) {
					graphics.SetClearColor (0.0f, 1.0f, 0.0f, 0.0f);
				} else {
					graphics.SetClearColor (0.0f, 0.0f, 1.0f, 0.0f);
				}
				graphics.Clear ();

				GM_2DVertex [] v = new GM_2DVertex[4];
				v [0].pos = new Vector3(0.0f, 0.0f, 0.0f);
				v [0].color = new Vector4 (1000.0f, 0.0f, 0.0f, 1.0f);

				v [1].pos = new Vector3 (1000.0f, 0.0f, 0.0f);
				v [1].color = new Vector4 (0.0f, 1.0f, 0.0f, 1.0f);

				v [2].pos = new Vector3 (0.0f, 1000.0f, 0.0f);
				v [2].color = new Vector4 (0.0f, 0.0f, 1.0f, 1.0f);

				v [3].pos = new Vector3 (1000.0f, 1000.0f, 0.0f);
				v [3].color = new Vector4 (1.0f, 1.0f, 0.0f, 1.0f);

				GM_2DPolygon.Instance.Render( ref v , "TEST" );

				GM_3DVertex [] v3 = new GM_3DVertex[4];

				v3 [0].pos = new Vector3( -1.0f, 1.0f, 1.0f);
				v3 [0].color = new Vector4 (1.0f, 0.0f, 0.0f, 1.0f);

				v3 [1].pos = new Vector3 (1.0f, 1.0f, 1.0f);
				v3 [1].color = new Vector4 (0.0f, 1.0f, 0.0f, 1.0f);

				v3 [2].pos = new Vector3 (-1.0f, -1.0f, 1.0f);
				v3 [2].color = new Vector4 (0.0f, 0.0f, 1.0f, 1.0f);

				v3 [3].pos = new Vector3 (1.0f, -1.0f, 1.0f);
				v3 [3].color = new Vector4 (1.0f, 1.0f, 0.0f, 1.0f);

				GM_3DPolygon.Instance.RenderSprite(ref v3 , "TEST3D");

				GM_Debug.DrawText("aaaa" , 0xFFFFFFFF , 0, 10);
				// Present the screen
				graphics.SwapBuffers ();

				return 0;
			}),
			new Functoin (delegate(){
				return 0;
			}));

			core.Scene = main_scene;
			core.MainLoop ();
		}

	}
}
Merge branch 'master' of https://github.com/kurometiko/GMLIB