source: trunk/src/gpu/renderer.cpp @ 2787

Last change on this file since 2787 was 2787, checked in by sam, 9 years ago

build: fix the X360 port.

File size: 18.1 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://www.wtfpl.net/ for more details.
9//
10
11#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <cstdlib>
16
17#if defined _XBOX
18#   include <xtl.h>
19#   undef near /* Fuck Microsoft */
20#   undef far /* Fuck Microsoft again */
21#elif defined _WIN32
22#   if defined USE_D3D9
23#      include <d3d9.h>
24#   endif
25#   define WIN32_LEAN_AND_MEAN
26#   include <windows.h>
27#   undef near /* Fuck Microsoft */
28#   undef far /* Fuck Microsoft again */
29#endif
30
31#include "core.h"
32#include "lolgl.h"
33
34/* FIXME: find a way to pass g_hwnd from the windowing system */
35#if defined USE_D3D9
36extern HWND g_hwnd;
37#elif defined _XBOX
38HWND g_hwnd = 0;
39#endif
40
41namespace lol
42{
43
44/*
45 * The global g_renderer object, initialised by Video::Init
46 */
47
48Renderer *g_renderer = nullptr;
49
50/*
51 * Private RendererData class
52 */
53
54class RendererData
55{
56    friend class Renderer;
57
58private:
59    ibox2 m_viewport;
60    vec4 m_clear_color;
61    float m_clear_depth;
62    AlphaFunc m_alpha_func;
63    float m_alpha_value;
64    BlendFunc m_blend_src, m_blend_dst;
65    DepthFunc m_depth_func;
66    CullMode m_cull_mode;
67    PolygonMode m_polygon_mode;
68
69private:
70#if defined USE_D3D9
71    IDirect3D9 *m_d3d_ctx;
72    IDirect3DDevice9 *m_d3d_dev;
73#elif defined _XBOX
74    Direct3D *m_d3d_ctx;
75    D3DDevice *m_d3d_dev;
76#endif
77};
78
79/*
80 * Public Renderer class
81 */
82
83Renderer::Renderer(ivec2 size)
84  : m_data(new RendererData())
85{
86#if defined USE_D3D9 || defined _XBOX
87    /* Create Direct3D context */
88    m_data->m_d3d_ctx = Direct3DCreate9(D3D_SDK_VERSION);
89    if (!m_data->m_d3d_ctx)
90    {
91        Log::Error("cannot initialise D3D\n");
92        exit(EXIT_FAILURE);
93    }
94
95    /* Create Direct3D device */
96#   if defined _XBOX
97    XVIDEO_MODE VideoMode;
98    XGetVideoMode(&VideoMode);
99    size = lol::min(size, ivec2(VideoMode.dwDisplayWidth,
100                                VideoMode.dwDisplayHeight));
101#   endif
102    D3DPRESENT_PARAMETERS d3dpp;
103    memset(&d3dpp, 0, sizeof(d3dpp));
104    d3dpp.BackBufferWidth = size.x;
105    d3dpp.BackBufferHeight = size.y;
106    d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
107    d3dpp.BackBufferCount = 1;
108    d3dpp.hDeviceWindow = g_hwnd;
109#   if defined USE_SDL
110    d3dpp.Windowed = TRUE;
111#   endif
112    d3dpp.EnableAutoDepthStencil = TRUE;
113    d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
114    d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
115    d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
116
117    HRESULT hr = m_data->m_d3d_ctx->CreateDevice(0, D3DDEVTYPE_HAL, g_hwnd,
118                                                 D3DCREATE_HARDWARE_VERTEXPROCESSING,
119                                                 &d3dpp, &m_data->m_d3d_dev);
120    if (FAILED(hr))
121    {
122        Log::Error("cannot create D3D device\n");
123        exit(EXIT_FAILURE);
124    }
125
126#else
127#   if defined USE_GLEW && !defined __APPLE__
128    /* Initialise GLEW if necessary */
129    GLenum glerr = glewInit();
130    if (glerr != GLEW_OK)
131    {
132        Log::Error("cannot initialise GLEW: %s\n", glewGetErrorString(glerr));
133        exit(EXIT_FAILURE);
134    }
135#   endif
136#endif
137
138    /* Initialise rendering states */
139    m_data->m_viewport = ibox2(0, 0, 0, 0);
140    SetViewport(ibox2(vec2(0), size));
141
142    m_data->m_clear_color = vec4(-1.f);
143    SetClearColor(vec4(0.1f, 0.2f, 0.3f, 1.0f));
144
145    m_data->m_clear_depth = -1.f;
146    SetClearDepth(1.f);
147
148    m_data->m_alpha_func = AlphaFunc::Never;
149    m_data->m_alpha_value = -1.0f;
150    SetAlphaFunc(AlphaFunc::Disabled, 0.0f);
151
152    m_data->m_blend_src = BlendFunc::Disabled;
153    m_data->m_blend_dst = BlendFunc::Disabled;
154    SetBlendFunc(BlendFunc::SrcAlpha, BlendFunc::OneMinusSrcAlpha);
155
156    m_data->m_depth_func = DepthFunc::Disabled;
157    SetDepthFunc(DepthFunc::LessOrEqual);
158
159    m_data->m_cull_mode = CullMode::Disabled;
160    SetCullMode(CullMode::Clockwise);
161
162    m_data->m_polygon_mode = PolygonMode::Point;
163    SetPolygonMode(PolygonMode::Fill);
164
165    /* Add some rendering states that we don't export to the user */
166#if defined USE_D3D9 || defined _XBOX
167    /* TODO */
168#else
169#   if defined HAVE_GL_2X && !defined __APPLE__
170    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
171#   endif
172#endif
173}
174
175Renderer::~Renderer()
176{
177    delete m_data;
178}
179
180void *Renderer::GetDevice()
181{
182#if defined USE_D3D9 || defined _XBOX
183    return m_data->m_d3d_dev;
184#else
185    return nullptr;
186#endif
187}
188
189/*
190 * Buffer clearing
191 */
192
193void Renderer::Clear(ClearMask mask)
194{
195#if defined USE_D3D9 || defined _XBOX
196    int m = 0;
197    if (mask & ClearMask::Color)
198        m |= D3DCLEAR_TARGET;
199    if (mask & ClearMask::Depth)
200        m |= D3DCLEAR_ZBUFFER;
201    if (mask & ClearMask::Stencil)
202        m |= D3DCLEAR_STENCIL;
203
204    vec3 tmp = 255.999f * GetClearColor().rgb;
205    D3DCOLOR clear_color = D3DCOLOR_XRGB((int)tmp.r, (int)tmp.g, (int)tmp.b);
206
207    if (FAILED(m_data->m_d3d_dev->Clear(0, nullptr, m, clear_color,
208                                        GetClearDepth(), 0)))
209        Abort();
210#else
211    GLbitfield m = 0;
212    if (mask & ClearMask::Color)
213        m |= GL_COLOR_BUFFER_BIT;
214    if (mask & ClearMask::Depth)
215        m |= GL_DEPTH_BUFFER_BIT;
216    if (mask & ClearMask::Stencil)
217        m |= GL_STENCIL_BUFFER_BIT;
218    glClear(m);
219#endif
220}
221
222/*
223 * Viewport dimensions
224 */
225
226void Renderer::SetViewport(ibox2 viewport)
227{
228    if (m_data->m_viewport == viewport)
229        return;
230
231#if defined USE_D3D9 || defined _XBOX
232    D3DVIEWPORT9 vp = { viewport.A.x, viewport.A.y,
233                        viewport.B.x, viewport.B.y,
234                        0.0f, 1.0f };
235    m_data->m_d3d_dev->SetViewport(&vp);
236#else
237    glViewport(viewport.A.x, viewport.A.y, viewport.B.x, viewport.B.y);
238#endif
239
240    m_data->m_viewport = viewport;
241}
242
243ibox2 Renderer::GetViewport() const
244{
245    return m_data->m_viewport;
246}
247
248/*
249 * Clear color
250 */
251
252void Renderer::SetClearColor(vec4 color)
253{
254    if (m_data->m_clear_color == color)
255        return;
256
257#if defined USE_D3D9 || defined _XBOX
258    /* Nothing to do */
259#else
260    glClearColor(color.r, color.g, color.b, color.a);
261#endif
262
263    m_data->m_clear_color = color;
264}
265
266vec4 Renderer::GetClearColor() const
267{
268    return m_data->m_clear_color;
269}
270
271/*
272 * Clear depth
273 */
274
275void Renderer::SetClearDepth(float depth)
276{
277    if (m_data->m_clear_depth == depth)
278        return;
279
280#if defined USE_D3D9 || defined _XBOX
281    /* Nothing to do */
282#elif defined HAVE_GLES_2X
283    glClearDepthf(depth);
284#else
285    glClearDepth(depth);
286#endif
287
288    m_data->m_clear_depth = depth;
289}
290
291float Renderer::GetClearDepth() const
292{
293    return m_data->m_clear_depth;
294}
295
296/*
297 * Alpha testing
298 */
299
300void Renderer::SetAlphaFunc(AlphaFunc func, float alpha)
301{
302    if (m_data->m_alpha_func == func && m_data->m_alpha_value == alpha)
303        return;
304
305#if defined USE_D3D9 || defined _XBOX
306    switch (func)
307    {
308        case AlphaFunc::Disabled:
309            break; /* Nothing to do */
310        case AlphaFunc::Never:
311            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_NEVER);
312            break;
313        case AlphaFunc::Less:
314            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_LESS);
315            break;
316        case AlphaFunc::Equal:
317            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_EQUAL);
318            break;
319        case AlphaFunc::LessOrEqual:
320            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_LESSEQUAL);
321            break;
322        case AlphaFunc::Greater:
323            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER);
324            break;
325        case AlphaFunc::NotEqual:
326            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_NOTEQUAL);
327            break;
328        case AlphaFunc::GreaterOrEqual:
329            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
330            break;
331        case AlphaFunc::Always:
332            m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_ALWAYS);
333            break;
334    }
335
336    if (func == AlphaFunc::Disabled)
337    {
338        m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
339    }
340    else
341    {
342        m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
343        m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHAREF,
344                                          (DWORD)(alpha * 255.999f));
345    }
346#elif defined GL_VERSION_1_1
347    switch (func)
348    {
349        case AlphaFunc::Disabled:
350            break; /* Nothing to do */
351        case AlphaFunc::Never:
352            glAlphaFunc(GL_NEVER, alpha); break;
353        case AlphaFunc::Less:
354            glAlphaFunc(GL_LESS, alpha); break;
355        case AlphaFunc::Equal:
356            glAlphaFunc(GL_EQUAL, alpha); break;
357        case AlphaFunc::LessOrEqual:
358            glAlphaFunc(GL_LEQUAL, alpha); break;
359        case AlphaFunc::Greater:
360            glAlphaFunc(GL_GREATER, alpha); break;
361        case AlphaFunc::NotEqual:
362            glAlphaFunc(GL_NOTEQUAL, alpha); break;
363        case AlphaFunc::GreaterOrEqual:
364            glAlphaFunc(GL_GEQUAL, alpha); break;
365        case AlphaFunc::Always:
366            glAlphaFunc(GL_ALWAYS, alpha); break;
367    }
368
369    if (func == AlphaFunc::Disabled)
370        glDisable(GL_ALPHA_TEST);
371    else
372        glEnable(GL_ALPHA_TEST);
373#else
374    /* XXX: alpha test not available in GL ES and deprecated anyway. */
375#endif
376
377    m_data->m_alpha_func = func;
378    m_data->m_alpha_value = alpha;
379}
380
381AlphaFunc Renderer::GetAlphaFunc() const
382{
383    return m_data->m_alpha_func;
384}
385
386float Renderer::GetAlphaValue() const
387{
388    return m_data->m_alpha_value;
389}
390
391/*
392 * Blend function
393 */
394
395void Renderer::SetBlendFunc(BlendFunc src, BlendFunc dst)
396{
397    if (m_data->m_blend_src == src && m_data->m_blend_dst == dst)
398        return;
399
400#if defined USE_D3D9 || defined _XBOX
401    D3DBLEND s1[2] = { D3DBLEND_ONE, D3DBLEND_ZERO };
402    BlendFunc s2[2] = { src, dst };
403
404    for (int i = 0; i < 2; ++i)
405    {
406        switch (s2[i])
407        {
408            case BlendFunc::Disabled:
409                break; /* Nothing to do */
410            case BlendFunc::Zero:
411                s1[i] = D3DBLEND_ZERO; break;
412            case BlendFunc::One:
413                s1[i] = D3DBLEND_ONE; break;
414            case BlendFunc::SrcColor:
415                s1[i] = D3DBLEND_SRCCOLOR; break;
416            case BlendFunc::OneMinusSrcColor:
417                s1[i] = D3DBLEND_INVSRCCOLOR; break;
418            case BlendFunc::DstColor:
419                s1[i] = D3DBLEND_DESTCOLOR; break;
420            case BlendFunc::OneMinusDstColor:
421                s1[i] = D3DBLEND_INVDESTCOLOR; break;
422            case BlendFunc::SrcAlpha:
423                s1[i] = D3DBLEND_SRCALPHA; break;
424            case BlendFunc::OneMinusSrcAlpha:
425                s1[i] = D3DBLEND_INVSRCALPHA; break;
426            case BlendFunc::DstAlpha:
427                s1[i] = D3DBLEND_DESTALPHA; break;
428            case BlendFunc::OneMinusDstAlpha:
429                s1[i] = D3DBLEND_INVDESTALPHA; break;
430            /* FiXME: these can be supported using D3DPBLENDCAPS_BLENDFACTOR */
431            case BlendFunc::ConstantColor:
432                ASSERT(0, "BlendFunc::ConstantColor not supported");
433                break;
434            case BlendFunc::OneMinusConstantColor:
435                ASSERT(0, "BlendFunc::OneMinusConstantColor not supported");
436                break;
437            case BlendFunc::ConstantAlpha:
438                ASSERT(0, "BlendFunc::ConstantAlpha not supported");
439                break;
440            case BlendFunc::OneMinusConstantAlpha:
441                ASSERT(0, "BlendFunc::OneMinusConstantAlpha not supported");
442                break;
443        }
444    }
445
446    if (src == BlendFunc::Disabled)
447    {
448        m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHABLENDENABLE, 0);
449    }
450    else
451    {
452        m_data->m_d3d_dev->SetRenderState(D3DRS_ALPHABLENDENABLE, 1);
453        m_data->m_d3d_dev->SetRenderState(D3DRS_SRCBLEND, s1[0]);
454        m_data->m_d3d_dev->SetRenderState(D3DRS_DESTBLEND, s1[1]);
455    }
456#else
457    GLenum s1[2] = { GL_ONE, GL_ZERO };
458    BlendFunc s2[2] = { src, dst };
459
460    for (int i = 0; i < 2; ++i)
461    {
462        switch (s2[i])
463        {
464            case BlendFunc::Disabled:
465                break; /* Nothing to do */
466            case BlendFunc::Zero:
467                s1[i] = GL_ZERO; break;
468            case BlendFunc::One:
469                s1[i] = GL_ONE; break;
470            case BlendFunc::SrcColor:
471                s1[i] = GL_SRC_COLOR; break;
472            case BlendFunc::OneMinusSrcColor:
473                s1[i] = GL_ONE_MINUS_SRC_COLOR; break;
474            case BlendFunc::DstColor:
475                s1[i] = GL_DST_COLOR; break;
476            case BlendFunc::OneMinusDstColor:
477                s1[i] = GL_ONE_MINUS_DST_COLOR; break;
478            case BlendFunc::SrcAlpha:
479                s1[i] = GL_SRC_ALPHA; break;
480            case BlendFunc::OneMinusSrcAlpha:
481                s1[i] = GL_ONE_MINUS_SRC_ALPHA; break;
482            case BlendFunc::DstAlpha:
483                s1[i] = GL_DST_ALPHA; break;
484            case BlendFunc::OneMinusDstAlpha:
485                s1[i] = GL_ONE_MINUS_DST_ALPHA; break;
486            case BlendFunc::ConstantColor:
487                s1[i] = GL_CONSTANT_COLOR; break;
488            case BlendFunc::OneMinusConstantColor:
489                s1[i] = GL_ONE_MINUS_CONSTANT_COLOR; break;
490            case BlendFunc::ConstantAlpha:
491                s1[i] = GL_CONSTANT_ALPHA; break;
492            case BlendFunc::OneMinusConstantAlpha:
493                s1[i] = GL_ONE_MINUS_CONSTANT_ALPHA; break;
494        }
495    }
496
497    if (src == BlendFunc::Disabled)
498    {
499        glDisable(GL_BLEND);
500    }
501    else
502    {
503        glEnable(GL_BLEND);
504        glBlendFunc(s1[0], s1[1]);
505    }
506#endif
507
508    m_data->m_blend_src = src;
509    m_data->m_blend_dst = dst;
510}
511
512BlendFunc Renderer::GetBlendFuncSrc() const
513{
514    return m_data->m_blend_src;
515}
516
517BlendFunc Renderer::GetBlendFuncDst() const
518{
519    return m_data->m_blend_dst;
520}
521
522/*
523 * Depth test
524 */
525
526void Renderer::SetDepthFunc(DepthFunc func)
527{
528    if (m_data->m_depth_func == func)
529        return;
530
531#if defined USE_D3D9 || defined _XBOX
532    switch (func)
533    {
534        case DepthFunc::Disabled:
535            break; /* Nothing to do */
536        case DepthFunc::Never:
537            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_NEVER);
538            break;
539        case DepthFunc::Less:
540            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS);
541            break;
542        case DepthFunc::Equal:
543            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL);
544            break;
545        case DepthFunc::LessOrEqual:
546            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
547            break;
548        case DepthFunc::Greater:
549            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_GREATER);
550            break;
551        case DepthFunc::NotEqual:
552            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_NOTEQUAL);
553            break;
554        case DepthFunc::GreaterOrEqual:
555            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_GREATEREQUAL);
556            break;
557        case DepthFunc::Always:
558            m_data->m_d3d_dev->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
559            break;
560    }
561
562    if (func == DepthFunc::Disabled)
563        m_data->m_d3d_dev->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
564    else
565        m_data->m_d3d_dev->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
566#else
567    switch (func)
568    {
569        case DepthFunc::Disabled:
570            break; /* Nothing to do */
571        case DepthFunc::Never:
572            glDepthFunc(GL_NEVER); break;
573        case DepthFunc::Less:
574            glDepthFunc(GL_LESS); break;
575        case DepthFunc::Equal:
576            glDepthFunc(GL_EQUAL); break;
577        case DepthFunc::LessOrEqual:
578            glDepthFunc(GL_LEQUAL); break;
579        case DepthFunc::Greater:
580            glDepthFunc(GL_GREATER); break;
581        case DepthFunc::NotEqual:
582            glDepthFunc(GL_NOTEQUAL); break;
583        case DepthFunc::GreaterOrEqual:
584            glDepthFunc(GL_GEQUAL); break;
585        case DepthFunc::Always:
586            glDepthFunc(GL_ALWAYS); break;
587    }
588
589    if (func == DepthFunc::Disabled)
590        glDisable(GL_DEPTH_TEST);
591    else
592        glEnable(GL_DEPTH_TEST);
593#endif
594
595    m_data->m_depth_func = func;
596}
597
598DepthFunc Renderer::GetDepthFunc() const
599{
600    return m_data->m_depth_func;
601}
602
603/*
604 * Face culling
605 */
606
607void Renderer::SetCullMode(CullMode mode)
608{
609    if (m_data->m_cull_mode == mode)
610        return;
611
612#if defined USE_D3D9 || defined _XBOX
613    switch (mode)
614    {
615    case CullMode::Disabled:
616        m_data->m_d3d_dev->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
617        break;
618    case CullMode::Clockwise:
619        m_data->m_d3d_dev->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
620        break;
621    case CullMode::CounterClockwise:
622        m_data->m_d3d_dev->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
623        break;
624    }
625#else
626    switch (mode)
627    {
628    case CullMode::Disabled:
629        glDisable(GL_CULL_FACE);
630        break;
631    case CullMode::Clockwise:
632        glEnable(GL_CULL_FACE);
633        glCullFace(GL_FRONT);
634        glFrontFace(GL_CW);
635        break;
636    case CullMode::CounterClockwise:
637        glEnable(GL_CULL_FACE);
638        glCullFace(GL_FRONT);
639        glFrontFace(GL_CCW);
640        break;
641    }
642#endif
643
644    m_data->m_cull_mode = mode;
645}
646
647CullMode Renderer::GetCullMode() const
648{
649    return m_data->m_cull_mode;
650}
651
652/*
653 * Polygon rendering mode
654 */
655
656void Renderer::SetPolygonMode(PolygonMode mode)
657{
658    if (m_data->m_polygon_mode == mode)
659        return;
660
661#if defined USE_D3D9 || defined _XBOX
662    switch (mode)
663    {
664    case PolygonMode::Point:
665        m_data->m_d3d_dev->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT);
666        break;
667    case PolygonMode::Line:
668        m_data->m_d3d_dev->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
669        break;
670    case PolygonMode::Fill:
671        m_data->m_d3d_dev->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
672        break;
673    }
674#elif defined __CELLOS_LV2__ || defined GL_VERSION_1_1
675    switch (mode)
676    {
677    case PolygonMode::Point:
678        glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
679        break;
680    case PolygonMode::Line:
681        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
682        break;
683    case PolygonMode::Fill:
684        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
685        break;
686    }
687#endif
688
689    m_data->m_polygon_mode = mode;
690}
691
692PolygonMode Renderer::GetPolygonMode() const
693{
694    return m_data->m_polygon_mode;
695}
696
697} /* namespace lol */
698
Note: See TracBrowser for help on using the repository browser.