1
0

レンダリングスレッドの初期化待機をまともにした

This commit is contained in:
otya128
2016-08-31 15:52:31 +09:00
parent 5ce4d2d422
commit 4015f6be43

View File

@@ -10,6 +10,7 @@ import std.conv;
import std.string;
import std.c.stdio;
import core.sync.mutex;
import core.sync.condition;
import otya.smilebasic.sprite;
import otya.smilebasic.error;
import otya.smilebasic.bg;
@@ -831,6 +832,7 @@ class PetitComputer
}
protected BG[4] bg;
bool quit;
Condition renderCondition;
void render()
{
try
@@ -936,6 +938,7 @@ class PetitComputer
glEnable(GL_ALPHA_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
xscreen(0, 512, 4);
renderCondition.notify();
while(true)
{
auto profile = SDL_GetTicks();
@@ -1140,8 +1143,9 @@ class PetitComputer
for(int i = 0; i < bg.length; i++)
bg[i] = new BG(this);
core.thread.Thread thread = new core.thread.Thread(&render);
renderCondition = new Condition(new Mutex());
thread.start();
while(!buttonTable){}
renderCondition.wait();
auto startTicks = SDL_GetTicks();
Parser parser;
otya.smilebasic.vm.VM vm;