1
0

Implement FONTDEF (3)

This commit is contained in:
otya128
2016-12-30 16:49:32 +09:00
parent 20b00236a2
commit 6f4b4d0f65
3 changed files with 18 additions and 5 deletions

View File

@@ -3362,6 +3362,10 @@ class BuiltinFunction
p.console.define(code, array.doubleArray.array);
}
}
static void FONTDEF(PetitComputer p)
{
p.console.initGRPF();
}
//alias void function(PetitComputer, Value[], Value[]) BuiltinFunc;
static BuiltinFunctions[wstring] builtinFunctions;
static wstring getBasicName(BFD)(const wstring def)

View File

@@ -524,4 +524,16 @@ class Console
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_BGRA, GL_UNSIGNED_BYTE, buffer);
glFlush();
}
void initGRPF()
{
if (GRPF)
{
GRPF.deleteGL();
GRPF.deleteSDL();
}
GRPF = petitcom.graphic.createGRPF(petitcom.fontFile);
petitcom.graphic.GRPFWidth = GRPF.surface.w;
petitcom.graphic.GRPFHeight = GRPF.surface.h;
GRPF.createTexture(petitcom.renderer, petitcom.textureScaleMode);
}
}

View File

@@ -736,10 +736,7 @@ class PetitComputer
return;
}
SDL_GL_MakeCurrent(window, context);
console.GRPF = graphic.createGRPF(fontFile);
graphic.GRPFWidth = console.GRPF.surface.w;
graphic.GRPFHeight = console.GRPF.surface.h;
console.GRPF.createTexture(renderer, textureScaleMode);
console.initGRPF();
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glEnable(GL_DEPTH_TEST);
version(Windows)
@@ -1669,7 +1666,7 @@ class PetitComputer
}
if (fontdef)
{
//TODO
this.console.initGRPF();
}
}