/*\r
-* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+* Copyright 2013 Sveriges Television AB http://casparcg.com/\r
*\r
* This file is part of CasparCG (www.casparcg.com).\r
*\r
: executor_(L"ogl_device")\r
, pattern_(nullptr)\r
, attached_texture_(0)\r
+ , attached_fbo_(0)\r
, active_shader_(0)\r
, read_buffer_(0)\r
{\r
CASPAR_LOG(info) << L"OpenGL " << version();\r
\r
if(!GLEW_VERSION_3_0)\r
- CASPAR_LOG(warning) << "Missing OpenGL 3.0 support.";\r
+ BOOST_THROW_EXCEPTION(gl::ogl_exception() << msg_info("Your graphics card does not meet the minimum hardware requirements since it does not support OpenGL 3.0 or higher. CasparCG Server will not be able to continue."));\r
\r
- CASPAR_LOG(info) << L"Successfully initialized GLEW.";\r
-\r
glGenFramebuffers(1, &fbo_); \r
-\r
- CASPAR_LOG(debug) << "Created framebuffer.";\r
-\r
- glBindFramebuffer(GL_FRAMEBUFFER, fbo_);\r
-\r
+ \r
CASPAR_LOG(info) << L"Successfully initialized OpenGL Device.";\r
});\r
}\r
{ \r
if(attached_texture_ != texture.id())\r
{\r
+ if(attached_fbo_ != fbo_)\r
+ {\r
+ glBindFramebuffer(GL_FRAMEBUFFER, fbo_);\r
+ attached_fbo_ = fbo_;\r
+ }\r
+\r
GL(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + 0, GL_TEXTURE_2D, texture.id(), 0));\r
attached_texture_ = texture.id();\r
}\r