navit
0.5.3-trunk
|
#include <glib.h>
#include <unistd.h>
#include <math.h>
#include <stdio.h>
#include <time.h>
#include "item.h"
#include "attr.h"
#include "config.h"
#include "point.h"
#include "graphics.h"
#include "color.h"
#include "plugin.h"
#include "event.h"
#include "debug.h"
#include "callback.h"
#include "keys.h"
#include "window.h"
#include "navit/font/freetype/font_freetype.h"
#include "SDL_image.h"
#include <GLES2/gl2.h>
#include <EGL/egl.h>
Data Structures | |
struct | graphics_gc_priv |
struct | graphics_priv |
struct | graphics_image_priv |
struct | graphics_opengl_platform |
struct | contour |
Macros | |
#define | SCREEN_WIDTH 800 |
#define | SCREEN_HEIGHT 600 |
#define | glF(x) x |
#define | glD(x) x |
#define | GL_F GL_FLOAT |
Typedefs | |
typedef GLfloat | GLf |
Functions | |
static struct graphics_priv * | graphics_opengl_new_helper (struct graphics_methods *meth) |
float | area (const struct contour *contour) |
int | inside_triangle (float Ax, float Ay, float Bx, float By, float Cx, float Cy, float Px, float Py) |
int | snip (const struct point *pnt, int u, int v, int w, int n, int *V) |
int | process_triangles (const struct contour *contour, struct contour *result) |
static void | sdl_egl_destroy (struct graphics_opengl_platform *egl) |
static void | sdl_egl_swap_buffers (struct graphics_opengl_platform *egl) |
static void | graphics_destroy (struct graphics_priv *gr) |
static void | gc_destroy (struct graphics_gc_priv *gc) |
static void | gc_set_linewidth (struct graphics_gc_priv *gc, int w) |
static void | gc_set_dashes (struct graphics_gc_priv *gc, int width, int offset, unsigned char *dash_list, int n) |
static void | gc_set_foreground (struct graphics_gc_priv *gc, struct color *c) |
static void | gc_set_background (struct graphics_gc_priv *gc, struct color *c) |
static struct graphics_gc_priv * | gc_new (struct graphics_priv *gr, struct graphics_gc_methods *meth) |
static struct graphics_image_priv * | image_new (struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h, struct point *hot, int rotation) |
static void | image_free (struct graphics_priv *gr, struct graphics_image_priv *gi) |
static void | set_color (struct graphics_priv *gr, struct graphics_gc_priv *gc) |
static void | draw_array (struct graphics_priv *gr, struct point *p, int count, GLenum mode) |
static void | draw_rectangle_do (struct graphics_priv *gr, struct point *p, int w, int h) |
static void | draw_image_es (struct graphics_priv *gr, struct point *p, int w, int h, unsigned char *data) |
void | get_overlay_pos (struct graphics_priv *gr, struct point *point_out) |
void | draw_overlay (struct graphics_priv *gr) |
static void | draw_lines (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) |
static void | draw_polygon (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) |
static void | draw_rectangle (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h) |
static void | display_text_draw (struct font_freetype_text *text, struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, int color, struct point *p) |
static void | draw_text (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) |
static void | draw_image (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) |
static void | draw_drag (struct graphics_priv *gr, struct point *p) |
static void | background_gc (struct graphics_priv *gr, struct graphics_gc_priv *gc) |
static void | draw_background (struct graphics_priv *gr) |
static void | draw_mode (struct graphics_priv *gr, enum draw_mode_num mode) |
static int | graphics_opengl_fullscreen (struct window *w, int on) |
static void | graphics_opengl_disable_suspend (struct window *w) |
static GLuint | load_shader (const char *shader_source, GLenum type) |
static void * | get_data (struct graphics_priv *this, const char *type) |
static void | overlay_disable (struct graphics_priv *gr, int disable) |
static void | overlay_resize (struct graphics_priv *gr, struct point *p, int w, int h, int wraparound) |
static struct graphics_priv * | overlay_new (struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound) |
static void | create_framebuffer_texture (struct graphics_priv *gr) |
static gboolean | graphics_sdl_idle (void *data) |
static struct graphics_priv * | graphics_opengl_new (struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) |
void | plugin_init (void) |
Variables | |
struct graphics_gc_priv | graphics_gc_priv |
struct graphics_image_priv | graphics_image_priv |
static GHashTable * | hImageData |
static int | USERWANTSTOQUIT = 0 |
static struct graphics_priv * | graphics_priv_root |
const char | vertex_src [] |
const char | fragment_src [] |
static struct graphics_gc_methods | gc_methods |
static struct graphics_image_priv | image_error |
static struct graphics_methods | graphics_methods |
#define GL_F GL_FLOAT |
#define glD | ( | x | ) | x |
#define glF | ( | x | ) | x |
Referenced by draw_array(), draw_background(), draw_image_es(), and draw_overlay().
#define SCREEN_HEIGHT 600 |
Referenced by graphics_opengl_new().
#define SCREEN_WIDTH 800 |
Navit, a modular navigation system. Copyright (C) 2005-2010 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Referenced by graphics_opengl_new().
typedef GLfloat GLf |
float area | ( | const struct contour * | contour | ) |
References contour::count, p, contour::p, point::x, and point::y.
Referenced by geom_poly_area(), geom_poly_centroid(), geom_poly_segments_sort(), and process_triangles().
|
static |
References graphics_priv::background_gc.
|
static |
References exit, graphics_priv::framebuffer_name, graphics_priv::height, graphics_priv::overlay_texture, and graphics_priv::width.
Referenced by graphics_opengl_new(), and overlay_new().
|
static |
References color::a, color::b, COLOR_IS_BLACK, COLOR_IS_WHITE, draw_image_es(), font_freetype_glyph::dx, font_freetype_glyph::dy, graphics_gc_priv::fa, graphics_gc_priv::fb, graphics_gc_priv::fg, graphics_gc_priv::fr, graphics_priv::freetype_methods, color::g, graphics_gc_priv::g, font_freetype_methods::get_glyph, font_freetype_methods::get_shadow, font_freetype_text::glyph, font_freetype_text::glyph_count, font_freetype_glyph::h, color::r, font_freetype_glyph::w, point::x, font_freetype_glyph::x, point::y, and font_freetype_glyph::y.
Referenced by draw_text().
|
static |
References glF, and graphics_priv::position_location.
Referenced by draw_lines(), draw_polygon(), and draw_rectangle_do().
|
static |
|
static |
References graphics_priv::p, point::x, and point::y.
|
static |
References draw_image_es(), and graphics_image_priv::img.
|
static |
References draw_rectangle_do(), glF, graphics_priv::texture_position_location, graphics_priv::use_texture_location, and point::x.
Referenced by display_text_draw(), draw_image(), and draw_rectangle_do().
|
static |
|
static |
References draw_background(), draw_mode_begin, draw_mode_end, draw_overlay(), graphics_priv::framebuffer_name, graphics_priv::height, graphics_gc_priv::mode, graphics_priv::mode, graphics_priv::mvp_location, graphics_priv::next, graphics_priv::overlay, graphics_priv::overlay_enabled, graphics_priv::overlays, graphics_priv::p, graphics_priv::parent, graphics_priv::platform, sdl_egl_swap_buffers(), graphics_priv::width, point::x, and point::y.
Referenced by overlay_disable().
|
inline |
|
static |
|
static |
|
static |
References draw_array(), p, and graphics_gc_priv::w.
Referenced by draw_background(), draw_image_es(), draw_overlay(), and draw_rectangle().
|
static |
|
static |
|
static |
References gc_methods, graphics_gc_priv::gr, and graphics_gc_priv::linewidth.
|
static |
References color::a, color::b, graphics_gc_priv::ba, graphics_gc_priv::bb, graphics_gc_priv::bg, graphics_gc_priv::br, color::g, and color::r.
|
static |
|
static |
References color::a, color::b, graphics_gc_priv::fa, graphics_gc_priv::fb, graphics_gc_priv::fg, graphics_gc_priv::fr, color::g, and color::r.
|
static |
References graphics_gc_priv::linewidth, and graphics_gc_priv::w.
|
static |
|
inline |
References graphics_priv::height, graphics_priv::p, graphics_priv::parent, graphics_priv::width, point::x, and point::y.
Referenced by draw_overlay().
|
static |
|
static |
Referenced by get_data().
|
static |
Referenced by get_data().
|
static |
References attr_search(), cbl, graphics_priv::cbl, create_framebuffer_texture(), graphics_priv::delay, graphics_opengl_platform::eglcontext, graphics_opengl_platform::eglwindow, event_request_system(), exit, graphics_priv::fill_poly, graphics_priv::framebuffer_name, graphics_opengl_new_helper(), graphics_sdl_idle(), graphics_priv::height, height, hImageData, graphics_priv::nav, attr::num, graphics_priv::overlay_enabled, graphics_priv::overlays, SCREEN_HEIGHT, SCREEN_WIDTH, graphics_priv::show_overlays, graphics_priv::timeout, attr::u, graphics_priv::width, and graphics_gc_priv::width.
Referenced by plugin_init().
|
static |
References font_freetype_new(), graphics_methods::font_new, graphics_priv::freetype_methods, graphics_methods::get_text_bbox, and graphics_methods.
Referenced by graphics_opengl_new(), and overlay_new().
|
static |
References callback_list_call_attr_1, callback_list_call_attr_3, graphics_priv::cbl, exit, graphics_priv::fill_poly, graphics_priv::force_redraw, NAVIT_KEY_BACKSPACE, NAVIT_KEY_DOWN, NAVIT_KEY_LEFT, NAVIT_KEY_RETURN, NAVIT_KEY_RIGHT, NAVIT_KEY_UP, NAVIT_KEY_ZOOM_IN, NAVIT_KEY_ZOOM_OUT, graphics_priv::show_overlays, USERWANTSTOQUIT, point::x, and point::y.
Referenced by graphics_opengl_new().
|
static |
|
static |
References dbg, hImageData, image_error, graphics_image_priv::img, lvl_error, point::x, and point::y.
int inside_triangle | ( | float | Ax, |
float | Ay, | ||
float | Bx, | ||
float | By, | ||
float | Cx, | ||
float | Cy, | ||
float | Px, | ||
float | Py | ||
) |
Referenced by snip().
|
static |
Referenced by get_data(), and graphics_opengl_disable_suspend().
|
static |
References draw_mode(), draw_mode_end, graphics_priv::force_redraw, and graphics_priv::overlay_enabled.
|
static |
References graphics_priv::color_location, create_framebuffer_texture(), graphics_priv::fill_poly, graphics_gc_priv::gr, graphics_opengl_new_helper(), graphics_priv::h, height, graphics_priv::mvp_location, next, graphics_priv::overlay_autodisabled, graphics_priv::overlay_enabled, graphics_priv::overlays, graphics_priv::position_location, graphics_priv::texture_location, graphics_priv::texture_position_location, graphics_priv::use_texture_location, graphics_gc_priv::w, graphics_gc_priv::width, point::x, and point::y.
Referenced by overlay_resize().
|
static |
References callback_list_call_attr_2, graphics_priv::cbl, changed(), graphics_gc_priv::gr, graphics_priv::h, graphics_priv::height, graphics_priv::overlay_autodisabled, overlay_new(), graphics_priv::overlay_texture, p, graphics_priv::p, graphics_gc_priv::w, graphics_priv::width, and graphics_priv::wraparound.
void plugin_init | ( | void | ) |
References graphics_opengl_new().
References graphics_gc_priv::a, area(), graphics_gc_priv::b, graphics_gc_priv::c, contour::count, contour::p, snip(), and graphics_gc_priv::w.
Referenced by draw_polygon().
|
static |
References graphics_opengl_platform::eglcontext, and graphics_opengl_platform::eglwindow.
Referenced by graphics_destroy().
|
static |
References graphics_opengl_platform::eglwindow.
Referenced by draw_mode().
|
static |
References graphics_priv::color_location, graphics_gc_priv::fa, graphics_gc_priv::fb, graphics_gc_priv::fg, and graphics_gc_priv::fr.
Referenced by draw_lines(), draw_polygon(), and draw_rectangle().
int snip | ( | const struct point * | pnt, |
int | u, | ||
int | v, | ||
int | w, | ||
int | n, | ||
int * | V | ||
) |
References inside_triangle(), p, graphics_gc_priv::w, point::x, and point::y.
Referenced by process_triangles().
const char fragment_src[] |
Referenced by get_data().
|
static |
Referenced by gc_new().
struct graphics_gc_priv graphics_gc_priv |
Referenced by gc_new().
|
static |
Referenced by graphics_opengl_new_helper().
|
static |
|
static |
Referenced by graphics_opengl_new(), and image_new().
|
static |
Referenced by image_new().
|
static |
Referenced by graphics_sdl_idle().
const char vertex_src[] |
Referenced by get_data().