Ejemplo n.º 1
0
        public void Resize(int width, int height, int scale)
        {
            screenWidth            = width;
            screenHeight           = height;
            windowWidth            = width * scale;
            windowHeight           = height * scale;
            ScreenController.scale = scale;
            Raylib.SetWindowSize(width * scale, height * scale);

            SoftwareCanvas.InitTexture(width, height);

            Raylib.UnloadRenderTexture(renderTexture);
            renderTexture = Util.LoadRenderTexture(screenWidth, screenHeight);
            drawScreen    = new SoftwareCanvasRenderer(Assets.Shader("shaders/screen"));
            ReloadShader();
        }
Ejemplo n.º 2
0
        public ScreenController(int width, int height, int scale)
        {
            screenWidth            = width;
            screenHeight           = height;
            windowWidth            = width * scale;
            windowHeight           = height * scale;
            ScreenController.scale = scale;

            instance = this;
            Raylib.InitWindow(windowWidth, windowHeight, "disaster engine 5.0");
            renderTexture = Util.LoadRenderTexture(screenWidth, screenHeight);
            Raylib.SetTargetFPS(60);
            camera = new Camera3D(
                new Vector3(0, 0f, 0f),
                new Vector3(0, 0, -1),
                new Vector3(0, 1, 0),
                45f,
                CameraProjection.CAMERA_PERSPECTIVE
                );

            drawScreen        = new SoftwareCanvasRenderer(Assets.Shader("shaders/screen"));
            postProcessShader = Assets.Shader("shaders/postprocess");
        }
Ejemplo n.º 3
0
 public void ReloadShader()
 {
     drawScreen.shader = Assets.Shader("shaders/screen");
     postProcessShader = Assets.Shader("shaders/postprocess");
 }