26 glGenVertexArrays(1, &s->
vao);
D;
31 glDeleteVertexArrays(1, &s->
vao);
D;
34 void fpxx_escaped_start(
struct fpxx_escaped *s, GLuint tex, GLuint fbo, GLuint vbo,
double escaperadius2,
int width,
int height,
const mpfr_t centerx0,
const mpfr_t centery0,
const mpfr_t radius0,
const mpfr_t refx,
const mpfr_t refy) {
36 glBindFramebuffer(GL_FRAMEBUFFER, fbo);
D;
37 glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, tex, 0);
38 GLenum buffers[1] = { GL_COLOR_ATTACHMENT0 };
39 glDrawBuffers(1, buffers);
D;
40 glBindFramebuffer(GL_FRAMEBUFFER, 0);
D;
44 mpfr_inits2(mpfr_get_prec(refx), dx, dy, (mpfr_ptr) 0);
45 mpfr_sub(dx, centerx0, refx, MPFR_RNDN);
46 mpfr_sub(dy, centery0, refy, MPFR_RNDN);
49 double centerx = mpfr_get_d(dx, MPFR_RNDN);
50 double centery = mpfr_get_d(dy, MPFR_RNDN);
51 double radius = mpfr_get_d(radius0, MPFR_RNDN);
52 double pxs = height / (2.0 * radius);
53 mpfr_clears(dx, dy, (mpfr_ptr) 0);
54 glUniform2d(s->
center, centerx, centery);
D;
55 glUniform1d(s->
radius, radius);
D;
56 glUniform1d(s->
aspect, height / (
double) width);
D;
57 glUniform1d(s->
loger2, log(escaperadius2));
D;
58 glUniform1d(s->
pxs, pxs);
D;
61 glBindVertexArray(s->
vao);
D;
62 glBindBuffer(GL_ARRAY_BUFFER, vbo);
D;
63 glVertexAttribLPointer(s->
cne0, 4, GL_DOUBLE, (
DE ? 9 : 7) *
sizeof(GLdouble), 0);
D;
64 glVertexAttribLPointer(s->
zdz0,
DE ? 4 : 2, GL_DOUBLE, (
DE ? 9 : 7) *
sizeof(GLdouble), ((GLbyte *)0)+(4*
sizeof(GLdouble)));
D;
65 glVertexAttribLPointer(s->
err0, 1, GL_DOUBLE, (
DE ? 9 : 7) *
sizeof(GLdouble), ((GLbyte *)0)+((
DE ? 8 : 6)*
sizeof(GLdouble)));
D;
66 glEnableVertexAttribArray(s->
cne0);
D;
67 glEnableVertexAttribArray(s->
zdz0);
D;
68 glEnableVertexAttribArray(s->
err0);
D;
69 glBindBuffer(GL_ARRAY_BUFFER, 0);
D;
70 glBindVertexArray(0);
D;
76 glBindVertexArray(s->
vao);
D;
77 glDrawArrays(GL_POINTS, 0, active_count);
D;
79 glBindVertexArray(0);
D;