Innitial commit of experimental v2 texture system port work. Compiles and runs on windows, at least. Fixing bugs as they come.
Need to test: localassetbrowser preview related floaters hgfloatertexteditor maps media textures! Currently very hacky web browser alpha masks on avatars bumpmaps Are all sky components appearing? LLViewerDynamicTexture (texture baking, browser, animated textures, anim previews, etc) Snapshot related features Customize avatar vfs floater UI textures in general Texture priority issues
This commit is contained in:
@@ -35,59 +35,64 @@
|
||||
|
||||
#include "llgl.h"
|
||||
#include "llcoord.h"
|
||||
#include "llimagegl.h"
|
||||
#include "llviewertexture.h"
|
||||
|
||||
class LLDynamicTexture
|
||||
class LLViewerDynamicTexture : public LLViewerTexture
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
LL_VIEWER_DYNAMIC_TEXTURE = LLViewerTexture::DYNAMIC_TEXTURE,
|
||||
LL_TEX_LAYER_SET_BUFFER = LLViewerTexture::INVALID_TEXTURE_TYPE + 1,
|
||||
LL_VISUAL_PARAM_HINT,
|
||||
LL_VISUAL_PARAM_RESET,
|
||||
LL_PREVIEW_ANIMATION,
|
||||
LL_IMAGE_PREVIEW_SCULPTED,
|
||||
LL_IMAGE_PREVIEW_AVATAR,
|
||||
INVALID_DYNAMIC_TEXTURE
|
||||
};
|
||||
|
||||
protected:
|
||||
/*virtual*/ ~LLViewerDynamicTexture();
|
||||
|
||||
public:
|
||||
enum EOrder { ORDER_FIRST = 0, ORDER_MIDDLE = 1, ORDER_LAST = 2, ORDER_RESET = 3, ORDER_COUNT = 4 };
|
||||
|
||||
LLDynamicTexture(S32 width,
|
||||
LLViewerDynamicTexture(S32 width,
|
||||
S32 height,
|
||||
S32 components, // = 4,
|
||||
EOrder order, // = ORDER_MIDDLE,
|
||||
BOOL clamp);
|
||||
virtual ~LLDynamicTexture();
|
||||
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
S32 getOriginX() { return mOrigin.mX; }
|
||||
S32 getOriginY() { return mOrigin.mY; }
|
||||
S32 getWidth() { return mWidth; }
|
||||
S32 getHeight() { return mHeight; }
|
||||
S32 getComponents() { return mComponents; }
|
||||
S32 getSize() { return mWidth * mHeight * mComponents; }
|
||||
|
||||
S32 getSize() { return mFullWidth * mFullHeight * mComponents; }
|
||||
|
||||
virtual BOOL needsRender() { return TRUE; }
|
||||
virtual void preRender(BOOL clear_depth = TRUE);
|
||||
virtual BOOL render();
|
||||
virtual void postRender(BOOL success);
|
||||
|
||||
virtual void restoreGLTexture() ;
|
||||
virtual void destroyGLTexture() ;
|
||||
|
||||
LLImageGL* getTexture(void) const { return mTexture; }
|
||||
virtual void restoreGLTexture() {}
|
||||
virtual void destroyGLTexture() {}
|
||||
|
||||
static BOOL updateAllInstances();
|
||||
|
||||
static void destroyGL();
|
||||
static void restoreGL();
|
||||
|
||||
static void destroyGL() ;
|
||||
static void restoreGL() ;
|
||||
protected:
|
||||
void releaseGLTexture();
|
||||
void generateGLTexture();
|
||||
void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE, const LLColor4U *fill_color = NULL);
|
||||
void generateGLTexture(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format, BOOL swap_bytes = FALSE, const LLColor4U *fill_color=NULL);
|
||||
|
||||
protected:
|
||||
S32 mWidth;
|
||||
S32 mHeight;
|
||||
S32 mComponents;
|
||||
LLPointer<LLImageGL> mTexture;
|
||||
F32 mLastBindTime;
|
||||
BOOL mClamp;
|
||||
LLCoordGL mOrigin;
|
||||
|
||||
LLCamera mCamera;
|
||||
typedef std::set<LLDynamicTexture*> instance_list_t;
|
||||
static instance_list_t sInstances[ LLDynamicTexture::ORDER_COUNT ];
|
||||
|
||||
typedef std::set<LLViewerDynamicTexture*> instance_list_t;
|
||||
static instance_list_t sInstances[ LLViewerDynamicTexture::ORDER_COUNT ];
|
||||
static S32 sNumRenders;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user