<commit_before>// HLSL2GLSLConverterImpl.cpp : Defines the entry point for the console application.
//

#include <Windows.h>
#include "Errors.h"
#include "HLSL2GLSLConverterImpl.h"
#include "RefCntAutoPtr.h"
#include "Errors.h"
#include "RenderDeviceFactoryOpenGL.h"
#include "BasicShaderSourceStreamFactory.h"
#include "RefCntAutoPtr.h"
#include "DataBlobImpl.h"

using namespace Diligent;

// Called every time the application receives a message
LRESULT CALLBACK MessageProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    // Send event message to AntTweakBar
    switch (message) 
    {
        case WM_PAINT:
            {
                PAINTSTRUCT ps;
                BeginPaint(wnd, &ps);
                EndPaint(wnd, &ps);
                return 0;
            }
        case WM_SIZE: // Window size has been changed
            return 0;
        case WM_CHAR:
            if (wParam == VK_ESCAPE)
                PostQuitMessage(0);
            return 0;
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
        default:
            return DefWindowProc(wnd, message, wParam, lParam);
    }
}

void PrintHelp()
{
    LOG_INFO_MESSAGE("Command line arguments:\n");
    LOG_INFO_MESSAGE("-h             Print help message\n");
    LOG_INFO_MESSAGE("-i <filename>  Input file path (relative to the search directories)\n");
    LOG_INFO_MESSAGE("-d <dirname>   Search directory to look for input file path as well as all #include files");
    LOG_INFO_MESSAGE("               Every search directory should be specified using -d argument\n");
    LOG_INFO_MESSAGE("-o <filename>  Output file to write converted GLSL source to\n");
    LOG_INFO_MESSAGE("-e <funcname>  Shader entry point\n");
    LOG_INFO_MESSAGE("-c             Compile converted GLSL shader\n");
    LOG_INFO_MESSAGE("-t <type>      Shader type. Allowed values:");
    LOG_INFO_MESSAGE("                 vs - vertex shader");
    LOG_INFO_MESSAGE("                 ps - pixel shader");
    LOG_INFO_MESSAGE("                 gs - geometry shader");
    LOG_INFO_MESSAGE("                 ds - domain shader");
    LOG_INFO_MESSAGE("                 hs - domain shader");
    LOG_INFO_MESSAGE("                 cs - domain shader\n");
    LOG_INFO_MESSAGE("-noglsldef     Do not include glsl definitions into the converted source\n");
}

// Main
int main(int argc, char** argv)
{
#if defined(_MSC_VER) && (defined(_DEBUG) || defined(DEBUG))
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    if (argc == 1)
    {
        PrintHelp();
        return 0;
    }

    std::string InputPath, OutputPath, SearchDirectories, EntryPoint("main");
    SHADER_TYPE ShaderType = SHADER_TYPE_UNKNOWN;
    bool CompileShader = false;<commit_msg>Enabled _CrtSetDbgFlag on any windows build in HLSL2GLSLConverter<commit_after>// HLSL2GLSLConverterImpl.cpp : Defines the entry point for the console application.
//

#include <Windows.h>
#include <crtdbg.h>

#include "Errors.h"
#include "HLSL2GLSLConverterImpl.h"
#include "RefCntAutoPtr.h"
#include "Errors.h"
#include "RenderDeviceFactoryOpenGL.h"
#include "BasicShaderSourceStreamFactory.h"
#include "RefCntAutoPtr.h"
#include "DataBlobImpl.h"

using namespace Diligent;

// Called every time the application receives a message
LRESULT CALLBACK MessageProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    // Send event message to AntTweakBar
    switch (message) 
    {
        case WM_PAINT:
            {
                PAINTSTRUCT ps;
                BeginPaint(wnd, &ps);
                EndPaint(wnd, &ps);
                return 0;
            }
        case WM_SIZE: // Window size has been changed
            return 0;
        case WM_CHAR:
            if (wParam == VK_ESCAPE)
                PostQuitMessage(0);
            return 0;
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
        default:
            return DefWindowProc(wnd, message, wParam, lParam);
    }
}

void PrintHelp()
{
    LOG_INFO_MESSAGE("Command line arguments:\n");
    LOG_INFO_MESSAGE("-h             Print help message\n");
    LOG_INFO_MESSAGE("-i <filename>  Input file path (relative to the search directories)\n");
    LOG_INFO_MESSAGE("-d <dirname>   Search directory to look for input file path as well as all #include files");
    LOG_INFO_MESSAGE("               Every search directory should be specified using -d argument\n");
    LOG_INFO_MESSAGE("-o <filename>  Output file to write converted GLSL source to\n");
    LOG_INFO_MESSAGE("-e <funcname>  Shader entry point\n");
    LOG_INFO_MESSAGE("-c             Compile converted GLSL shader\n");
    LOG_INFO_MESSAGE("-t <type>      Shader type. Allowed values:");
    LOG_INFO_MESSAGE("                 vs - vertex shader");
    LOG_INFO_MESSAGE("                 ps - pixel shader");
    LOG_INFO_MESSAGE("                 gs - geometry shader");
    LOG_INFO_MESSAGE("                 ds - domain shader");
    LOG_INFO_MESSAGE("                 hs - domain shader");
    LOG_INFO_MESSAGE("                 cs - domain shader\n");
    LOG_INFO_MESSAGE("-noglsldef     Do not include glsl definitions into the converted source\n");
}

// Main
int main(int argc, char** argv)
{
#if defined(_DEBUG) || defined(DEBUG)
    _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif

    if (argc == 1)
    {
        PrintHelp();
        return 0;
    }

    std::string InputPath, OutputPath, SearchDirectories, EntryPoint("main");
    SHADER_TYPE ShaderType = SHADER_TYPE_UNKNOWN;
    bool CompileShader = false;
{'fraction_non_alphanumeric': 0.09824937477670596, 'fraction_numerical': 0.0037513397642015005, 'mean_word_length': 2.46044499381953, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2487253', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1644, 'n_words': 467}