2011-11-06 18:18:20 +01:00
|
|
|
// Copyright (c) 2011, Thomas Goyne <plorkyeran@aegisub.org>
|
2006-03-01 05:32:00 +01:00
|
|
|
//
|
2011-11-06 18:18:20 +01:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2006-03-01 05:32:00 +01:00
|
|
|
//
|
2011-11-06 18:18:20 +01:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2006-03-01 05:32:00 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
|
|
|
|
|
|
|
/// @file gl_wrap.h
|
|
|
|
/// @see gl_wrap.cpp
|
|
|
|
/// @ingroup video_output
|
|
|
|
///
|
2006-03-01 05:32:00 +01:00
|
|
|
|
2011-11-06 18:18:20 +01:00
|
|
|
#include "vector2d.h"
|
2009-09-11 04:36:34 +02:00
|
|
|
|
2011-11-06 18:18:20 +01:00
|
|
|
#include <vector>
|
2010-06-08 08:09:19 +02:00
|
|
|
|
2011-11-06 18:18:20 +01:00
|
|
|
class wxColour;
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2007-01-21 07:30:19 +01:00
|
|
|
class OpenGLWrapper {
|
2011-11-06 18:18:20 +01:00
|
|
|
float line_r, line_g, line_b, line_a;
|
|
|
|
float fill_r, fill_g, fill_b, fill_a;
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-11-06 18:18:20 +01:00
|
|
|
int line_width;
|
|
|
|
bool smooth;
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-11-06 18:18:20 +01:00
|
|
|
bool transform_pushed;
|
|
|
|
void PrepareTransform();
|
2006-03-01 05:32:00 +01:00
|
|
|
|
2007-01-21 07:30:19 +01:00
|
|
|
public:
|
2007-07-01 04:23:57 +02:00
|
|
|
OpenGLWrapper();
|
|
|
|
|
2011-11-06 18:18:20 +01:00
|
|
|
void SetLineColour(wxColour col, float alpha = 1.0f, int width = 1);
|
|
|
|
void SetFillColour(wxColour col, float alpha = 1.0f);
|
2010-05-19 05:23:55 +02:00
|
|
|
void SetModeLine() const;
|
|
|
|
void SetModeFill() const;
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2011-11-06 18:18:20 +01:00
|
|
|
void SetInvert();
|
|
|
|
void ClearInvert();
|
|
|
|
|
|
|
|
void SetScale(Vector2D scale);
|
|
|
|
void SetOrigin(Vector2D origin);
|
|
|
|
void SetRotation(float x, float y, float z);
|
|
|
|
void ResetTransform();
|
|
|
|
|
|
|
|
void DrawLine(Vector2D p1, Vector2D p2) const;
|
|
|
|
void DrawDashedLine(Vector2D p1, Vector2D p2, float dashLen) const;
|
|
|
|
void DrawEllipse(Vector2D center, Vector2D radius) const;
|
|
|
|
void DrawCircle(Vector2D center, float radius) const { DrawEllipse(center, Vector2D(radius, radius)); }
|
|
|
|
void DrawRectangle(Vector2D p1, Vector2D p2) const;
|
|
|
|
void DrawRing(Vector2D center, float r1, float r2, float ar = 1.0f, float arcStart = 0.0f, float arcEnd = 0.0f) const;
|
|
|
|
void DrawTriangle(Vector2D p1, Vector2D p2, Vector2D p3) const;
|
|
|
|
|
|
|
|
void DrawLines(size_t dim, std::vector<float> const& lines);
|
|
|
|
void DrawLines(size_t dim, std::vector<float> const& lines, size_t c_dim, std::vector<float> const& colors);
|
|
|
|
void DrawLines(size_t dim, const float *lines, size_t n);
|
|
|
|
void DrawLineStrip(size_t dim, std::vector<float> const& lines);
|
|
|
|
|
|
|
|
/// Draw a multipolygon serialized into a single array
|
|
|
|
/// @param points List of coordinates
|
|
|
|
/// @param start Indices in points which are the start of a new polygon
|
|
|
|
/// @param count Number of points in each polygon
|
2011-11-12 02:23:40 +01:00
|
|
|
/// @param video_pos Top-left corner of the visible area
|
2011-11-06 18:18:20 +01:00
|
|
|
/// @param video_size Bottom-right corner of the visible area
|
|
|
|
/// @param invert Draw the area outside the polygons instead
|
2011-11-12 02:23:40 +01:00
|
|
|
void DrawMultiPolygon(std::vector<float> const& points, std::vector<int> &start, std::vector<int> &count, Vector2D video_pos, Vector2D video_size, bool invert);
|
2007-01-27 07:15:25 +01:00
|
|
|
|
2007-01-27 08:13:29 +01:00
|
|
|
static bool IsExtensionSupported(const char *ext);
|
2007-01-21 07:30:19 +01:00
|
|
|
};
|