git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.ucc.asn.au:ipdf/code
[ipdf/code.git]
/
src
/
screen.h
diff --git
a/src/screen.h
b/src/screen.h
index
f2a98c2
..
85b3c27
100644
(file)
--- a/
src/screen.h
+++ b/
src/screen.h
@@
-1,7
+1,7
@@
#ifndef _SCREEN_H
#define _SCREEN_H
#ifndef _SCREEN_H
#define _SCREEN_H
-#include
<SDL.h>
+#include
"SDL.h"
#include <functional>
#include <functional>
@@
-11,6
+11,7
@@
namespace IPDF
{
namespace IPDF
{
+ class View;
/*
* The "Screen" class handles managing the OS window (using SDL2).
*/
/*
* The "Screen" class handles managing the OS window (using SDL2).
*/
@@
-41,7
+42,7
@@
namespace IPDF
void DebugFontPrintF(const char *fmt, ...);
// Handle mouse input.
void DebugFontPrintF(const char *fmt, ...);
// Handle mouse input.
- typedef
std::function<void(int x, int y, int button, int wheel)> MouseHandler
;
+ typedef
void(*MouseHandler)(int x, int y, int button, int wheel, Screen * scr, View * view)
;
void SetMouseHandler(MouseHandler handler)
{
m_mouse_handler = handler;
void SetMouseHandler(MouseHandler handler)
{
m_mouse_handler = handler;
@@
-59,7
+60,10
@@
namespace IPDF
void ScreenShot(const char * filename) const;
void RenderBMP(const char * filename) const;
void ScreenShot(const char * filename) const;
void RenderBMP(const char * filename) const;
- void RenderPixels(int x, int y, int w, int h, void * pixels) const;
+ void RenderPixels(int x, int y, int w, int h, uint8_t * pixels) const;
+
+
+ void SetView(View * new_view) {m_view = new_view;}
// Returns the CPU time (in seconds) it took to render the last completed frame.
double GetLastFrameTimeCPU() const { return m_last_frame_time / SDL_GetPerformanceFrequency(); }
// Returns the CPU time (in seconds) it took to render the last completed frame.
double GetLastFrameTimeCPU() const { return m_last_frame_time / SDL_GetPerformanceFrequency(); }
@@
-83,6
+87,7
@@
namespace IPDF
SDL_Window *m_window;
SDL_GLContext m_gl_context;
ShaderProgram m_texture_prog;
SDL_Window *m_window;
SDL_GLContext m_gl_context;
ShaderProgram m_texture_prog;
+ ShaderProgram m_font_prog;
GLint m_colour_uniform_location;
GraphicsBuffer m_viewport_ubo;
stbtt_bakedchar m_debug_font_rects[96];
GLint m_colour_uniform_location;
GraphicsBuffer m_viewport_ubo;
stbtt_bakedchar m_debug_font_rects[96];
@@
-94,6
+99,7
@@
namespace IPDF
GraphicsBuffer m_debug_font_indices;
int m_debug_font_vertex_head;
int m_debug_font_index_head;
GraphicsBuffer m_debug_font_indices;
int m_debug_font_vertex_head;
int m_debug_font_index_head;
+ View * m_view;
};
}
};
}
UCC
git Repository :: git.ucc.asn.au