This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <mbgl/geometry/circle_buffer.hpp> | ||
|
||
#include <mbgl/platform/gl.hpp> | ||
|
||
#include <climits> | ||
|
||
using namespace mbgl; | ||
|
||
void CircleVertexBuffer::add(vertex_type x, vertex_type y, float ex, float ey) { | ||
vertex_type *vertices = static_cast<vertex_type *>(addElement()); | ||
vertices[0] = (x * 2) + ((ex + 1) / 2); | ||
vertices[1] = (y * 2) + ((ey + 1) / 2); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef MBGL_GEOMETRY_CIRCLE_BUFFER | ||
#define MBGL_GEOMETRY_CIRCLE_BUFFER | ||
|
||
#include <mbgl/geometry/buffer.hpp> | ||
|
||
namespace mbgl { | ||
|
||
class CircleVertexBuffer : public Buffer< | ||
4 // 2 bytes per short * 4 of them. | ||
> { | ||
public: | ||
typedef int16_t vertex_type; | ||
|
||
/* | ||
* Add a vertex to this buffer | ||
* | ||
* @param {number} x vertex position | ||
* @param {number} y vertex position | ||
* @param {number} ex extrude normal | ||
* @param {number} ey extrude normal | ||
*/ | ||
void add(vertex_type x, vertex_type y, float ex, float ey); | ||
}; | ||
|
||
} | ||
|
||
#endif // MBGL_GEOMETRY_CIRCLE_BUFFER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters