[omim] Removed obsolete files.

This commit is contained in:
Илья Гречухин 2015-12-22 11:18:16 +03:00
parent 23900d2b19
commit 2899c21804
5 changed files with 0 additions and 253 deletions

View file

@ -1,39 +0,0 @@
#pragma once
#include "RenderContext.hpp"
#include "std/shared_ptr.hpp"
#include "graphics/render_target.hpp"
@class CAEAGLLayer;
namespace iphone
{
class RenderBuffer : public graphics::RenderTarget
{
private:
unsigned int m_id;
shared_ptr<RenderContext> m_renderContext;
int m_width;
int m_height;
public:
RenderBuffer(shared_ptr<RenderContext> renderContext, CAEAGLLayer * layer);
RenderBuffer(shared_ptr<RenderContext> renderContext, int width, int height);
~RenderBuffer();
void makeCurrent();
unsigned int id() const;
void present();
unsigned width() const;
unsigned height() const;
void attachToFrameBuffer();
void detachFromFrameBuffer();
void coordMatrix(math::Matrix<float, 4, 4> & m);
};
}

View file

@ -1,98 +0,0 @@
#import <QuartzCore/CAEAGLLayer.h>
#include "RenderBuffer.hpp"
#include "graphics/opengl/opengl.hpp"
#include "graphics/coordinates.hpp"
namespace iphone
{
RenderBuffer::RenderBuffer(shared_ptr<RenderContext> renderContext, CAEAGLLayer * layer)
: m_renderContext(renderContext)
{
OGLCHECK(glGenRenderbuffersOES(1, &m_id));
makeCurrent();
BOOL res = [m_renderContext->getEAGLContext() renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:layer];
if (res == NO)
LOG(LINFO, ("renderbufferStorage:fromDrawable has failed!"));
OGLCHECK(glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &m_width));
OGLCHECK(glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &m_height));
}
RenderBuffer::RenderBuffer(shared_ptr<RenderContext> renderContext, int width, int height)
: m_renderContext(renderContext)
{
OGLCHECK(glGenRenderbuffersOES(1, &m_id));
makeCurrent();
m_width = width;
m_height = height;
OGLCHECK(glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_RGBA8_OES, m_width, m_height));
}
void RenderBuffer::makeCurrent()
{
OGLCHECK(glBindRenderbufferOES(GL_RENDERBUFFER_OES, m_id));
}
RenderBuffer::~RenderBuffer()
{
OGLCHECK(glDeleteRenderbuffersOES(1, &m_id));
}
unsigned int RenderBuffer::id() const
{
return m_id;
}
void RenderBuffer::present()
{
makeCurrent();
const int maxTryCount = 100;
int tryCount = 0;
while (!([m_renderContext->getEAGLContext() presentRenderbuffer:GL_RENDERBUFFER_OES])
&& (tryCount++ < maxTryCount));
if (tryCount == maxTryCount + 1)
NSLog(@"failed to present renderbuffer");
else if (tryCount != 0)
NSLog(@"renderBuffer was presented from %d try", tryCount);
}
unsigned RenderBuffer::width() const
{
return m_width;
}
unsigned RenderBuffer::height() const
{
return m_height;
}
void RenderBuffer::attachToFrameBuffer()
{
OGLCHECK(glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES,
GL_COLOR_ATTACHMENT0_OES,
GL_RENDERBUFFER_OES,
m_id));
}
void RenderBuffer::detachFromFrameBuffer()
{
OGLCHECK(glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES,
GL_COLOR_ATTACHMENT0_OES,
GL_RENDERBUFFER_OES,
0));
}
void RenderBuffer::coordMatrix(math::Matrix<float, 4, 4> & m)
{
graphics::getOrthoMatrix(m, 0, width(), height(), 0, -graphics::maxDepth, graphics::maxDepth);
}
}

View file

@ -1,32 +0,0 @@
#pragma once
#include <OpenGLES/EAGL.h>
#include <OpenGLES/ES1/gl.h>
#include <OpenGLES/ES1/glext.h>
#include "graphics/opengl/gl_render_context.hpp"
#include "std/shared_ptr.hpp"
namespace iphone
{
class RenderContext : public graphics::gl::RenderContext
{
private:
/// Pointer to render context.
EAGLContext * m_context;
public:
/// Create rendering context.
RenderContext();
/// Create shared render context.
RenderContext(RenderContext * renderContext);
/// Destroy render context
~RenderContext();
/// Make this rendering context current
void makeCurrent();
/// create a shared render context
graphics::RenderContext * createShared();
EAGLContext * getEAGLContext();
};
}

View file

@ -1,39 +0,0 @@
#include "RenderContext.hpp"
namespace iphone
{
RenderContext::RenderContext()
{
m_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
}
RenderContext::RenderContext(RenderContext * renderContext)
{
m_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:renderContext->m_context.sharegroup];
}
RenderContext::~RenderContext()
{
}
void RenderContext::makeCurrent()
{
[EAGLContext setCurrentContext:m_context];
}
graphics::RenderContext * RenderContext::createShared()
{
graphics::RenderContext * res = new RenderContext(this);
res->setResourceManager(resourceManager());
return res;
}
EAGLContext * RenderContext::getEAGLContext()
{
return m_context;
}
}

View file

@ -1,45 +0,0 @@
#pragma once
//#include "../qt_tstfrm/widgets.hpp"
/*#include "../map/qgl_render_context.hpp"
#include "graphics/resource_manager.hpp"
class Drawer;
class VideoTimer;
namespace graphics
{
namespace gl
{
class RenderContext;
}
}
namespace qt
{
/// Widget uses our graphics library for drawing.
class GLDrawWidget : public GLDrawWidgetT<Drawer>
{
typedef GLDrawWidgetT<Drawer> base_type;
shared_ptr<graphics::gl::RenderContext> m_renderContext;
protected:
shared_ptr<graphics::ResourceManager> m_resourceManager;
public:
typedef Drawer drawer_t;
GLDrawWidget(QWidget * pParent);
~GLDrawWidget();
shared_ptr<graphics::gl::RenderContext> const & renderContext();
shared_ptr<graphics::ResourceManager> const & resourceManager();
shared_ptr<drawer_t> const & GetDrawer() const;
protected:
virtual void initializeGL();
};
}*/