First cut of new osgText implementation.

This commit is contained in:
Robert Osfield
2003-03-02 21:05:05 +00:00
parent a826f5ee31
commit fbe674b321
71 changed files with 1933 additions and 7226 deletions

View File

@@ -59,7 +59,10 @@ class SG_EXPORT Texture2D : public Texture
_textureHeight = height;
}
/** Get the texture subload width. */
int getTextureWidth() const { return _textureWidth; }
int getTextureHeight() const { return _textureHeight; }
// deprecated.
inline void getTextureSize(int& width, int& height) const
{
width = _textureWidth;

View File

@@ -63,6 +63,47 @@ class buffered_value
std::vector<T> _array;
};
template<class T>
class buffered_object
{
public:
inline buffered_object():
_array(DisplaySettings::instance()->getMaxNumberOfGraphicsContexts())
{}
buffered_object& operator = (const buffered_object& rhs)
{
_array = rhs._array;
return *this;
}
inline void clear() { _array.clear(); }
inline bool empty() const { return _array.empty(); }
inline unsigned int size() const { return _array.size(); }
inline T& operator[] (unsigned int pos)
{
// automatically resize array.
if (_array.size()<=pos)
_array.resize(pos+1);
return _array[pos];
}
/* // do we implement the const version???
inline T operator[] (unsigned int pos) const
{
return 0;
}
*/
protected:
std::vector<T> _array;
};
}
#endif