public GameObject(PixelGameEngine pge, vf2d pos) { this.Pos = pos; this.pge = pge; Vel = new vf2d(0.01f, 0.02f); Acc = new vf2d(0, 0); Ang = 0; }
public void Run() { testAnimation = new Sprite[10]; testAnimationDecal = new Decal[10]; loadTestAnimation(); //window = new GLWindow((int)screenWidth, (int)screenHeight, 1, 1, AppName); pge = new PixelGameEngine(serviceProvider.GetService <IRenderer>(), serviceProvider.GetService <IPlatform>(), AppName); pge.OnFrameUpdate += updateFrame; pge.Construct(screenWidth, screenHeight, 2, 2, false, false); pge.BlendFactor = 0.5f; pge.Start(); }
public Demo(string appName) { _availableBuffers = new Stack <int>(NUM_AUDIO_BUFFERS); initAudioStuff(); //window = new GLWindow(SCREEN_WIDTH, SCREEN_HEIGHT, 3, 3, appName); //window.KeyDown += Window_KeyDown; var renderer = serviceProvider.GetService <IRenderer>(); pge = new PixelGameEngine(renderer, serviceProvider.GetService <IPlatform>(), appName); pge.Construct(SCREEN_WIDTH, SCREEN_HEIGHT, 4, 4, false, false); pge.OnCreate += pge_OnCreate; pge.OnFrameUpdate = pge_OnUpdate; pge.OnDestroy += pge_OnDestroy; pge.Platform.KeyDown += OnKeyDown; }
/// <summary> /// Constructs a new ImGuiController. /// </summary> public ImGuiController(int width, int height, PixelGameEngine pge) { this.pge = pge; _windowWidth = width; _windowHeight = height; IntPtr context = ImGui.CreateContext(); ImGui.SetCurrentContext(context); var io = ImGui.GetIO(); io.Fonts.AddFontDefault(); io.BackendFlags |= ImGuiBackendFlags.RendererHasVtxOffset; CreateDeviceResources(); SetKeyMappings(); SetPerFrameImGuiData(1f / 60f); ImGui.NewFrame(); _frameBegun = true; }
public void RunDemo() { const uint screenWidth = 250; const uint screenHeight = 250; GLWindow window = new GLWindow((int)screenWidth, (int)screenHeight, 4, 4, AppName); PixelGameEngine pge = new PixelGameEngine(AppName); pge.Construct(screenWidth, screenHeight, window); pge.OnFrameUpdate += (sender, frameUpdateArgs) => { Random rnd = new Random(); for (uint x = 0; x < pge.ScreenWidth; x++) { for (uint y = 0; y < pge.ScreenHeight; y++) { pge.Draw(x, y, new Pixel((byte)rnd.Next(255), (byte)rnd.Next(255), (byte)rnd.Next(255))); } } pge.DrawString(0, 0, "Sup?", Pixel.WHITE); }; pge.Start(); }
public void SetPixelGameEngine(PixelGameEngine pge) { this.pge = pge; }
public PGEX(PixelGameEngine pge) { this.pge = pge; }
public GFX2D(PixelGameEngine pge) : base(pge) { }
public void SetPixelGameEngine(PixelGameEngine pge) { }
public Node(PixelGameEngine pge, int x, int y) { Position = new vi2d(x, y); this.pge = pge; }