Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
   Copyright (c) 2017 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _GL_TEXTURE_H_
#define _GL_TEXTURE_H_

#include "Platform/Video/OpenGL/Headers/glResources.h"
#include "Platform/Video/Textures/Headers/Texture.h"

namespace Divide {
class glLockManager;
class glTexture final : public Texture {
   public:
    explicit glTexture(GFXDevice& context,
                       const stringImpl& name,
                       const stringImpl& resourceName,
                       const stringImpl& resourceLocation,
                       TextureType type,
                       bool asyncLoad);
    ~glTexture();

    bool unload() override;

    void bind(U8 unit, bool flushStateOnRequest = true) override;

    void bindLayer(U8 slot, U8 level, U8 layer, bool layered, bool read, bool write, bool flushStateOnRequest = true) override;

    void setMipMapRange(GLushort base = 0, GLushort max = 1000) override;

    void resize(const bufferPtr ptr,
                const vec2<U16>& dimensions,
                const vec2<U16>& mipLevels) override;

    void loadData(const TextureLoadInfo& info,
                  const TextureDescriptor& descriptor,
                  const vectorImpl<ImageTools::ImageLayer>& imageLayers,
                  const vec2<GLushort>& mipLevels) override;
    void loadData(const TextureLoadInfo& info,
                  const TextureDescriptor& descriptor,
                  const bufferPtr data,
                  const vec2<U16>& dimensions,
                  const vec2<U16>& mipLevels) override;

    void copy(const Texture_ptr& other) override;

    bool flushTextureState() override;

   protected:
    void threadedLoad() override;
    void reserveStorage(const TextureLoadInfo& info);
    void updateMipMaps();
    void updateSampler();

    void loadDataCompressed(const TextureLoadInfo& info,
                            const vectorImpl<ImageTools::ImageLayer>& imageLayers);

    void loadDataUncompressed(const TextureLoadInfo& info,
                              bufferPtr data);
   private:
    GLenum _type;
    std::atomic_bool _allocatedStorage;
    glLockManager* _lockManager;
};

TYPEDEF_SMART_POINTERS_FOR_CLASS(glTexture);

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/Platform/Video/OpenGL/Textures/Headers/glTexture.h

Diff revisions: vs.
Revision Author Commited Message
836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

829 Diff Diff IonutCava picture IonutCava Tue 24 Jan, 2017 17:28:39 +0000

[IonutCava]
- Separate resourceLocation for resources into resourceLocation and resourceName.
- More XML config loading refactoring

806 Diff Diff IonutCava picture IonutCava Sun 08 Jan, 2017 22:00:48 +0000

[IonutCava]
- Finish implementing per-fragment velocity computation using a compute shader
— Further tuning still needed
- Add VS2017 build targets

722 Diff Diff IonutCava picture IonutCava Thu 09 Jun, 2016 16:15:33 +0000

[IonutCava]
- Restructure RenderTarget system:
— Separate attachments, use an attachment pool, use draw descriptors, require explicit information for RT calls, etc

713 Diff Diff IonutCava picture IonutCava Wed 25 May, 2016 15:43:38 +0000

[IonutCava]
- Removed all unique_ptr’s from the code with classic new/delete pairs. They were seriously not needed.
- Added the concept of SceneComponent to scene specific classes: aiManager, lightPool, sceneGraph, physicsInterface etc
— This allowed the removal of the global GET_ACTIVE_SCENEGRAPH call;

692 Diff Diff IonutCava picture IonutCava Wed 27 Apr, 2016 16:24:26 +0000

[IonutCava]
- Resource system cleanup:
— Resource name and resource file location (if any) is now passed only via explicit constructors! (ResourceDescriptors already contain this data, so why use setters?)
- Fix a bug with ortho projection matrix calculation (set m[3][3] to 1. this was skipped when the identity() call was changed to zero() in the ortho() function)
— This also fixed text rendering

652 Diff Diff IonutCava picture IonutCava Thu 25 Feb, 2016 17:13:10 +0000

[IonutCava]
- More work on compressed texture loading (DXT1, DXT3, DXT5)

648 Diff Diff IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these

622 Diff Diff IonutCava picture IonutCava Thu 14 Jan, 2016 17:18:49 +0000

[IonutCava]
- Remove onCameraUpdate call from LightManager and SceneGraph as it’s not needed
- Remove special threading handlers from Resource class as very few derived classes use them for now
— Use ResourceState to check current loading state
- Use insertion sort for particles as most entries should already be sorted from the previous frame
- Use async RenderBin sorting system

604 IonutCava picture IonutCava Sun 13 Dec, 2015 19:04:57 +0000

[IonutCava]
- New post processing system:
— Simplified operators
— PostFX is always enabled. Individual operators are toggles on or off
— Fixed Bloom and adaptive exposure
- Reworked texture creation and resizing
— Saved TextureDescriptor as part of the texture state