示例#1
0
        /// <summary>
        /// Subview のレイアウト時のコールバック
        ///
        /// SafeArea 周りのパラメータがこのタイミングで取得出来るようになるので
        /// ViewDidLoad() で行なっていた処理を移動
        /// </summary>
        public override void ViewWillLayoutSubviews()
        {
            DebugLogViewer.WriteLine("ViewWillLayoutSubviews()");

            base.ViewWillLayoutSubviews();
#endif

            m_Context = new EAGLContext(EAGLRenderingAPI.OpenGLES2);

            if (m_Context == null)
            {
                DebugLogViewer.WriteLine("Failed to create ES context");
            }

            var view = (GLKView)View;
            view.Context             = m_Context;
            view.DrawableColorFormat = GLKViewDrawableColorFormat.RGBA8888;
            view.DrawableDepthFormat = GLKViewDrawableDepthFormat.Format24;
            // フレームバッファがバインドされていないので、
            // フレームバッファ関連のOpenGL関数を使うにはこの方法で事前にバインドしておく
            view.BindDrawable();

            DebugLogViewer.WriteLine(string.Format("View.Drawable ({0}, {1})", view.DrawableWidth, view.DrawableHeight));
            DebugLogViewer.WriteLine(string.Format("view.Bounds {0}", view.Bounds));

            SetupGL();

            m_Activity = new GLGameTest();
            m_Activity.OnSurfaceCreated(view);

            RegisterTouchEvent(m_Activity);
        }
示例#2
0
        public Texture(GLGame glGame, string fileName)
        {
            this.m_GLGraphics = glGame.GetGLGraphics();
            this.m_FileName   = fileName;

            Load();
        }
示例#3
0
        public static void load(GLGame game)
        {

            //Load Textures and define texture regions LoadFonts///////////
            Assets.game = game;
            splashscreen = new Texture("splash.png");
            wrn = new Texture("wrg.png");
            side = new Texture("side.png");
            loadscreen = new TextureRegion(splashscreen, 1, 205, 800, 600);
            circ = new TextureRegion(side, 0, 0,600 ,1000);
            loading = new TextureRegion(splashscreen, 803, 705, 156, 55);
            Settings.load();
            Game.gd = new GameData(Settings.musicEnabled,Settings.soundEnabled);
            Game.vm = new ViewManager();
            Game.r1 = new RegionData();
            Game.r2 = new RegionData();
            Game.r3 = new RegionData();
            new Thread(delegate()
           {
               bgload();
           }).Start();






        }
示例#4
0
        public TouchTestScreen(GLGame game) : base(game)
        {
            m_GLGraphics = game.GetGLGraphics();
            m_Camera     = new Camera2D(game.GetGLGraphics(), FRUSTRUM_WIDTH, FRUSTRUM_HEIGHT);

            m_AnimationSample = new AnimationSample();

            Setup();
        }
示例#5
0
        protected void RegisterTouchEvent(GLGame game)
        {
            m_TouchHandler = new TouchHandler(1.0f, 1.0f);
            //IOSInput.Instance.Initialize(m_TouchHandler);
            IOSInput input = (IOSInput)game.GetInput();

            input.Initialize(m_TouchHandler);

            // マルチタッチを有効にする
            View.MultipleTouchEnabled = true;
        }
示例#6
0
 public static void load(GLGame game)
 {
     //Load Textures and define texture regions LoadFonts///////////
     Assets.game  = game;
     splashscreen = new Texture("splash.png");
     wrn          = new Texture("wrg.png");
     side         = new Texture("side.png");
     loadscreen   = new TextureRegion(splashscreen, 1, 205, 800, 600);
     circ         = new TextureRegion(side, 0, 0, 600, 1000);
     loading      = new TextureRegion(splashscreen, 803, 705, 156, 55);
     Settings.load();
     Game.gd = new GameData(Settings.musicEnabled, Settings.soundEnabled);
     Game.vm = new ViewManager();
     Game.r1 = new RegionData();
     Game.r2 = new RegionData();
     Game.r3 = new RegionData();
     new Thread(delegate()
     {
         bgload();
     }).Start();
 }
示例#7
0
 public Screen(GLGame game)
 {
     this.m_Game = game;
 }
示例#8
0
 public StaticLinkTestScreen(GLGame game) : base(game)
 {
     m_GLGraphics = game.GetGLGraphics();
 }