This commit is contained in:
Ben
2019-08-20 22:36:57 +01:00
parent d46a11016e
commit 81d8759cf6
27 changed files with 39118 additions and 13 deletions

View File

@@ -31,9 +31,17 @@ void ProgressiveRenderer::Render() {
while (m_interface->Active) {
auto frameStartTime = std::chrono::high_resolution_clock::now();
ImGui::NewFrame();
ImGui::Begin("Thing");
ImGui::Text("Hello, world %d", 123);
if (ImGui::Button("Save")) {}
char* buf = ""; float f;
ImGui::InputText("string", buf, IM_ARRAYSIZE(buf));
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
ImGui::End();
for (int x = 0; x < m_scene->w; x++)
#pragma omp parallel for schedule(dynamic)
for (int x = 0; x < m_scene->w; x++)
for (int y = 0; y < m_scene->h; y++) {
SDL_Event e;
@@ -41,10 +49,10 @@ void ProgressiveRenderer::Render() {
if (e.type == SDL_QUIT) m_interface->Close();
Ray ray = m_scene->camera->CastRay(x, y);
float t;
Primative* hit = nullptr;
bool didhit = TraceRayScene(ray, m_scene, t, hit);
bool didhit = TraceRayScene(ray, m_scene, t, hit);
if (!didhit) {
m_interface->SetPixelSafe(x, y, 0x000000);
continue;