Permalink
Browse files

Fix compile errors on Visual Studio 2012 RC

  • Loading branch information...
Ninputer committed Jun 2, 2012
1 parent 24b7b7c commit 3f37a18755c4a5dc7977999f1dd64d07ed5998d2
Showing with 28 additions and 5 deletions.
  1. +26 −3 ampdemo/RayTracing/RenderArea.cpp
  2. +2 −2 ampdemo/RayTracing/geometry.h
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "RenderArea.h"
#include "render.h"
#include <sstream>
RenderAreaMessageHandler::RenderAreaMessageHandler(void)
:
@@ -100,16 +101,38 @@ HRESULT RenderAreaMessageHandler::OnRender()
const unsigned int width = rect.right;
const unsigned int height = rect.bottom;
int aa_factor = 2;
int aa_factor = 1;
std::vector<unsigned int> data(width * height * aa_factor * aa_factor);
array_view<unsigned int, 2> arrayview(height * aa_factor, width * aa_factor, data);
arrayview.discard_data();
render_reflection<float>(arrayview, m_phi, m_theta, m_eyedist, aa_factor);
arrayview.discard_data();
LARGE_INTEGER frequency, before, after;
QueryPerformanceFrequency(&frequency);
QueryPerformanceCounter(&before);
render_reflection<float>(arrayview, m_phi, m_theta, m_eyedist, aa_factor);
arrayview.synchronize();
QueryPerformanceCounter(&after);
double millisecond = (after.QuadPart - before.QuadPart) * 1000.0 / frequency.QuadPart;
std::wstringstream msg;
msg << L"Ray Tracing Viewer: last frame render time ";
msg << millisecond;
msg << " ms";
HWND hParent;
hr = window->GetParentWindowHandle(&hParent);
if (SUCCEEDED(hr))
{
SetWindowText(hParent, msg.str().c_str());
}
ComPtr<ID2D1Bitmap> bitmap;
hr = m_renderTarget->CreateBitmap(
D2D1::SizeU(width * aa_factor, height * aa_factor),
@@ -71,7 +71,7 @@ class sphere : public geometry
private:
fp_t sqr_radius;
void init()
void init() restrict(cpu, amp)
{
sqr_radius = radius * radius;
}
@@ -99,7 +99,7 @@ class plane : public geometry
}
private:
vector3<fp_t> position;
void init()
void init() restrict(cpu, amp)
{
position = normal * d;
}

0 comments on commit 3f37a18

Please sign in to comment.