- 精华
- 0
- 帖子
- 890
- 威望
- 0 点
- 积分
- 916 点
- 种子
- 34 点
- 注册时间
- 2004-1-15
- 最后登录
- 2024-10-18
|
发表于 2012-4-19 22:44 · 四川
|
显示全部楼层
本帖最后由 hejiadong 于 2012-4-19 22:44 编辑
刚按照例子弄了个hello world了,
感觉非常的不稳定,一会儿pss就非法异常了,被关闭
而且ide一点都不成熟,和vs或者eclipse差太远了
感觉sony这次又要失败了。
源码:
using System;
using System.Collections.Generic;
using Sce.Pss.Core;
using Sce.Pss.Core.Environment;
using Sce.Pss.Core.Graphics;
using Sce.Pss.Core.Input;
using Sce.Pss.HighLevel.UI;
namespace test
{
public class AppMain
{
private static GraphicsContext graphics;
public static void Main (string[] args)
{
Initialize ();
while (true) {
SystemEvents.CheckEvents ();
Update ();
Render ();
}
}
public static void Initialize ()
{
// Set up the graphics system
graphics = new GraphicsContext ();
UISystem.Initialize(graphics);
Scene scene = new Sce.Pss.HighLevel.UI.Scene();
Label label = new Label();
label.X = 10.0f;
label.Y = 50.0f;
label.Text = "Hello World!";
scene.RootWidget.AddChildLast(label);
// Set scene
UISystem.SetScene(scene, null);
}
public static void Update ()
{
// Query gamepad for current state
var gamePadData = GamePad.GetData (0);
// Query touch for current state
List<TouchData> touchDataList = Touch.GetData (0);
// Update UI Toolkit
UISystem.Update(touchDataList);
}
public static void Render ()
{
// Clear the screen
graphics.SetClearColor (0.0f, 0.0f, 0.0f, 0.0f);
graphics.Clear ();
UISystem.Render ();
// Present the screen
graphics.SwapBuffers ();
}
}
}
|
|