a577aaab |
1 | // Created by: Kirill GAVRILOV |
d5f74e42 |
2 | // Copyright (c) 2013-2014 OPEN CASCADE SAS |
a577aaab |
3 | // |
973c2be1 |
4 | // This file is part of Open CASCADE Technology software library. |
a577aaab |
5 | // |
d5f74e42 |
6 | // This library is free software; you can redistribute it and/or modify it under |
7 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
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> |
a577aaab |
19 | |
c04c30b3 |
20 | class OpenGl_PointSprite; |
21 | DEFINE_STANDARD_HANDLE(OpenGl_PointSprite, OpenGl_Texture) |
22 | |
a577aaab |
23 | //! Point sprite resource. On modern hardware it will be texture with extra parameters. |
24 | //! On ancient hardware sprites will be drawn using bitmaps. |
25 | class OpenGl_PointSprite : public OpenGl_Texture |
26 | { |
27 | |
28 | public: |
29 | |
30 | //! Create uninitialized resource. |
31 | Standard_EXPORT OpenGl_PointSprite(); |
32 | |
33 | //! Destroy object. |
34 | Standard_EXPORT virtual ~OpenGl_PointSprite(); |
35 | |
36 | //! Destroy object - will release GPU memory if any. |
79104795 |
37 | Standard_EXPORT virtual void Release (OpenGl_Context* theCtx) Standard_OVERRIDE; |
a577aaab |
38 | |
39 | //! @return true if this is display list bitmap |
40 | inline Standard_Boolean IsDisplayList() const |
41 | { |
42 | return myBitmapList != 0; |
43 | } |
44 | |
45 | //! Draw sprite using glBitmap. |
46 | //! Please call glRasterPos3fv() before to setup sprite position. |
47 | Standard_EXPORT void DrawBitmap (const Handle(OpenGl_Context)& theCtx) const; |
48 | |
49 | //! Initialize point sprite as display list |
50 | Standard_EXPORT void SetDisplayList (const Handle(OpenGl_Context)& theCtx, |
51 | const GLuint theBitmapList); |
52 | |
53 | protected: |
54 | |
55 | GLuint myBitmapList; //!< if of display list to draw sprite using glBitmap (for backward compatibility) |
56 | |
57 | public: |
58 | |
ec357c5c |
59 | DEFINE_STANDARD_RTTI(OpenGl_PointSprite, OpenGl_Texture) // Type definition |
a577aaab |
60 | |
61 | }; |
62 | |
63 | #endif // _OpenGl_PointSprite_H__ |