mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
use screenshot for eye dropper
instead of using backbuffer image, use the screenshot so it captures everything
This commit is contained in:
parent
93352f5754
commit
055ca0ae00
4 changed files with 9 additions and 16 deletions
|
|
@ -29,7 +29,7 @@
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
class ScreenShotD3D11 : public ScreenShot
|
class ScreenShotD3D11 : public ScreenShot
|
||||||
{
|
{
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
GBitmap* _captureBackBuffer() override;
|
GBitmap* _captureBackBuffer() override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
class ScreenShotGL : public ScreenShot
|
class ScreenShotGL : public ScreenShot
|
||||||
{
|
{
|
||||||
protected:
|
public:
|
||||||
|
|
||||||
GBitmap* _captureBackBuffer() override;
|
GBitmap* _captureBackBuffer() override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,6 @@ class Frustum;
|
||||||
|
|
||||||
class ScreenShot
|
class ScreenShot
|
||||||
{
|
{
|
||||||
/// This is overloaded to copy the current GFX
|
|
||||||
/// backbuffer to a new bitmap.
|
|
||||||
virtual GBitmap* _captureBackBuffer() { return NULL; }
|
|
||||||
|
|
||||||
/// This is set to toggle the capture.
|
/// This is set to toggle the capture.
|
||||||
bool mPending;
|
bool mPending;
|
||||||
|
|
||||||
|
|
@ -76,6 +72,9 @@ public:
|
||||||
ScreenShot();
|
ScreenShot();
|
||||||
virtual ~ScreenShot() { }
|
virtual ~ScreenShot() { }
|
||||||
|
|
||||||
|
/// This is overloaded to copy the current GFX
|
||||||
|
/// backbuffer to a new bitmap.
|
||||||
|
virtual GBitmap* _captureBackBuffer() { return NULL; }
|
||||||
/// Used to start the screenshot capture.
|
/// Used to start the screenshot capture.
|
||||||
void setPending( const char *filename, bool writeJPG, S32 tiles, F32 overlap );
|
void setPending( const char *filename, bool writeJPG, S32 tiles, F32 overlap );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
#include "gfx/primBuilder.h"
|
#include "gfx/primBuilder.h"
|
||||||
#include "gfx/gfxDrawUtil.h"
|
#include "gfx/gfxDrawUtil.h"
|
||||||
#include "postFx/postEffectManager.h"
|
#include "postFx/postEffectManager.h"
|
||||||
|
#include "gfx/screenshot.h"
|
||||||
|
|
||||||
IMPLEMENT_CONOBJECT(GuiColorPickerCtrl);
|
IMPLEMENT_CONOBJECT(GuiColorPickerCtrl);
|
||||||
|
|
||||||
|
|
@ -707,17 +708,10 @@ void GuiColorPickerCtrl::activateEyeDropper()
|
||||||
// Set up our resolution.
|
// Set up our resolution.
|
||||||
Point2I resolution = getRoot()->getExtent();
|
Point2I resolution = getRoot()->getExtent();
|
||||||
|
|
||||||
|
eyeDropperCap = gScreenShot->_captureBackBuffer();
|
||||||
|
|
||||||
// Texture handle to resolve the target to.
|
// Texture handle to resolve the target to.
|
||||||
eyeHandle.set(resolution.x, resolution.y, GFXFormatR8G8B8A8_SRGB, &GFXRenderTargetSRGBProfile, avar("%s() - bb (line %d)", __FUNCTION__, __LINE__));
|
eyeHandle.set(eyeDropperCap, &GFXStaticTextureSRGBProfile, false, avar("%s() - bb (line %d)", __FUNCTION__, __LINE__));
|
||||||
|
|
||||||
// Get our active render target (should be backbuffer).
|
|
||||||
eyeHandle = PFXMGR->getBackBufferTex();
|
|
||||||
|
|
||||||
if (eyeHandle.isValid())
|
|
||||||
{
|
|
||||||
eyeDropperCap = new GBitmap(eyeHandle.getWidth(), eyeHandle.getHeight(), false, GFXFormatR8G8B8A8);
|
|
||||||
eyeHandle.copyToBmp(eyeDropperCap);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue