[update] Added Context methods related to framebuffers.

This commit is contained in:
2019-10-09 00:00:00 +00:00
parent 93ac2c1e2a
commit e485bf4ef5
3 changed files with 32 additions and 8 deletions

View File

@@ -25,7 +25,8 @@ int main(string[] args) {
auto programs = new ProgramSet;
scope(exit) programs.destroy();
auto context = script_file.readText.CreateContextFromText(programs);
auto context = script_file.readText.
CreateContextFromText(vec2i(600, 600), programs);
scope(exit) context.destroy();
while (true) {
@@ -39,10 +40,13 @@ int main(string[] args) {
context.OperateScheduledControllers(beat);
context.UpdateActor(vec2(0, 0));
gl.Clear(GL_COLOR_BUFFER_BIT);
context.StartDrawing();
context.DrawBackground();
context.DrawElements();
context.DrawActor();
context.EndDrawing();
sfWindow_display(win);
}
return 0;
@@ -70,6 +74,5 @@ sfWindow* Initialize() {
gl.ApplyContext();
gl.Enable(GL_BLEND);
gl.BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
return win;
}