mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Load zigzag texture.
This commit is contained in:
parent
42aeece7fd
commit
62ec968f24
@ -45,6 +45,7 @@
|
|||||||
#include "../../server/IconsFontAwesome6.h"
|
#include "../../server/IconsFontAwesome6.h"
|
||||||
|
|
||||||
#include "icon.hpp"
|
#include "icon.hpp"
|
||||||
|
#include "zigzag.hpp"
|
||||||
|
|
||||||
#include "Backend.hpp"
|
#include "Backend.hpp"
|
||||||
#include "ConnectionHistory.hpp"
|
#include "ConnectionHistory.hpp"
|
||||||
@ -95,6 +96,9 @@ static uint8_t* iconPx;
|
|||||||
static int iconX, iconY;
|
static int iconX, iconY;
|
||||||
static void* iconTex;
|
static void* iconTex;
|
||||||
static int iconTexSz;
|
static int iconTexSz;
|
||||||
|
static uint8_t* zigzagPx;
|
||||||
|
static int zigzagX, zigzagY;
|
||||||
|
static void* zigzagTex;
|
||||||
static Backend* bptr;
|
static Backend* bptr;
|
||||||
static bool s_customTitle = false;
|
static bool s_customTitle = false;
|
||||||
static bool s_isElevated = false;
|
static bool s_isElevated = false;
|
||||||
@ -219,12 +223,14 @@ int main( int argc, char** argv )
|
|||||||
|
|
||||||
auto iconThread = std::thread( [] {
|
auto iconThread = std::thread( [] {
|
||||||
iconPx = stbi_load_from_memory( (const stbi_uc*)Icon_data, Icon_size, &iconX, &iconY, nullptr, 4 );
|
iconPx = stbi_load_from_memory( (const stbi_uc*)Icon_data, Icon_size, &iconX, &iconY, nullptr, 4 );
|
||||||
|
zigzagPx = stbi_load_from_memory( (const stbi_uc*)ZigZag_data, ZigZag_size, &zigzagX, &zigzagY, nullptr, 4 );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
ImGuiTracyContext imguiContext;
|
ImGuiTracyContext imguiContext;
|
||||||
Backend backend( title, DrawContents, &mainThreadTasks );
|
Backend backend( title, DrawContents, &mainThreadTasks );
|
||||||
tracy::InitTexture();
|
tracy::InitTexture();
|
||||||
iconTex = tracy::MakeTexture();
|
iconTex = tracy::MakeTexture();
|
||||||
|
zigzagTex = tracy::MakeTexture( true );
|
||||||
iconThread.join();
|
iconThread.join();
|
||||||
backend.SetIcon( iconPx, iconX, iconY );
|
backend.SetIcon( iconPx, iconX, iconY );
|
||||||
bptr = &backend;
|
bptr = &backend;
|
||||||
@ -239,6 +245,10 @@ int main( int argc, char** argv )
|
|||||||
|
|
||||||
SetupDPIScale( dpiScale, s_fixedWidth, s_bigFont, s_smallFont );
|
SetupDPIScale( dpiScale, s_fixedWidth, s_bigFont, s_smallFont );
|
||||||
|
|
||||||
|
tracy::UpdateTextureRGBA( zigzagTex, zigzagPx, zigzagX, zigzagY );
|
||||||
|
tracy::MakeMipMaps( zigzagTex );
|
||||||
|
free( zigzagPx );
|
||||||
|
|
||||||
if( initFileOpen )
|
if( initFileOpen )
|
||||||
{
|
{
|
||||||
view = std::make_unique<tracy::View>( RunOnMainThread, *initFileOpen, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
|
view = std::make_unique<tracy::View>( RunOnMainThread, *initFileOpen, s_fixedWidth, s_smallFont, s_bigFont, SetWindowTitleCallback, SetupScaleCallback, AttentionCallback );
|
||||||
@ -260,6 +270,7 @@ int main( int argc, char** argv )
|
|||||||
if( updateNotesThread.joinable() ) updateNotesThread.join();
|
if( updateNotesThread.joinable() ) updateNotesThread.join();
|
||||||
view.reset();
|
view.reset();
|
||||||
|
|
||||||
|
tracy::FreeTexture( zigzagTex, RunOnMainThread );
|
||||||
tracy::FreeTexture( iconTex, RunOnMainThread );
|
tracy::FreeTexture( iconTex, RunOnMainThread );
|
||||||
free( iconPx );
|
free( iconPx );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user