mightymandel v16

GPU-based Mandelbrot set explorer

mightymandel.h File Reference

(v16)

Global constants and OpenGL debugging. More...

#include <stdbool.h>
#include <GL/glew.h>
#include "config.glsl"
+ Include dependency graph for mightymandel.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define D
 A macro that prints out any OpenGL errors that occur, with source location.

Enumerations

enum  render_method_t {
  render_method_fp32 = 0,
  render_method_fp64 = 1,
  render_method_fpxx = 2
}
 The type of rendering calculations to use. More...

Variables

int opengl_error_printout_count
 Counts how many OpenGL errors have been printed, for flood control.
bool FP64
 True if 64bit double precision floating point is available on GPU.
bool DE
 True if rendering should use distance estimates.

Detailed Description

Global constants and OpenGL debugging.

Definition in file mightymandel.h.

Macro Definition Documentation

#define D
Value:
do{ int e = glGetError(); if (e != 0) { opengl_error_printout_count++; if (opengl_error_printout_count == 50) { \
log_message(LOG_WARN, "too many OpenGL errors, not printing any more\n"); \
} else if (opengl_error_printout_count < 50) { \
log_message(LOG_WARN, "OpenGL error %d in %s() (%s:%d)\n", e, __FUNCTION__, __FILE__, __LINE__); \
} \
} }while(0)

A macro that prints out any OpenGL errors that occur, with source location.

Does nothing when MIGHTYMANDEL_DEBUG is not defined.

Important note: if a header file included later uses D, expect chaos. So include this file as late as possible (certainly after headers from outside the mightymandel source code).

Definition at line 38 of file mightymandel.h.

Referenced by compile_program_tf(), compile_shader(), debug_program(), fp32_colour_begin(), fp32_colour_clear(), fp32_colour_do(), fp32_colour_end(), fp32_escaped_begin(), fp32_escaped_do(), fp32_escaped_end(), fp32_escaped_start(), fp32_fillc_begin(), fp32_fillc_do(), fp32_fillc_end(), fp32_init_begin(), fp32_init_do(), fp32_init_end(), fp32_step_begin(), fp32_step_do(), fp32_step_end(), fp32_step_start(), fp32_unescaped_begin(), fp32_unescaped_do(), fp32_unescaped_end(), fp32_unescaped_start(), fp64_escaped_begin(), fp64_escaped_do(), fp64_escaped_end(), fp64_escaped_start(), fp64_init_do(), fp64_step_begin(), fp64_step_do(), fp64_step_end(), fp64_step_start(), fp64_unescaped_begin(), fp64_unescaped_do(), fp64_unescaped_end(), fp64_unescaped_start(), fpX_start(), fpxx_approx_begin(), fpxx_approx_do(), fpxx_approx_end(), fpxx_escaped_begin(), fpxx_escaped_do(), fpxx_escaped_end(), fpxx_escaped_start(), fpxx_init_do(), fpxx_start(), fpxx_step_begin(), fpxx_step_do(), fpxx_step_end(), fpxx_step_start(), fpxx_unescaped_begin(), fpxx_unescaped_do(), fpxx_unescaped_end(), fpxx_unescaped_start(), render_begin(), render_end(), and render_reshape().

Enumeration Type Documentation

The type of rendering calculations to use.

Enumerator:
render_method_fp32 

Plain single precision floating point.

render_method_fp64 

Plain double precision floating point.

render_method_fpxx 

Perturbed double precision floating point.

Definition at line 98 of file mightymandel.h.

Variable Documentation

bool DE

True if rendering should use distance estimates.

DE is a global variable that should not be modified anywhere apart from main() during startup (ie, before initializing shaders, or anything else that needs it).

Definition at line 33 of file mightymandel.c.

Referenced by compile_shader(), fp32_escaped_start(), fp32_step_start(), fp32_unescaped_start(), fp64_escaped_start(), fp64_step_start(), fp64_unescaped_start(), fpxx_approx_do(), fpxx_escaped_start(), fpxx_step_begin(), fpxx_step_do(), fpxx_step_start(), fpxx_unescaped_start(), main(), and render_reshape().

bool FP64

True if 64bit double precision floating point is available on GPU.

FP64 is a global variable that should not be modified anywhere apart from main() during startup (ie, before initializing shaders, or anything else that needs it).

Definition at line 32 of file mightymandel.c.

Referenced by compile_shader(), main(), render_begin(), render_end(), and render_options_set_location().

int opengl_error_printout_count

Counts how many OpenGL errors have been printed, for flood control.

opengl_error_printout_count is a global variable that should not be modified anywhere apart from main() at startup, and the D macro.

Definition at line 31 of file mightymandel.c.