2013-04-17 23:09:55 -04:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "VideoCommon/ConstantManager.h"
|
|
|
|
#include "VideoCommon/VertexShaderGen.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2012-01-01 12:46:02 -08:00
|
|
|
class PointerWrap;
|
|
|
|
|
2011-01-29 21:13:56 +00:00
|
|
|
void UpdateProjectionHack(int iParams[], std::string sParams[]);
|
2009-12-05 13:56:23 +00:00
|
|
|
|
2008-12-26 10:43:18 +00:00
|
|
|
// The non-API dependent parts.
|
|
|
|
class VertexShaderManager
|
|
|
|
{
|
|
|
|
public:
|
2009-09-15 21:49:15 +00:00
|
|
|
static void Init();
|
|
|
|
static void Dirty();
|
|
|
|
static void Shutdown();
|
2012-01-01 12:46:02 -08:00
|
|
|
static void DoState(PointerWrap &p);
|
2013-03-19 21:51:12 -04:00
|
|
|
|
2009-09-15 21:49:15 +00:00
|
|
|
// constant management
|
2009-08-15 07:20:37 +00:00
|
|
|
static void SetConstants();
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-09-15 21:49:15 +00:00
|
|
|
static void InvalidateXFRange(int start, int end);
|
2011-02-05 18:25:34 +00:00
|
|
|
static void SetTexMatrixChangedA(u32 value);
|
|
|
|
static void SetTexMatrixChangedB(u32 value);
|
|
|
|
static void SetViewportChanged();
|
|
|
|
static void SetProjectionChanged();
|
2013-10-07 21:57:18 +02:00
|
|
|
static void SetMaterialColorChanged(int index, u32 color);
|
2009-04-19 10:10:45 +00:00
|
|
|
|
2013-07-22 00:14:42 -04:00
|
|
|
static void TranslateView(float x, float y, float z = 0.0f);
|
2009-09-15 21:49:15 +00:00
|
|
|
static void RotateView(float x, float y);
|
|
|
|
static void ResetView();
|
2013-10-29 01:23:17 -04:00
|
|
|
|
2015-01-24 03:15:09 +13:00
|
|
|
// data: 3 floats representing the X, Y and Z vertex model coordinates and the posmatrix index.
|
2015-01-24 15:12:52 -05:00
|
|
|
// out: 4 floats which will be initialized with the corresponding clip space coordinates
|
2014-12-25 00:34:22 -07:00
|
|
|
// NOTE: g_fProjectionMatrix must be up to date when this is called
|
2015-01-24 15:12:52 -05:00
|
|
|
// (i.e. VertexShaderManager::SetConstants needs to be called before using this!)
|
|
|
|
static void TransformToClipSpace(const float* data, float* out, u32 mtxIdx);
|
2014-12-25 00:34:22 -07:00
|
|
|
|
2013-10-07 16:02:24 +02:00
|
|
|
static VertexShaderConstants constants;
|
|
|
|
static bool dirty;
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|