0024428: Implementation of LGPL license
[occt.git] / src / OpenGl / OpenGl_PointSprite.hxx
CommitLineData
a577aaab 1// Created by: Kirill GAVRILOV
2// Copyright (c) 2013 OPEN CASCADE SAS
3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
a577aaab 5//
973c2be1 6// This library is free software; you can redistribute it and / or modify it
7// under the terms of the GNU Lesser General Public version 2.1 as published
8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
a577aaab 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
a577aaab 14
15#ifndef _OpenGl_PointSprite_H__
16#define _OpenGl_PointSprite_H__
17
18#include <OpenGl_Texture.hxx>
19#include <Handle_OpenGl_PointSprite.hxx>
20
21//! Point sprite resource. On modern hardware it will be texture with extra parameters.
22//! On ancient hardware sprites will be drawn using bitmaps.
23class OpenGl_PointSprite : public OpenGl_Texture
24{
25
26public:
27
28 //! Create uninitialized resource.
29 Standard_EXPORT OpenGl_PointSprite();
30
31 //! Destroy object.
32 Standard_EXPORT virtual ~OpenGl_PointSprite();
33
34 //! Destroy object - will release GPU memory if any.
35 Standard_EXPORT virtual void Release (const OpenGl_Context* theCtx);
36
37 //! @return true if this is display list bitmap
38 inline Standard_Boolean IsDisplayList() const
39 {
40 return myBitmapList != 0;
41 }
42
43 //! Draw sprite using glBitmap.
44 //! Please call glRasterPos3fv() before to setup sprite position.
45 Standard_EXPORT void DrawBitmap (const Handle(OpenGl_Context)& theCtx) const;
46
47 //! Initialize point sprite as display list
48 Standard_EXPORT void SetDisplayList (const Handle(OpenGl_Context)& theCtx,
49 const GLuint theBitmapList);
50
51protected:
52
53 GLuint myBitmapList; //!< if of display list to draw sprite using glBitmap (for backward compatibility)
54
55public:
56
57 DEFINE_STANDARD_RTTI(OpenGl_PointSprite) // Type definition
58
59};
60
61#endif // _OpenGl_PointSprite_H__