<commit_before>#ifndef __TextureArray_H__
#define __TextureArray_H__

#include "SdkSample.h"
#include "OgreImage.h"

using namespace Ogre;
using namespace OgreBites;

class _OgreSampleClassExport Sample_TextureArray : public SdkSample
{
public:

    Sample_TextureArray()
    {
        mInfo["Title"] = "Texture Array";
        mInfo["Description"] = "Demonstrates texture array support.";
        mInfo["Thumbnail"] = "thumb_texarray.png";
        mInfo["Category"] = "Unsorted";
        mInfo["Help"] = "Top Left: Multi-frame\nTop Right: Scrolling\nBottom Left: Rotation\nBottom Right: Scaling";
    }

protected:

    StringVector getRequiredPlugins()
    {
        StringVector names;
        if (!GpuProgramManager::getSingleton().isSyntaxSupported("glsles") && !GpuProgramManager::getSingleton().isSyntaxSupported("glsl150"))
            names.push_back("Cg Program Manager");
        return names;
    }

    void testCapabilities( const RenderSystemCapabilities* caps )
    {
        if (!caps->hasCapability(RSC_VERTEX_PROGRAM) || !caps->hasCapability(RSC_FRAGMENT_PROGRAM))
        {
            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your graphics card does not support vertex and "
                        "fragment programs, so you cannot run this sample. Sorry!",
                        "TextureArray::testCapabilities");
        }

