Whole screen render hook

master
Allen Webster 2020-03-03 17:37:55 -08:00
parent 0a29e6df6a
commit bc2b834f3b
9 changed files with 32 additions and 3 deletions

View File

@ -748,6 +748,10 @@ App_Step_Sig(app_step){
} }
} }
if (models->whole_screen_render_caller != 0){
models->whole_screen_render_caller(&app, frame);
}
models->in_render_mode = false; models->in_render_mode = false;
end_render_section(target); end_render_section(target);
} }

View File

@ -2234,6 +2234,10 @@ set_custom_hook(Application_Links *app, Hook_ID hook_id, Void_Func *func_ptr){
{ {
models->render_caller = (Render_Caller_Function*)func_ptr; models->render_caller = (Render_Caller_Function*)func_ptr;
}break; }break;
case HookID_WholeScreenRenderCaller:
{
models->whole_screen_render_caller = (Whole_Screen_Render_Caller_Function*)func_ptr;
}break;
case HookID_BufferNameResolver: case HookID_BufferNameResolver:
{ {
models->buffer_name_resolver = (Buffer_Name_Resolver_Function*)func_ptr; models->buffer_name_resolver = (Buffer_Name_Resolver_Function*)func_ptr;

View File

@ -62,6 +62,7 @@ struct Models{
Tick_Function *tick; Tick_Function *tick;
Render_Caller_Function *render_caller; Render_Caller_Function *render_caller;
Whole_Screen_Render_Caller_Function *whole_screen_render_caller;
Delta_Rule_Function *delta_rule; Delta_Rule_Function *delta_rule;
u64 delta_rule_memory_size; u64 delta_rule_memory_size;

View File

@ -1367,7 +1367,7 @@ config_parse__file_name(Application_Links *app, Arena *arena, char *file_name, C
if (data.data != 0){ if (data.data != 0){
parsed = config_parse__data(app, arena, SCu8(file_name), SCu8(data), parsed = config_parse__data(app, arena, SCu8(file_name), SCu8(data),
config); config);
success = true; success = true;
} }
} }
if (!success){ if (!success){

View File

@ -474,6 +474,20 @@ default_render_caller(Application_Links *app, Frame_Info frame_info, View_ID vie
draw_set_clip(app, prev_clip); draw_set_clip(app, prev_clip);
} }
function void
default_whole_screen_render_caller(Application_Links *app, Frame_Info frame_info){
#if 0
Rect_f32 region = global_get_screen_rectangle(app);
Vec2_f32 center = rect_center(region);
Face_ID face_id = get_face_id(app, 0);
Scratch_Block scratch(app);
draw_string_oriented(app, face_id, finalize_color(defcolor_text_default, 0),
SCu8("Hello, World!"), center,
GlyphFlag_Rotate90, V2f32(0.f, 1.f));
#endif
}
HOOK_SIG(default_view_adjust){ HOOK_SIG(default_view_adjust){
// NOTE(allen): Called whenever the view layout/sizes have been modified, // NOTE(allen): Called whenever the view layout/sizes have been modified,
// including by full window resize. // including by full window resize.
@ -1022,6 +1036,7 @@ set_all_default_hooks(Application_Links *app){
set_custom_hook(app, HookID_ViewEventHandler, default_view_input_handler); set_custom_hook(app, HookID_ViewEventHandler, default_view_input_handler);
set_custom_hook(app, HookID_Tick, default_tick); set_custom_hook(app, HookID_Tick, default_tick);
set_custom_hook(app, HookID_RenderCaller, default_render_caller); set_custom_hook(app, HookID_RenderCaller, default_render_caller);
set_custom_hook(app, HookID_WholeScreenRenderCaller, default_whole_screen_render_caller);
#if 0 #if 0
set_custom_hook(app, HookID_DeltaRule, original_delta); set_custom_hook(app, HookID_DeltaRule, original_delta);
set_custom_hook_memory_size(app, HookID_DeltaRule, set_custom_hook_memory_size(app, HookID_DeltaRule,

View File

@ -638,6 +638,7 @@ typedef i32 Hook_ID;
enum{ enum{
HookID_Tick, HookID_Tick,
HookID_RenderCaller, HookID_RenderCaller,
HookID_WholeScreenRenderCaller,
HookID_DeltaRule, HookID_DeltaRule,
HookID_BufferViewerUpdate, HookID_BufferViewerUpdate,
HookID_ViewEventHandler, HookID_ViewEventHandler,
@ -695,6 +696,9 @@ typedef void Tick_Function(Application_Links *app, Frame_Info frame_info);
api(custom) api(custom)
typedef void Render_Caller_Function(Application_Links *app, Frame_Info frame_info, View_ID view); typedef void Render_Caller_Function(Application_Links *app, Frame_Info frame_info, View_ID view);
api(custom)
typedef void Whole_Screen_Render_Caller_Function(Application_Links *app, Frame_Info frame_info);
api(custom) api(custom)
typedef u32 Layout_Item_Flag; typedef u32 Layout_Item_Flag;
enum{ enum{

View File

@ -13,7 +13,7 @@ SOURCE="$1"
if [ -z "$SOURCE" ]; then if [ -z "$SOURCE" ]; then
SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")" SOURCE="$(readlink -f "$CODE_HOME/4coder_default_bindings.cpp")"
fi fi
echo SOURCE = $SOURCE
opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=1" opts="-Wno-write-strings -Wno-null-dereference -Wno-comment -Wno-switch -Wno-missing-declarations -Wno-logical-op-parentheses -g -DOS_LINUX=1 -DOS_WINDOWS=0 -DOS_MAC=1"
arch=-m64 arch=-m64

Binary file not shown.

View File

@ -12,6 +12,7 @@
+ Fix: never miss the most recent post to the clipboard on windows + Fix: never miss the most recent post to the clipboard on windows
+ Fix: command `load_theme_current_buffer` gaurds against destroying the active color palette when bad files are loaded + Fix: command `load_theme_current_buffer` gaurds against destroying the active color palette when bad files are loaded
+ Fix: project deep copy routine copies strings in the whitelist and blacklist pattern arrays + Fix: project deep copy routine copies strings in the whitelist and blacklist pattern arrays
+ Fix: footer panel manipulation functions check if the view exists
4.1.3 4.1.3
+ Unkillable buffer setting + Unkillable buffer setting
@ -85,7 +86,7 @@ New in alpha 4.0.29:
-Highlighting and marking API, supporting customizable line higlights, range highlights, cursors and marks -Highlighting and marking API, supporting customizable line higlights, range highlights, cursors and marks
-In config.4coder "use_line_highlight" enables the highlight at the cursor in the active view -In config.4coder "use_line_highlight" enables the highlight at the cursor in the active view
-In config.4coder "use_scope_highlight" enables background highlighting to distinguish scopes in code files -In config.4coder "use_scope_highlight" enables background highlighting to distinguish scopes in code files
-In config.4coder "use_paren_helper" enalbes distinct coloring for matching parentheses -In config.4coder "use_paren_helper" enalbes distinct coloring for matching parentheses
-In config.4coder "use_comment_keyword" enables special coloring for the strings 'TODO' and 'NOTE' anywhere they occur, in code or text -In config.4coder "use_comment_keyword" enables special coloring for the strings 'TODO' and 'NOTE' anywhere they occur, in code or text
-In config.4coder "mode" sets the editing mode -In config.4coder "mode" sets the editing mode
"4coder" the default 4coder mode "4coder" the default 4coder mode