a577aaab |
1 | // Created by: Kirill GAVRILOV |
2 | // Copyright (c) 2013 OPEN CASCADE SAS |
3 | // |
4 | // The content of this file is subject to the Open CASCADE Technology Public |
5 | // License Version 6.5 (the "License"). You may not use the content of this file |
6 | // except in compliance with the License. Please obtain a copy of the License |
7 | // at http://www.opencascade.org and read it completely before using this file. |
8 | // |
9 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
10 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
11 | // |
12 | // The Original Code and all software distributed under the License is |
13 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
14 | // Initial Developer hereby disclaims all such warranties, including without |
15 | // limitation, any warranties of merchantability, fitness for a particular |
16 | // purpose or non-infringement. Please see the License for the specific terms |
17 | // and conditions governing the rights and limitations under the License. |
18 | |
19 | #ifndef _OpenGl_PointSprite_H__ |
20 | #define _OpenGl_PointSprite_H__ |
21 | |
22 | #include <OpenGl_Texture.hxx> |
23 | #include <Handle_OpenGl_PointSprite.hxx> |
24 | |
25 | //! Point sprite resource. On modern hardware it will be texture with extra parameters. |
26 | //! On ancient hardware sprites will be drawn using bitmaps. |
27 | class OpenGl_PointSprite : public OpenGl_Texture |
28 | { |
29 | |
30 | public: |
31 | |
32 | //! Create uninitialized resource. |
33 | Standard_EXPORT OpenGl_PointSprite(); |
34 | |
35 | //! Destroy object. |
36 | Standard_EXPORT virtual ~OpenGl_PointSprite(); |
37 | |
38 | //! Destroy object - will release GPU memory if any. |
39 | Standard_EXPORT virtual void Release (const OpenGl_Context* theCtx); |
40 | |
41 | //! @return true if this is display list bitmap |
42 | inline Standard_Boolean IsDisplayList() const |
43 | { |
44 | return myBitmapList != 0; |
45 | } |
46 | |
47 | //! Draw sprite using glBitmap. |
48 | //! Please call glRasterPos3fv() before to setup sprite position. |
49 | Standard_EXPORT void DrawBitmap (const Handle(OpenGl_Context)& theCtx) const; |
50 | |
51 | //! Initialize point sprite as display list |
52 | Standard_EXPORT void SetDisplayList (const Handle(OpenGl_Context)& theCtx, |
53 | const GLuint theBitmapList); |
54 | |
55 | protected: |
56 | |
57 | GLuint myBitmapList; //!< if of display list to draw sprite using glBitmap (for backward compatibility) |
58 | |
59 | public: |
60 | |
61 | DEFINE_STANDARD_RTTI(OpenGl_PointSprite) // Type definition |
62 | |
63 | }; |
64 | |
65 | #endif // _OpenGl_PointSprite_H__ |