2017-05-17 08:01:54 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* *
|
|
|
|
* Project64-video - A Nintendo 64 gfx plugin. *
|
|
|
|
* http://www.pj64-emu.com/ *
|
|
|
|
* Copyright (C) 2017 Project64. All rights reserved. *
|
|
|
|
* Copyright (C) 2003-2009 Sergey 'Gonetz' Lipski *
|
|
|
|
* Copyright (C) 2002 Dave2001 *
|
|
|
|
* *
|
|
|
|
* License: *
|
|
|
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
|
|
|
* version 2 of the License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
#pragma once
|
|
|
|
#include <Project64-video/Renderer/types.h>
|
2017-05-22 07:32:32 +00:00
|
|
|
#include <glide.h>
|
|
|
|
|
2017-07-22 22:42:02 +00:00
|
|
|
void gfxClipWindow(uint32_t minx, uint32_t miny, uint32_t maxx, uint32_t maxy);
|
2017-07-22 23:03:22 +00:00
|
|
|
void gfxColorMask(bool rgb, bool a);
|
2017-07-23 00:04:04 +00:00
|
|
|
uint32_t gfxTexMinAddress(gfxChipID_t tmu);
|
2017-07-23 02:53:37 +00:00
|
|
|
bool gfxSstWinClose();
|
2017-07-25 22:17:52 +00:00
|
|
|
void gfxTextureBufferExt(gfxChipID_t tmu, uint32_t startAddress, gfxLOD_t lodmin, gfxLOD_t lodmax, gfxAspectRatio_t aspect, gfxTextureFormat_t fmt, uint32_t evenOdd);
|
2017-07-23 00:04:04 +00:00
|
|
|
uint32_t gfxTexMaxAddress(gfxChipID_t tmu);
|
2017-07-25 08:29:37 +00:00
|
|
|
uint32_t gfxTexTextureMemRequired(uint32_t evenOdd, gfxTexInfo *info);
|
2017-07-25 22:25:29 +00:00
|
|
|
void gfxConstantColorValue(gfxColor_t value);
|
2017-07-28 11:33:52 +00:00
|
|
|
void gfxColorCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert);
|
|
|
|
void gfxAlphaCombine(gfxCombineFunction_t function, gfxCombineFactor_t factor, gfxCombineLocal_t local, gfxCombineOther_t other, bool invert);
|
2017-07-26 11:46:02 +00:00
|
|
|
void gfxTexCombine(gfxChipID_t tmu, gfxCombineFunction_t rgb_function, gfxCombineFactor_t rgb_factor, gfxCombineFunction_t alpha_function, gfxCombineFactor_t alpha_factor, bool rgb_invert, bool alpha_invert);
|
2017-07-31 07:46:36 +00:00
|
|
|
void gfxAlphaBlendFunction(gfxAlphaBlendFnc_t rgb_sf, gfxAlphaBlendFnc_t rgb_df, gfxAlphaBlendFnc_t alpha_sf, gfxAlphaBlendFnc_t alpha_df);
|
2017-05-23 22:30:38 +00:00
|
|
|
void gfxAlphaTestReferenceValue(gfxAlpha_t value);
|
2017-07-31 11:05:29 +00:00
|
|
|
void gfxAlphaTestFunction(gfxCmpFnc_t function);
|
2017-07-31 11:15:09 +00:00
|
|
|
void gfxFogMode(gfxFogMode_t mode);
|
2017-05-24 07:30:02 +00:00
|
|
|
void gfxFogGenerateLinear(float nearZ, float farZ);
|
2017-07-25 22:25:29 +00:00
|
|
|
void gfxFogColorValue(gfxColor_t fogcolor);
|
2017-05-24 07:59:25 +00:00
|
|
|
void gfxChromakeyMode(GrChromakeyMode_t mode);
|
2017-07-25 22:25:29 +00:00
|
|
|
void gfxChromakeyValue(gfxColor_t value);
|
2017-05-24 08:14:54 +00:00
|
|
|
void gfxStippleMode(GrStippleMode_t mode);
|
2017-07-22 23:03:22 +00:00
|
|
|
void gfxColorCombineExt(gfxCCUColor_t a, gfxCombineMode_t a_mode, gfxCCUColor_t b, gfxCombineMode_t b_mode, gfxCCUColor_t c, bool c_invert, gfxCCUColor_t d, bool d_invert, uint32_t shift, bool invert);
|
|
|
|
void gfxAlphaCombineExt(gfxACUColor_t a, gfxCombineMode_t a_mode, gfxACUColor_t b, gfxCombineMode_t b_mode, gfxACUColor_t c, bool c_invert, gfxACUColor_t d, bool d_invert, uint32_t shift, bool invert);
|
2017-07-23 00:04:04 +00:00
|
|
|
void gfxTexColorCombineExt(gfxChipID_t tmu, gfxTCCUColor_t a, gfxCombineMode_t a_mode, gfxTCCUColor_t b, gfxCombineMode_t b_mode, gfxTCCUColor_t c, bool c_invert, gfxTCCUColor_t d, bool d_invert, uint32_t shift, bool invert);
|
|
|
|
void gfxTexAlphaCombineExt(gfxChipID_t tmu, gfxTACUColor_t a, gfxCombineMode_t a_mode, gfxTACUColor_t b, gfxCombineMode_t b_mode, gfxTACUColor_t c, bool c_invert, gfxTACUColor_t d, bool d_invert, uint32_t shift, bool invert);
|
2017-07-25 22:25:29 +00:00
|
|
|
void gfxConstantColorValueExt(gfxChipID_t tmu, gfxColor_t value);
|
2017-07-22 22:42:02 +00:00
|
|
|
void gfxVertexLayout(uint32_t param, FxI32 offset, uint32_t mode);
|
2017-05-24 22:36:49 +00:00
|
|
|
void gfxCullMode(GrCullMode_t mode);
|
2017-05-24 22:44:15 +00:00
|
|
|
void gfxDepthBufferMode(GrDepthBufferMode_t mode);
|
2017-07-31 11:05:29 +00:00
|
|
|
void gfxDepthBufferFunction(gfxCmpFnc_t function);
|
2017-07-22 23:03:22 +00:00
|
|
|
void gfxDepthMask(bool mask);
|
2017-05-24 22:54:10 +00:00
|
|
|
void gfxDrawTriangle(const void *a, const void *b, const void *c);
|
2017-05-25 07:31:29 +00:00
|
|
|
void gfxDepthBiasLevel(FxI32 level);
|
2017-05-25 08:01:37 +00:00
|
|
|
void gfxDrawLine(const void *a, const void *b);
|
2017-07-22 22:42:02 +00:00
|
|
|
void gfxDrawVertexArray(uint32_t mode, uint32_t Count, void *pointers2);
|
|
|
|
void gfxDrawVertexArrayContiguous(uint32_t mode, uint32_t Count, void *pointers, uint32_t stride);
|
2017-05-17 08:01:54 +00:00
|
|
|
|
2017-07-23 02:53:37 +00:00
|
|
|
bool gfxSstWinOpen(GrColorFormat_t color_format, GrOriginLocation_t origin_location, int nColBuffers, int nAuxBuffers);
|
2017-05-25 10:00:21 +00:00
|
|
|
void gfxAuxBufferExt(GrBuffer_t buffer);
|
2017-07-22 22:42:02 +00:00
|
|
|
uint32_t gfxGet(uint32_t pname, uint32_t plength, FxI32 *params);
|
2017-05-25 21:39:33 +00:00
|
|
|
void gfxFramebufferCopyExt(int x, int y, int w, int h, int from, int to, int mode);
|
2017-05-25 21:48:24 +00:00
|
|
|
void gfxRenderBuffer(GrBuffer_t buffer);
|
2017-07-25 22:25:29 +00:00
|
|
|
void gfxBufferClear(gfxColor_t color, gfxAlpha_t alpha, uint32_t depth);
|
2017-07-22 22:42:02 +00:00
|
|
|
void gfxBufferSwap(uint32_t swap_interval);
|
2017-07-22 23:03:22 +00:00
|
|
|
bool gfxLfbLock(GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode, GrOriginLocation_t origin, bool pixelPipeline, GrLfbInfo_t *info);
|
|
|
|
bool gfxLfbUnlock(GrLock_t type, GrBuffer_t buffer);
|
|
|
|
bool gfxLfbReadRegion(GrBuffer_t src_buffer, uint32_t src_x, uint32_t src_y, uint32_t src_width, uint32_t src_height, uint32_t dst_stride, void *dst_data);
|
|
|
|
bool gfxLfbWriteRegion(GrBuffer_t dst_buffer, uint32_t dst_x, uint32_t dst_y, GrLfbSrcFmt_t src_format, uint32_t src_width, uint32_t src_height, bool pixelPipeline, FxI32 src_stride, void *src_data);
|
2017-07-25 22:17:52 +00:00
|
|
|
uint32_t gfxTexCalcMemRequired(gfxLOD_t lodmin, gfxLOD_t lodmax, gfxAspectRatio_t aspect, gfxTextureFormat_t fmt);
|
2017-07-22 22:42:02 +00:00
|
|
|
void gfxLoadGammaTable(uint32_t nentries, uint32_t *red, uint32_t *green, uint32_t *blue);
|
|
|
|
void gfxGetGammaTableExt(uint32_t /*nentries*/, uint32_t *red, uint32_t *green, uint32_t *blue);
|
2017-07-20 07:47:25 +00:00
|
|
|
void gfxGammaCorrectionRGB(FxFloat gammaR, FxFloat gammaG, FxFloat gammaB);
|
2017-07-25 08:29:37 +00:00
|
|
|
void gfxTexDownloadMipMap(gfxChipID_t tmu, uint32_t startAddress, uint32_t evenOdd, gfxTexInfo *info);
|
|
|
|
void gfxTexSource(gfxChipID_t tmu, uint32_t startAddress, uint32_t evenOdd, gfxTexInfo *info);
|
2017-07-23 00:04:04 +00:00
|
|
|
void gfxTexDetailControl(gfxChipID_t tmu, int lod_bias, FxU8 detail_scale, float detail_max);
|
|
|
|
void gfxTexClampMode(gfxChipID_t tmu, GrTextureClampMode_t s_clampmode, GrTextureClampMode_t t_clampmode);
|
|
|
|
void gfxTexFilterMode(gfxChipID_t tmu, GrTextureFilterMode_t minfilter_mode, GrTextureFilterMode_t magfilter_mode);
|
2017-05-25 08:19:28 +00:00
|
|
|
|
2017-05-17 08:13:04 +00:00
|
|
|
extern uint32_t nbTextureUnits;
|
|
|
|
extern uint32_t g_scr_res_x, g_scr_res_y, g_res_x, g_res_y;
|