made it work with new fpc
This commit is contained in:
@@ -3,22 +3,26 @@
|
||||
#include "igamewindow.h"
|
||||
#include "materialsystem/imaterialsystem.h"
|
||||
#include "tier1/interface.h"
|
||||
#include "tier1/commandline.h"
|
||||
#include "tier0/commandline.h"
|
||||
#include "tier0/mem.h"
|
||||
#include "sv_dll.h"
|
||||
|
||||
IRenderContext *g_pRenderContext;
|
||||
IFileSystem *filesystem;
|
||||
|
||||
extern "C" void FunnyMain( int argc, char **argv )
|
||||
{
|
||||
CommandLine()->CreateCommandLine(argc, argv);
|
||||
|
||||
void *pFilesystem = Plat_LoadLibrary("libfilesystem.so");
|
||||
CreateInterfaceFn pFilesystemFactory = Sys_GetFactory(pFilesystem);
|
||||
CreateInterfaceFn pFilesystemFactory = Sys_GetFactory("filesystem_std");
|
||||
|
||||
filesystem = (IFileSystem*)pFilesystemFactory(FILESYSTEM_INTERFACE_VERSION, NULL);
|
||||
filesystem->Init();
|
||||
|
||||
gamewindow->Init();
|
||||
g_pMaterialSystem->Init();
|
||||
CreateInterfaceFn pMaterialSystemFactory = Sys_GetFactory("MaterialSystem");
|
||||
CreateInterfaceFn pRenderSystemFactory = Sys_GetFactory("RenderSystemVulkan");
|
||||
g_pRenderContext = (IRenderContext*)pRenderSystemFactory(RENDER_CONTEXT_INTERFACE_VERSION, NULL);
|
||||
g_pRenderContext->Init();
|
||||
|
||||
ServerGameDLL()->Init();
|
||||
|
||||
@@ -43,26 +47,25 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
|
||||
pCameraInfoBuffer = g_pRenderContext->CreateConstantBuffer(64);
|
||||
|
||||
/*
|
||||
pShader = g_pRenderContext->CreateShader("funnygame/core/shaders/flat.shader_c");
|
||||
pMaterial = g_pRenderContext->CreateMaterial(pShader);
|
||||
pMaterial->PSSetConstantsBuffer(0, pCameraInfoBuffer);
|
||||
*/
|
||||
|
||||
pOutputImage = g_pRenderContext->CreateRenderTarget(
|
||||
g_pRenderContext->GetNewOutputImageWidth(),
|
||||
g_pRenderContext->GetNewOutputImageHeight(),
|
||||
1280,
|
||||
720,
|
||||
IMAGE_FORMAT_RGBA8_UNORM,
|
||||
MULTISAMPLE_TYPE_NONE);
|
||||
|
||||
IRenderCommandList *pCommandList = g_pRenderContext->CreateCommandList();
|
||||
pCommandList->StartRecording();
|
||||
pCommandList->SetRenderTarget(0, pOutputImage);
|
||||
pCommandList->SetMaterial(pMaterial);
|
||||
pCommandList->SetVertexBuffer(0, pVertices);
|
||||
pCommandList->DrawPrimitives(3, 0, 1, 0);
|
||||
pCommandList->SetClearColor(0, 1,0,0,0);
|
||||
pCommandList->EndRecording();
|
||||
|
||||
for (;;) {
|
||||
gamewindow->UpdateWindow();
|
||||
/*
|
||||
if (g_pRenderContext->BIsOutputImageOutdated())
|
||||
{
|
||||
@@ -77,11 +80,7 @@ extern "C" void FunnyMain( int argc, char **argv )
|
||||
*/
|
||||
|
||||
g_pRenderContext->SubmitCommandList(pCommandList);
|
||||
|
||||
g_pRenderContext->SetOutputImage(pOutputImage);
|
||||
|
||||
gamewindow->UpdateWindow();
|
||||
Materials()->Frame(0);
|
||||
g_pRenderContext->Frame(0);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user