Update code to engine fixed
This commit is contained in:
parent
f70741f6e6
commit
747bfaba7c
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
TMyApplication* Application;
|
TMyApplication* Application;
|
||||||
|
|
||||||
//static const float BUFFER_DISTANCE = 30.f;
|
|
||||||
static const float BUFFER_DISTANCE = 50.f;
|
static const float BUFFER_DISTANCE = 50.f;
|
||||||
|
|
||||||
|
|
||||||
@ -73,6 +72,7 @@ TRenderPair linesToRenderBoxes(const std::vector<std::pair<Vector2f, Vector2f>>&
|
|||||||
}
|
}
|
||||||
|
|
||||||
pair.second.RefreshBuffer();
|
pair.second.RefreshBuffer();
|
||||||
|
pair.first = TRenderParams().withShader("AntialiasingShader");
|
||||||
|
|
||||||
return pair;
|
return pair;
|
||||||
}
|
}
|
||||||
@ -102,26 +102,11 @@ void TMyApplication::InnerInit()
|
|||||||
}
|
}
|
||||||
srand (static_cast<size_t>(time(NULL)));
|
srand (static_cast<size_t>(time(NULL)));
|
||||||
|
|
||||||
//ResourceManager->ShaderManager.AddShader("DefaultShader", "shader1vertex.txt", "shader1fragment.txt");
|
|
||||||
//ResourceManager->ShaderManager.AddShader("ColorShader", "color_vertex.txt", "color_fragment.txt");
|
|
||||||
|
|
||||||
#ifdef USE_SHADER_X16
|
|
||||||
ResourceManager->ShaderManager.AddShader("AntialiasingShader", "ms_vertex.txt", "ms_fragment_x16.txt");
|
|
||||||
#else
|
|
||||||
ResourceManager->ShaderManager.AddShader("AntialiasingShader", "ms_vertex.txt", "ms_fragment.txt");
|
ResourceManager->ShaderManager.AddShader("AntialiasingShader", "ms_vertex.txt", "ms_fragment.txt");
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Renderer->PushShader("DefaultShader");
|
|
||||||
|
|
||||||
ResourceManager->TexList.AddTexture("console_bkg.bmp");
|
ResourceManager->TexList.AddTexture("console_bkg.bmp");
|
||||||
|
|
||||||
|
|
||||||
Renderer->PushShader("AntialiasingShader");
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<std::pair<Vector2f, Vector2f>> lineArr;
|
std::vector<std::pair<Vector2f, Vector2f>> lineArr;
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
@ -135,6 +120,8 @@ void TMyApplication::InnerInit()
|
|||||||
|
|
||||||
lineRenderPair = linesToRenderBoxes(lineArr);
|
lineRenderPair = linesToRenderBoxes(lineArr);
|
||||||
|
|
||||||
|
Renderer->PushShader("AntialiasingShader");
|
||||||
|
|
||||||
Renderer->SetOrthoProjection();
|
Renderer->SetOrthoProjection();
|
||||||
|
|
||||||
Renderer->SetFullScreenViewport();
|
Renderer->SetFullScreenViewport();
|
||||||
@ -186,26 +173,15 @@ void TMyApplication::InnerDraw()
|
|||||||
{
|
{
|
||||||
|
|
||||||
//Render the frame
|
//Render the frame
|
||||||
Renderer->PushShader("AntialiasingShader");
|
|
||||||
|
|
||||||
Renderer->SetProjectionMatrix(512.f, 512.f);
|
Renderer->SetProjectionMatrix(512.f, 512.f);
|
||||||
|
|
||||||
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||||
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
|
||||||
CheckGlError("");
|
CheckGlError("");
|
||||||
|
|
||||||
|
|
||||||
EnableVertexAttribArray("vLineParams");
|
|
||||||
EnableVertexAttribArray("vStartPointEndPoint");
|
|
||||||
|
|
||||||
TRenderParamsSetter params(lineRenderPair.first);
|
TRenderParamsSetter params(lineRenderPair.first);
|
||||||
Renderer->DrawTriangleList(lineRenderPair.second);
|
Renderer->DrawTriangleList(lineRenderPair.second);
|
||||||
|
|
||||||
DisableVertexAttribArray("vStartPointEndPoint");
|
|
||||||
DisableVertexAttribArray("vLineParams");
|
|
||||||
|
|
||||||
Renderer->PopShader();
|
|
||||||
|
|
||||||
CheckGlError("");
|
CheckGlError("");
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user