コード例 #1
0
    particle_system_object::particle_system_object (const transform_d &transform, resources &res)
        : transformable_renderable_object (transform)
    {
        auto particleShaderId = gpu_program::id (particle_vertex_layout::alloc(),
                                                  "particles/particle.vert", "particles/particle.geom",
                                                  "particles/particle.frag");

        auto particleShader = res.gpuProgramsManager().request (particleShaderId, res);
        _material = material::alloc (technique::alloc (particleShader));
        _material->set ("uTexture", res.requestFromFile<texture> ("SmokeShape.png"));

        _generateVertexBuffer();
    }
コード例 #2
0
ファイル: main.cpp プロジェクト: Lnd-stoL/glGraphics
    void _initializeResources()
    {
        debug::log::println ("initializing resource managers ...");

        _resourceManagers.configFilesManager().addFileSearchLocation ("config");
        _resourceManagers.exs3dMeshesManager().addFileSearchLocation ("resources/models");
        _resourceManagers.gpuProgramsManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.vertexShadersManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.fragmentShadersManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.geometryShadersManager().addFileSearchLocation ("resources/shaders");
        _resourceManagers.fontsManager().addFileSearchLocation ("resources/fonts");
        _resourceManagers.texturesManager().addFileSearchLocation ("resources/textures");

        _resourceManagers.addFilesSearchLocation ("resources");
    }