WebTexture2D.cpp 713 B

1234567891011121314151617181920212223242526272829303132
  1. #include <Atomic/Resource/ResourceCache.h>
  2. #include <Atomic/Graphics/Graphics.h>
  3. #include <Atomic/Graphics/Technique.h>
  4. #include "WebTexture2D.h"
  5. namespace Atomic
  6. {
  7. WebTexture2D::WebTexture2D(Context* context, int width, int height) : WebRenderer(context)
  8. {
  9. ResourceCache* cache = GetSubsystem<ResourceCache>();
  10. texture_ = new Texture2D(context_);
  11. texture_->SetSize(width, height, Graphics::GetRGBAFormat(), TEXTURE_DYNAMIC);
  12. texture_->SetFilterMode(FILTER_NEAREST);
  13. material_ = new Material(context_);
  14. material_->SetTechnique(0, cache->GetResource<Technique>("Techniques/DiffUnlit.xml"));
  15. material_->SetTexture(TU_DIFFUSE, texture_);
  16. }
  17. WebTexture2D::~WebTexture2D()
  18. {
  19. }
  20. }