Remove begin_frame and end_frame, add clear_buffer.

This commit is contained in:
Roz K 2023-01-01 07:57:10 +01:00
parent ae3333e22e
commit e80bbe2418
Signed by: roz
GPG Key ID: 51FBF4E483E1C822
3 changed files with 15 additions and 13 deletions

View File

@ -385,8 +385,12 @@ create_batch.argtypes = (
ctypes.c_uint, # max_meshes
ctypes.c_char_p) # params_format
begin_frame = _engine.rk_begin_frame
begin_frame.restype = None
clear_buffer = _engine.rk_clear_buffer
clear_buffer.restype = None
clear_buffer.argtypes = (
ctypes.c_bool, # pixels
ctypes.c_bool, # depth
ctypes.c_bool) # stencil
select_shader = _engine.rk_select_shader
select_shader.restype = None
@ -460,9 +464,6 @@ unselect_shader.restype = None
unselect_shader.argtypes = (
ctypes.c_void_p,) # shader
end_frame = _engine.rk_end_frame
end_frame.restype = None
destroy_batch = _engine.rk_destroy_batch
destroy_batch.restype = None
destroy_batch.argtypes = (

View File

@ -124,7 +124,10 @@ RK_EXPORT rk_batch_t rk_create_batch(
rk_uint max_meshes,
rk_param_format const * params_format);
RK_EXPORT void rk_begin_frame();
RK_EXPORT void rk_clear_buffer(
rk_bool pixels,
rk_bool depth,
rk_bool stencil);
RK_EXPORT void rk_select_shader(
rk_shader_t _shader);
@ -174,8 +177,6 @@ RK_EXPORT void rk_unselect_texture(
RK_EXPORT void rk_unselect_shader(
rk_shader_t shader);
RK_EXPORT void rk_end_frame();
RK_EXPORT void rk_destroy_batch(
rk_batch_t batch);

View File

@ -676,8 +676,11 @@ rk_batch_t rk_create_batch(
return reinterpret_cast<rk_batch_t>(batch);
}
void rk_begin_frame() {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
void rk_clear_buffer(
rk_bool pixels,
rk_bool depth,
rk_bool stencil) {
glClear((GL_COLOR_BUFFER_BIT * pixels) | (GL_DEPTH_BUFFER_BIT * depth) | (GL_STENCIL_BUFFER_BIT * stencil));
}
void rk_select_shader(
@ -908,9 +911,6 @@ void rk_unselect_shader(
glUseProgram(0);
}
void rk_end_frame() {
}
void rk_destroy_batch(
rk_batch_t _batch) {
rk_batch * const batch = reinterpret_cast<rk_batch *>(_batch);