Commit Graph

34 Commits

Author SHA1 Message Date
tech4me 3dcedb36b4 Port Citra #4047 & #4052: add change background color support 2018-09-08 17:00:21 -07:00
Lioncash bc16f7f3cc renderer_base: Make creation of the rasterizer, the responsibility of the renderers themselves
Given we use a base-class type within the renderer for the rasterizer
(RasterizerInterface), we want to allow renderers to perform more
complex initialization if they need to do such a thing. This makes it
important to reserve type information.

Given the OpenGL renderer is quite simple settings-wise, this is just a
simple shuffling of the initialization code. For something like Vulkan
however this might involve doing something like:

// Initialize and call rasterizer-specific function that requires
// the full type of the instance created.
auto raster = std::make_unique<VulkanRasterizer>(some, params);
raster->CallSomeVulkanRasterizerSpecificFunction();

// Assign to base class variable
rasterizer = std::move(raster)
2018-08-20 19:28:00 -04:00
Lioncash 0a93b45b6a core: Namespace EmuWindow
Gets the class out of the global namespace.
2018-08-11 20:20:21 -04:00
Lioncash 20c2928c2b video_core; Get rid of global g_toggle_framelimit_enabled variable
Instead, we make a struct for renderer settings and allow the renderer
to update all of these settings, getting rid of the need for
global-scoped variables.

This also uncovered a few indirect inclusions for certain headers, which
this commit also fixes.
2018-08-10 19:00:09 -04:00
Lioncash f380496728 renderer_base: Remove unused kFramebuffer enumeration
This is entirely unused and can be removed.
2018-08-10 18:31:13 -04:00
Lioncash 2665457f4a renderer_base: Make Rasterizer() return the rasterizer by reference
All calling code assumes that the rasterizer will be in a valid state,
which is a totally fine assumption. The only way the rasterizer wouldn't
be is if initialization is done incorrectly or fails, which is checked
against in System::Init().
2018-08-04 02:36:58 -04:00
Lioncash 6030c5ce41 video_core: Eliminate the g_renderer global variable
We move the initialization of the renderer to the core class, while
keeping the creation of it and any other specifics in video_core. This
way we can ensure that the renderer is initialized and doesn't give
unfettered access to the renderer. This also makes dependencies on types
more explicit.

For example, the GPU class doesn't need to depend on the
existence of a renderer, it only needs to care about whether or not it
has a rasterizer, but since it was accessing the global variable, it was
also making the renderer a part of its dependency chain. By adjusting
the interface, we can get rid of this dependency.
2018-08-04 02:36:57 -04:00
Lioncash 0f2ac928f2 video_core: Make global EmuWindow instance part of the base renderer class
Makes the global a member of the RendererBase class. We also change this
to be a reference. Passing any form of null pointer to these functions
is incorrect entirely, especially given the code itself assumes that the
pointer would always be in a valid state.

This also makes it easier to follow the lifecycle of instances being
used, as we explicitly interact the renderer with the rasterizer, rather
than it just operating on a global pointer.
2018-08-01 21:40:30 -04:00
bunnei bfe45774f1 video_core: Move FramebufferInfo to FramebufferConfig in GPU. 2018-03-22 21:04:30 -04:00
bunnei 656de23d93 renderer: Create rasterizer and cleanup. 2018-03-22 19:46:37 -04:00
bunnei deadcb39c2 renderer_opengl: Support framebuffer flip vertical. 2018-02-11 21:03:55 -05:00
bunnei ebd613c2cc renderer: Render previous frame when no new one is available. 2018-01-14 23:54:56 -05:00
James Rowe 1d28b2e142 Remove references to PICA and rasterizers in video_core 2018-01-12 19:11:03 -07:00
bunnei ee4691297f renderer_opengl: Support rendering Switch framebuffer. 2018-01-10 23:28:59 -05:00
bunnei 236d463c52 render_base: Add a struct describing framebuffer metadata. 2018-01-10 23:28:56 -05:00
Emmanuel Gil Peyrot ebdae19fd2 Remove empty newlines in #include blocks.
This makes clang-format useful on those.

Also add a bunch of forgotten transitive includes, which otherwise
prevented compilation.
2016-09-21 11:15:47 +09:00
Yuri Kunde Schlesner 396a8d91a4 Manually tweak source formatting and then re-run clang-format 2016-09-18 21:14:25 -07:00
Emmanuel Gil Peyrot dc8479928c Sources: Run clang-format on everything. 2016-09-18 09:38:01 +09:00
bunnei 4a2d1571bc Merge pull request #1474 from lioncash/renderer
renderer_base: Minor changes
2016-03-09 10:57:38 -05:00
Lioncash 4b5b32e721 renderer_base: In-class initialize variables 2016-03-08 21:46:47 -05:00
Lioncash be913040a8 render_base: Clarify/normalize getter functions 2016-03-08 21:45:24 -05:00
Lioncash bf76afc68d renderer_base: Don't directly expose the rasterizer unique_ptr
There's no reason to allow direct access to the unique_ptr instance. Only
its contained pointer.
2016-03-08 21:31:44 -05:00
LittleWhite 4be68dddfb Improve error report from Init() functions
Add error popup when citra initialization failed
2016-03-08 22:05:25 +01:00
Yuri Kunde Schlesner 195fedccf0 VideoCore: Unify interface to OpenGL and SW rasterizers
This removes explicit checks sprinkled all over the codebase to instead
just have the SW rasterizer expose an implementation with no-ops for
most operations.
2015-12-07 20:20:38 -08:00
Emmanuel Gil Peyrot 4964a359e1 Core: Cleanup hw includes. 2015-06-28 00:46:39 +01:00
Emmanuel Gil Peyrot 45c4781544 CitraQt: Cleanup includes. 2015-06-28 00:36:54 +01:00
tfarley 05dc633a8c OpenGL renderer 2015-05-22 15:51:18 -07:00
Yuri Kunde Schlesner e1fbac3ca1 Common: Remove common.h 2015-05-07 15:45:22 -03:00
purpasmart96 ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Emmanuel Gil Peyrot f5d38649c7 Remove trailing spaces in every file but the ones imported from SkyEye, AOSP or generated 2014-11-19 09:03:07 +00:00
Yuri Kunde Schlesner 787a1b047c Remove virtual inheritance from RendererOpenGL
Also make destructor virtual so that instances are properly destructed.
2014-10-12 14:37:24 +02:00
bunnei a48c6b947d removed DISALLOW_COPY_AND_ASSIGN in favor of NonCopyable class 2014-04-27 18:29:51 -04:00
bunnei de0a034a84 fixed project includes to use new directory structure 2014-04-08 20:15:08 -04:00
bunnei 63e46abdb8 got rid of 'src' folders in each sub-project 2014-04-08 19:25:03 -04:00