[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] rev 2324 - trunk/src
From: |
Ingo Ruhnke |
Subject: |
[Pingus-CVS] rev 2324 - trunk/src |
Date: |
Sun, 09 May 2004 19:52:09 +0200 |
Author: grumbel
Date: 2004-05-09 19:52:08 +0200 (Sun, 09 May 2004)
New Revision: 2324
Added:
trunk/src/blitter_test.cxx
trunk/src/blitter_test.hxx
Log:
Added: trunk/src/blitter_test.cxx
===================================================================
--- trunk/src/blitter_test.cxx 2004-05-09 17:36:09 UTC (rev 2323)
+++ trunk/src/blitter_test.cxx 2004-05-09 17:52:08 UTC (rev 2324)
@@ -0,0 +1,74 @@
+// $Id$
+//
+// Pingus - A free Lemmings clone
+// Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#include <ClanLib/Core/System/system.h>
+#include <ClanLib/Display/surface.h>
+#include "pingus_resource.hxx"
+#include "timer.hxx"
+#include "blitter.hxx"
+#include "blitter_test.hxx"
+
+namespace Pingus {
+
+class BlitterTestImpl
+{
+public:
+ BlitterTestImpl() {}
+ void run()
+ {
+ //CL_Surface surf = PingusResource::load_surface("textures/stone",
"textures");
+ CL_Surface surf = PingusResource::load_surface("textures/greentex",
"textures");
+
+ CL_PixelBuffer buf(256, 256, 256*4, CL_PixelFormat::rgba8888);
+ CL_PixelBuffer data = surf.get_pixeldata();
+ Timer bench("Blit");
+ Blitter::put_surface(buf, data, 0, 0);
+ Blitter::fill_rect(buf, CL_Rect(-50, -50, 250, 250), CL_Color(255, 150,
50, 128));
+ Blitter::fill_rect(buf, CL_Rect(50, 50, 150, 150), CL_Color(255, 150, 50,
155));
+ bench.stop();
+
+ CL_Surface surf2(new CL_PixelBuffer(buf), true);
+
+ while(!CL_Keyboard::get_keycode(CL_KEY_ESCAPE))
+ {
+ CL_Display::clear(CL_Color(155, 0, 0));
+ surf.draw(0, 0);
+ surf2.draw(400, 0);
+
+ CL_Display::flip();
+ CL_System::keep_alive();
+ CL_System::sleep(100);
+ }
+ }
+};
+
+BlitterTest::BlitterTest()
+{
+ impl = new BlitterTestImpl();
+}
+
+void
+BlitterTest::run()
+{
+ impl->run();
+}
+
+} // namespace Pingus
+
+/* EOF */
Added: trunk/src/blitter_test.hxx
===================================================================
--- trunk/src/blitter_test.hxx 2004-05-09 17:36:09 UTC (rev 2323)
+++ trunk/src/blitter_test.hxx 2004-05-09 17:52:08 UTC (rev 2324)
@@ -0,0 +1,41 @@
+// $Id$
+//
+// Pingus - A free Lemmings clone
+// Copyright (C) 2002 Ingo Ruhnke <address@hidden>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#ifndef HEADER_BLITTER_TEST_HXX
+#define HEADER_BLITTER_TEST_HXX
+
+namespace Pingus {
+
+class BlitterTestImpl;
+
+/** */
+class BlitterTest
+{
+private:
+ BlitterTestImpl* impl;
+public:
+ BlitterTest();
+ void run();
+};
+
+} // namespace Pingus
+
+#endif
+
+/* EOF */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] rev 2324 - trunk/src,
Ingo Ruhnke <=