        if (!GpuProgramManager::getSingleton().isSyntaxSupported("vs_4_0") &&
            !GpuProgramManager::getSingleton().isSyntaxSupported("ps_2_0") && 
            !GpuProgramManager::getSingleton().isSyntaxSupported("glsl150") &&
            !GpuProgramManager::getSingleton().isSyntaxSupported("glsl300es") &&
            !GpuProgramManager::getSingleton().isSyntaxSupported("gp4fp"))
        {
            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support the shader model needed for this sample, "
                        "so you cannot run this sample. Sorry!", "TextureArray::testCapabilities");
        }
    }

    void setupContent()
    {
        mSceneMgr->setSkyBox(true, "Examples/TrippySkyBox");

        // set our camera to orbit around the origin and show cursor
        mCameraMan->setStyle(CS_ORBIT);
        mTrayMgr->showCursor();

        // the names of the textures we will use (all need to be the same size: 512*512 in our case)
        vector<String>::type texNames;
        texNames.push_back("BeachStones.jpg");
        texNames.push_back("BumpyMetal.jpg");
        texNames.push_back("egyptrockyfull.jpg");
        texNames.push_back("frost.png");
        texNames.push_back("MtlPlat2.jpg");
        texNames.push_back("nskingr.jpg");
        texNames.push_back("Panels_Diffuse.png");
        texNames.push_back("Panels_reflection.png");
        texNames.push_back("RustedMetal.jpg");
        texNames.push_back("spacesky.jpg");
        texNames.push_back("terrain_texture.jpg");
        texNames.push_back("texmap2.jpg");
        texNames.push_back("Water01.jpg");
        texNames.push_back("Water02.jpg");
        texNames.push_back("body.jpg");
        texNames.push_back("stone1.jpg");
        texNames.push_back("wall3.jpg");
        texNames.push_back("sinbad_body.tga");
        texNames.push_back("sinbad_clothes.tga");
        texNames.push_back("stevecube_bk.jpg");

        // create the 2d texture array (the depth is the size of the array - number of textures)
        TexturePtr tex = TextureManager::getSingleton().createManual("TextureArrayTex", 
            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
            TEX_TYPE_2D_ARRAY, 
            512, 512, (uint)texNames.size(),
            0, 
            PF_X8R8G8B8 );


        // add all the textures to a 2d texture array<commit_msg>Avoid collision with "uint" on older compilers.<commit_after>#ifndef __TextureArray_H__
#define __TextureArray_H__

#include "SdkSample.h"
#include "OgreImage.h"

using namespace Ogre;
using namespace OgreBites;

class _OgreSampleClassExport Sample_TextureArray : public SdkSample
{
public:

    Sample_TextureArray()
    {
        mInfo["Title"] = "Texture Array";
        mInfo["Description"] = "Demonstrates texture array support.";
        mInfo["Thumbnail"] = "thumb_texarray.png";
        mInfo["Category"] = "Unsorted";
        mInfo["Help"] = "Top Left: Multi-frame\nTop Right: Scrolling\nBottom Left: Rotation\nBottom Right: Scaling";
    }

protected:

    StringVector getRequiredPlugins()
    {
        StringVector names;
        if (!GpuProgramManager::getSingleton().isSyntaxSupported("glsles") && !GpuProgramManager::getSingleton().isSyntaxSupported("glsl150"))
            names.push_back("Cg Program Manager");
        return names;
    }

    void testCapabilities( const RenderSystemCapabilities* caps )
    {
        if (!caps->hasCapability(RSC_VERTEX_PROGRAM) || !caps->hasCapability(RSC_FRAGMENT_PROGRAM))
        {
            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your graphics card does not support vertex and "
                        "fragment programs, so you cannot run this sample. Sorry!",
                        "TextureArray::testCapabilities");
        }

        if (!GpuProgramManager::getSingleton().isSyntaxSupported("vs_4_0") &&
            !GpuProgramManager::getSingleton().isSyntaxSupported("ps_2_0") && 
            !GpuProgramManager::getSingleton().isSyntaxSupported("glsl150") &&
            !GpuProgramManager::getSingleton().isSyntaxSupported("glsl300es") &&
            !GpuProgramManager::getSingleton().isSyntaxSupported("gp4fp"))
        {
            OGRE_EXCEPT(Exception::ERR_NOT_IMPLEMENTED, "Your card does not support the shader model needed for this sample, "
                        "so you cannot run this sample. Sorry!", "TextureArray::testCapabilities");
        }
    }

    void setupContent()
    {
        mSceneMgr->setSkyBox(true, "Examples/TrippySkyBox");

        // set our camera to orbit around the origin and show cursor
        mCameraMan->setStyle(CS_ORBIT);
        mTrayMgr->showCursor();

        // the names of the textures we will use (all need to be the same size: 512*512 in our case)
        vector<String>::type texNames;
        texNames.push_back("BeachStones.jpg");
        texNames.push_back("BumpyMetal.jpg");
        texNames.push_back("egyptrockyfull.jpg");
        texNames.push_back("frost.png");
        texNames.push_back("MtlPlat2.jpg");
        texNames.push_back("nskingr.jpg");
        texNames.push_back("Panels_Diffuse.png");
        texNames.push_back("Panels_reflection.png");
        texNames.push_back("RustedMetal.jpg");
        texNames.push_back("spacesky.jpg");
        texNames.push_back("terrain_texture.jpg");
        texNames.push_back("texmap2.jpg");
        texNames.push_back("Water01.jpg");
        texNames.push_back("Water02.jpg");
        texNames.push_back("body.jpg");
        texNames.push_back("stone1.jpg");
        texNames.push_back("wall3.jpg");
        texNames.push_back("sinbad_body.tga");
        texNames.push_back("sinbad_clothes.tga");
        texNames.push_back("stevecube_bk.jpg");

        // create the 2d texture array (the depth is the size of the array - number of textures)
        TexturePtr tex = TextureManager::getSingleton().createManual("TextureArrayTex", 
            ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
            TEX_TYPE_2D_ARRAY, 
            512, 512, (Ogre::uint)texNames.size(),
            0, 
            PF_X8R8G8B8 );


        // add all the textures to a 2d texture array
{'fraction_non_alphanumeric': 0.11682242990654206, 'fraction_numerical': 0.011214953271028037, 'mean_word_length': 2.9930703624733477, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '6877428', 'n_tokens_mistral': 2318, 'n_tokens_neox': 2209, 'n_words': 415}