Jango Fett
New member
You don't even need to edit the config file, D3D9 just puts it on there for us or what? Oh and the dss and then dds HUH !
Sorry not a pro at this yet
Sorry not a pro at this yet
There is a setting to control custom cameras in D3D9 client for Orbiter 2010. How can it be used without the API?GC API is currently only available for Orbiter 2016 and Orbiter BETA.
From memory, I can not say whether it can be back-ported to Orbiter 2010.
Even if it could be done, I think it might only be a feature-reduced set and therefore most probably not going to happen. Sorry.
Orbitersdk\include\OGCI.h and is defined in Orbitersdk\include\OGCI.cppI am trying to compile my Camera MFD to Orbiter 2010, but I couldn't find the GC API in the D3D9 client Orbiter 2010 version. How can I use the custom cameras in Orbiter 2010?
Good point. The documentation is not up to date with that setting.
After looking at the source-code[1] I remember that for Orbiter 2010 there is a predecessor to the GC API: OGCI
The interface is declared inOrbitersdk\include\OGCI.hand is defined inOrbitersdk\include\OGCI.cpp
Maybe you can find what you need in there.
[1] ...which is always the best documentation![]()
Abdullah, thanks for your efforts!
No problemI agree too thank you for doing this Abdullah.
// Header
class Camera_MFD : public MFD2, public CameraMFD
{
public:
Camera_MFD(DWORD w, DWORD h, VESSEL *vessel, UINT mfd);
bool Update(oapi::Sketchpad *skp);
private:
SURFHANDLE hRenderSrf = nullptr; // 3D render target
CAMERAHANDLE hCamera = nullptr; // Custom camera handle used to render views into surfaces and textures
void setCustomCamera();
};
// Source Code
Camera_MFD::Camera_MFD(DWORD w, DWORD h, VESSEL* vessel, UINT mfd) : MFD2(w, h, vessel)
{
if (ogciInitialize()) {
// Create 3D render target
hRenderSrf = ogciCreateSurfaceEx(W, H, OAPISURFACE_TEXTURE | OAPISURFACE_RENDERTARGET |
OAPISURFACE_RENDER3D | OAPISURFACE_NOMIPMAPS);
// Clear the surface
oapiClearSurface(hRenderSrf);
setCustomCamera();
}
}
bool Camera_MFD::Update(oapi::Sketchpad *skp)
{
// Helper for static texts
auto SKPTEXT = [skp](int x, int y, const char* str) { skp->Text(x, y, str, strlen(str)); };
if (hRenderSrf && ogciSketchpadVersion(skp) == SKETCHPAD_DIRECTX) {
// Blit the camera view into the sketchpad.
ogciSketchBlt(skp, hRenderSrf, 0, 0);
}
else {
ogciRequestDXSketchpad(skp);
}
}
// Here is Orbiter 2016 code for comparison
bool Camera_MFD::Update(oapi::Sketchpad *skp)
{
// Helper for static texts
auto SKPTEXT = [skp](int x, int y, const char* str) { skp->Text(x, y, str, strlen(str)); };
if (hRenderSrf && gcSketchpadVersion(skp) == 2) {
Sketchpad2* skp2 = static_cast<Sketchpad2*>(skp);
// Blit the camera view into the sketchpad.
RECT sr = { 0, 0, LONG(W), LONG(H) };
skp2->CopyRect(hRenderSrf, &sr, 0, 0);
}
}
// End of Orbiter 2016 code
void Camera_MFD::setCustomCamera()
{
hCamera = ogciSetupCustomCamera(hCamera, data->hVessel, camData.pos, dir, rot, camData.fov * RAD, hRenderSrf, 0xFF);
}
It seems like I can't see the vessel that created the camera only, but I can see other vessels. This happens only in Orbiter 2010. I can see the vessel that created the camera in Orbiter 2016 without a problem.
That would be very nice. The logical extension of this will be rendered engine exhaust heat, smoke and flames. I guess it could be done in D3D9, more work for Jarmonik.This might be a bit out of the left field but, is there anyway to generate 3D exhausts from the existing 2D textures? I really think that would add to the immersion, instead of being flat 2D images.