Index: trunk/nv/gl/gl_device.hh
===================================================================
--- trunk/nv/gl/gl_device.hh	(revision 38)
+++ trunk/nv/gl/gl_device.hh	(revision 38)
@@ -0,0 +1,33 @@
+// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+/**
+ * @file gl_device.hh
+ * @author Kornel Kisielewicz epyon@chaosforge.org
+ * @brief Device class
+ */
+
+#ifndef NV_GL_DEVICE_HH
+#define NV_GL_DEVICE_HH
+
+#include <nv/interface/device.hh>
+
+namespace nv
+{
+	class gl_device : public device
+	{
+	public:
+		gl_device();
+		virtual window* create_window( uint16 width, uint16 height );
+		virtual program* create_program( const string& vs_source, const string& fs_source );
+		virtual ~gl_device();
+	private:
+		const void* m_info;
+	};
+
+} // namespace nv
+
+
+#endif // NV_GL_DEVICE_HH
Index: trunk/nv/gl/gl_window.hh
===================================================================
--- trunk/nv/gl/gl_window.hh	(revision 38)
+++ trunk/nv/gl/gl_window.hh	(revision 38)
@@ -0,0 +1,37 @@
+// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+/**
+ * @file gl_window.hh
+ * @author Kornel Kisielewicz epyon@chaosforge.org
+ * @brief Window interface
+ */
+
+#ifndef NV_GL_WINDOW_HH
+#define NV_GL_WINDOW_HH
+
+#include <nv/interface/window.hh>
+
+namespace nv
+{
+
+	class gl_window : public window
+	{
+	public:
+		gl_window( uint16 width, uint16 height );
+		uint16 get_width() const;
+		uint16 get_height() const;
+		string get_title() const;
+		void set_title( const string& title );
+	private:
+		uint16 m_width;
+		uint16 m_height;
+		string m_title;
+		void*  m_screen;
+	};
+
+} // namespace nv
+
+#endif // NV_GL_WINDOW_HH
Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 38)
+++ trunk/src/gl/gl_device.cc	(revision 38)
@@ -0,0 +1,56 @@
+// Copyright (C) 2012-2013 Kornel Kisielewicz
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+
+#include "nv/gl/gl_device.hh"
+
+#include "nv/gl/gl_window.hh"
+#include "nv/gl/gl_program.hh"
+#include "nv/logging.hh"
+#include "nv/lib/sdl12.hh"
+
+using namespace nv;
+
+window* gl_device::create_window( uint16 width, uint16 height )
+{
+	return new gl_window( width, height );
+}
+
+gl_device::gl_device()
+{
+	nv::load_sdl_library();
+	m_info = NULL;
+
+	if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
+	{
+		NV_LOG( LOG_CRITICAL, "Video initialization failed: " << SDL_GetError( ) );
+		return; // TODO: Error report
+	}
+
+	m_info = SDL_GetVideoInfo( );
+
+	if ( !m_info )
+	{
+		NV_LOG( LOG_CRITICAL, "Video query failed: " << SDL_GetError( ) );
+		return; // TODO: Error report
+	}
+
+//	bpp = m_info->vfmt->BitsPerPixel;
+
+	SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
+	SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
+	SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
+	SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
+	SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
+}
+
+program* gl_device::create_program( const string& vs_source, const string& fs_source )
+{
+	return new gl_program( vs_source, fs_source );
+}
+
+
+gl_device::~gl_device()
+{
+	SDL_Quit();
+}
Index: trunk/src/gl/gl_window.cc
===================================================================
--- trunk/src/gl/gl_window.cc	(revision 38)
+++ trunk/src/gl/gl_window.cc	(revision 38)
@@ -0,0 +1,52 @@
+// Copyright (C) 2012-2013 Kornel Kisielewicz
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+
+#include "nv/gl/gl_window.hh"
+
+#include "nv/logging.hh"
+#include "nv/lib/gl.hh"
+#include "nv/lib/sdl12.hh"
+
+using namespace nv;
+
+gl_window::gl_window( uint16 width, uint16 height )
+	: m_width( width ), m_height( height ), m_title("NV Engine"), m_screen( nullptr )
+{
+	int flags = SDL_OPENGL;
+	
+	m_screen = SDL_SetVideoMode( width, height, 32, flags );
+	
+	if ( m_screen == 0 )
+	{
+		NV_LOG( LOG_CRITICAL, "Video mode set failed: " << SDL_GetError( ) );
+		return; // TODO: Error report
+	}
+
+	nv::load_gl_library();
+	NV_LOG( LOG_INFO, "OpenGL Vendor       : " << glGetString(GL_VENDOR) );
+	NV_LOG( LOG_INFO, "OpenGL Renderer     : " << glGetString(GL_RENDERER) );
+	NV_LOG( LOG_INFO, "OpenGL Version      : " << glGetString(GL_VERSION) );
+	NV_LOG( LOG_INFO, "OpenGL GLSL Version : " << glGetString(GL_SHADING_LANGUAGE_VERSION) );
+}
+
+uint16 gl_window::get_width() const
+{
+	return m_width;
+}
+
+uint16 gl_window::get_height() const
+{
+	return m_height;
+}
+
+string gl_window::get_title() const
+{
+	return m_title;
+}
+
+void gl_window::set_title( const string& title )
+{
+	SDL_WM_SetCaption( title.c_str(), title.c_str() );
+	m_title = title;
+}
