Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 801 vs 804 for /trunk/Source Code/Platform/Video/ScopedStates.cpp

Diff revisions: vs.
  @@ -4,20 +4,26 @@
4 4 namespace Divide {
5 5 namespace GFX {
6 6
7 - Scoped2DRendering::Scoped2DRendering() {
8 - GFXDevice::instance().toggle2D(true);
7 + Scoped2DRendering::Scoped2DRendering(GFXDevice& context)
8 + : _context(context)
9 + {
10 + _context.toggle2D(true);
9 11 }
10 12
11 - Scoped2DRendering::~Scoped2DRendering() {
12 - GFXDevice::instance().toggle2D(false);
13 + Scoped2DRendering::~Scoped2DRendering()
14 + {
15 + _context.toggle2D(false);
13 16 }
14 17
15 - ScopedViewport::ScopedViewport(const vec4<I32>& viewport) {
16 - GFXDevice::instance().setViewport(viewport);
18 + ScopedViewport::ScopedViewport(GFXDevice& context, const vec4<I32>& viewport)
19 + : _context(context)
20 + {
21 + _context.setViewport(viewport);
17 22 }
18 23
19 - ScopedViewport::~ScopedViewport() {
20 - GFXDevice::instance().restoreViewport();
24 + ScopedViewport::~ScopedViewport()
25 + {
26 + _context.restoreViewport();
21 27 }
22 28
23 29 }; // namespace GFX