Hello,
Is it for your own render engine ? i'm curious ^^
I would suggest to start with the Pictures Viewer, then a GeUserArea in a GeDialog. With the DialogBox you can use CoreMessage to send pointers' adresse from your renderengine to your DialogBox.
The viewport is a bit more complicated. Our "home" engine support it but they have access to internal functionalities.
That depends on what you want to do. Using the Draw function from a SceneHookData could work.
For the pictures viewver, you can do that in the Execute
function of your VideoPost plugin. As you may know you have this calling sequence. You can call your render during this call VIDEOPOSTCALL::INNER - open==true
Your solution should use Delegate Function (callback) and of course use our system to handle threads
This is my super render example. That display a rainbow gradient in the Pictures Viewer and update the saturation each passe. But this will give you ideas.
Of course the forum is here if you have questions.
(never use GeSleep of course)
if (vps == nullptr)
return RENDERRESULT::USERBREAK;
if (vps->thread && vps->thread->TestBreak())
return RENDERRESULT::USERBREAK;
switch (vps->vp)
{
case (VIDEOPOSTCALL::INNER):
{
if (vps->open && *vps->error == RENDERRESULT::OK)
{
VPBuffer* colorBuf = vps->render->GetBuffer(VPBUFFER_RGBA, NOTOK);
maxon::Int32 const xres = colorBuf->GetInfo(VPGETINFO::XRESOLUTION);
maxon::Int32 const yres = colorBuf->GetInfo(VPGETINFO::YRESOLUTION);
iferr_scope_handler{
return RENDERRESULT::OUTOFMEMORY;
};
const maxon::Int32 bufferSize = colorBuf->GetInfo(VPGETINFO::CPP);
maxon::Float32* buffer = NewMemClear(maxon::Float32, bufferSize * xres) iferr_return;
if (!buffer)
return RENDERRESULT::OUTOFMEMORY;
const maxon::Float colorStep = 1.0 / xres;
const maxon::Int32 renderPasses = 30;
const maxon::Float renderStep = 1.0 / renderPasses;
for (maxon::Int32 currentRenderPass = 0 ; currentRenderPass < renderPasses; currentRenderPass++)
{
for (maxon::Int32 x = 0; x < xres; ++x)
{
maxon::Vector32 color = maxon::Vector32(colorStep * x, currentRenderPass * renderStep, 1.0);
color = (maxon::Vector32)maxon::HSVToRGB(color);
buffer[x + x * 3] = color.x;
buffer[x + x * 3 + 1] = color.y;
buffer[x + x * 3 + 2] = color.z;
buffer[x + x * 3 + 3] = 1.0;
}
for (maxon::Int32 y = 0; y < yres; ++y)
{
colorBuf->SetLine(0, y, xres, buffer, 32, true);
if (vps->thread->TestBreak())
return RENDERRESULT::USERBREAK;
}
GeSleep(100);
}
DeleteMem(buffer);
}
break;
}
case (VIDEOPOSTCALL::RENDER):
{
if (vps->vd && vps->open)
vps->vd->SkipRenderProcess();
break;
}
}
return RENDERRESULT::OK;
Cheers,
Manuel.