Skip to content

Commit

Permalink
V1.13.0-win_0x01
Browse files Browse the repository at this point in the history
- Añadido el método ViewportBackdropColor(); a la 1clase NGN_Graphics, el cual permite escoger el color de backdrop del viewport especificado.
  • Loading branch information
knightfox75 committed Mar 5, 2023
1 parent e40ac48 commit 52fd81d
Show file tree
Hide file tree
Showing 49 changed files with 85 additions and 52 deletions.
2 changes: 1 addition & 1 deletion Source/config_flags.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
FLAGS de configuracion de la libreria
La libreria debe compilarse para que estos FLAGS sean efectivos
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Archivo principal de la libreria
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Archivo principal de la libreria
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_audio_clip.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Clips de audio
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_audio_clip.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Clips de audio
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_camera.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Camara virtual en 2D
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_camera.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Camara virtual en 2D
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_canvas.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Canvas - Capa de dibujo
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_canvas.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Canvas - Capa de dibujo
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_collisions.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Sistema de colisiones
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_collisions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Sistema de colisiones
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_defines.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Definiciones de prototipos
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
6 changes: 3 additions & 3 deletions Source/ngn_defines.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Definiciones de prototipos
Proyecto iniciado el 1 de Febrero del 2016
Expand Down Expand Up @@ -59,9 +59,9 @@

/*** Version de N'gine ***/
static const int32_t NGN_VERSION_MAJOR = 1; // Version mayor
static const int32_t NGN_VERSION_MINOR = 12; // Version menor
static const int32_t NGN_VERSION_MINOR = 13; // Version menor
static const int32_t NGN_VERSION_PATCH = 0; // Version parche
static const std::string NGN_VERSION_METADATA = "stable"; // Version metadatos
static const std::string NGN_VERSION_METADATA = "wip_0x01"; // Version metadatos

/*** Definiciones generales ***/
static const int32_t NGN_DEFAULT_VALUE = 0x7FFFFFFF; // Valor de "defecto"
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_disk.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones de acceso al disco
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_disk.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones de acceso al disco
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_filesystem.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones del sistema de archivos
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_filesystem.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones del sistema de archivos
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
34 changes: 32 additions & 2 deletions Source/ngn_graphics.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Gestion del Renderer de SDL
Proyecto iniciado el 1 de Febrero del 2016
Expand Down Expand Up @@ -452,6 +452,12 @@ void NGN_Graphics::OpenViewport(
v.clip_area.w = v.render_w;
v.clip_area.h = v.render_h;

// Color de backdrop por defecto (negro)
v.backdrop_color.r = 0x00;
v.backdrop_color.g = 0x00;
v.backdrop_color.b = 0x00;
v.backdrop_color.a = 0x00;

// Viewport disponible
v.available = true;

Expand Down Expand Up @@ -541,6 +547,20 @@ void NGN_Graphics::ViewportLocalFilter(uint8_t id, bool status) {



/*** Cambia el color del backdrop de un viewport ***/
void NGN_Graphics::ViewportBackdropColor(uint8_t id, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {

if (id >= VIEWPORT_NUMBER) return;

viewport_list[id].backdrop_color.r = r;
viewport_list[id].backdrop_color.g = g;
viewport_list[id].backdrop_color.b = b;
viewport_list[id].backdrop_color.a = a;

}



/*** Selecciona el VIEWPORT por defecto ***/
void NGN_Graphics::DefaultViewport() {

Expand Down Expand Up @@ -998,6 +1018,10 @@ void NGN_Graphics::SetupViewports() {
v.clip_area = {0, 0, 0, 0};
v.surface = NULL;
v._local_filter = v.local_filter = false;
v.backdrop_color.r = 0;
v.backdrop_color.g = 0;
v.backdrop_color.b = 0;
v.backdrop_color.a = 0;

viewport_list.clear();
viewport_list.reserve(VIEWPORT_NUMBER);
Expand Down Expand Up @@ -1045,7 +1069,13 @@ void NGN_Graphics::ClearViewports() {
// Informa al renderer que la textura "backbuffer" del viewport es su destino
SDL_SetRenderTarget(renderer, viewport_list[i].surface);
// Borra el contenido de la textura actual
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0x00);
SDL_SetRenderDrawColor(
renderer,
viewport_list[i].backdrop_color.r,
viewport_list[i].backdrop_color.g,
viewport_list[i].backdrop_color.b,
viewport_list[i].backdrop_color.a
);
SDL_RenderFillRect(renderer, NULL);
// Actualiza el estado del filtrado local
viewport_list[i]._local_filter = viewport_list[i].local_filter;
Expand Down
5 changes: 4 additions & 1 deletion Source/ngn_graphics.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Gestion del Renderer de SDL
Proyecto iniciado el 1 de Febrero del 2016
Expand Down Expand Up @@ -129,6 +129,7 @@ class NGN_Graphics {
bool _local_filter; // Estado actual del filtrado
bool available; // Viewport disponible?
SDL_Texture* surface; // Textura para usar de backbuffer para el viewport
Rgba backdrop_color; // Color por defecto del backdrop
};
std::vector<Viewport_struct> viewport_list;
int8_t current_viewport; // Viewport actual (-1 sin viewport)
Expand All @@ -153,6 +154,8 @@ class NGN_Graphics {
void ViewportPosition(uint8_t id, Vector2I32 position); // Sobrecarga 2
// Cambia el estado local del filtro de un viewport
void ViewportLocalFilter(uint8_t id, bool status);
// Cambia el color del backdrop de un viewport
void ViewportBackdropColor(uint8_t id, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
// Viewport por defecto
void DefaultViewport();

Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_image.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones para la manipulacion de imagenes en RAW
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_image.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones para la manipulacion de imagenes en RAW
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_input.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Meotodos de entrada
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_input.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Meotodos de entrada
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_load.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones de carga de archivos
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_load.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones de carga de archivos
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_log.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones de mensages de depuracion
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_log.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones de mensages de depuracion
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_math.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones matematicas
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_math.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones matematicas
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_music_clip.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Clips de musica
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_music_clip.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Clips de musica
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_render.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Gestion del Renderer de SDL
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_render.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Gestion del Renderer de SDL
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
2 changes: 1 addition & 1 deletion Source/ngn_resources.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
N'gine Lib for C++
*** Version 1.12.0-stable ***
*** Version 1.13.0-win_0x01 ***
Funciones del gestor de recursos
Proyecto iniciado el 1 de Febrero del 2016
Expand Down
Loading

0 comments on commit 52fd81d

Please sign in to comment.