All Blog Entries

All blog entries, ordered from most recent. Entry count: 960.

Pages: 1 2 3 ... 120 >

21:03
Sun
02
Mar 2014

Using Google Test in Visual C++ 2012

I was recently learning Google Test (Google C++ Testing Framework). It's a C++ library from Google (shared under new BSD license) to do unit testing, following xUnit convention.

As always with any library in C++, it's not that easy as just download the sources, compile and use it. Here are my experiences with making it work in Visual C++ 2012:

1. Visual Studio solution is already prepared in msvc/gtest.sln. You just need to confirm upgrading to new version and ignore report with warnings.

2. You only need "gtest" project. It compiles a static library. That's the way I decided to use it. Alternatively you could just include all library sources to your project.

3. The library uses tuple from new C++ that requires variadic templates. Visual C++ doesn't support this feature, so to make it compiling without errors, you need to globally define following macros (in project properties > C/C++ > Preprocessor > Preprocessor Definitions, in both Debug and Release configurations, in both library and your client project):

GTEST_USE_OWN_TR1_TUPLE=0
_VARIADIC_MAX=10

4. If your project uses different way of linking to the standard library than gtest, you will get linker errors like:

1>gtestd.lib(gtest-all.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value 'MDd_DynamicDebug' in MyTestApp.obj
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::_Container_base12(void)" (??0_Container_base12@std@@QAE@XZ) already defined in gtestd.lib(gtest-all.obj)
1>msvcprtd.lib(MSVCP110D.dll) : error LNK2005: "public: __thiscall std::_Container_base12::~_Container_base12(void)" (??1_Container_base12@std@@QAE@XZ) already defined in gtestd.lib(gtest-all.obj)
...

That's probable as default setting for new project is to link it dynamically, while gtest project links it statically. It should be same in both gtest and your project. To change it to linking dynamically, enter project properties > C/C++ > Code Generation > Runtime Library and choose Multi-threaded Debug DLL (for Debug) and Multi-threaded DLL (for Release).

After setting it up, usage of the library is very easy. You just need in your project:

1. Add "include" subdirectory to include directories.
2. #include <gtest/gtest.h>
3. Link with "msvc/gtest/Debug/gtestd.lib" (in Debug) and "msvc/gtest/Release/gtest.lib" (in Release).
4. Write your tests, like:

TEST(IntegerTest, Addition)
{
    EXPECT_EQ(4, 2 + 2);
    EXPECT_EQ(10, 3 + 7);
}

5. Write main function:

int main(int argc, char** argv)
{
    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}

I like this library - it's easy to learn and use while quite powerful. It's also well documented - the main documentation is: Primer, Advanced Guide, FAQ.

There is also a GUI application available, called Guitar (Google Unit Test Application Runner) or gtest-gbar, which allows running your testing application and browsing results in a window instead of console.

Comments (3) | Tags: c++ libraries testing | Author: Adam Sawicki | Share

22:21
Mon
24
Feb 2014

Game Programming Blogs

I use RSS/Atom to read news. It's a great technology because I can have news from many different websites displayed in a single browser and formatted in one style. I used desktop reader applications, then moved to Google Reader and after it has been closed, moved to The Old Reader. Now The Old Reader changes rules so that free account can have maximum 100 feeds. I had more than that because I used to add feeds from all the interesting blogs I came across over the years. I don't have enough time to read everything what's new in all of them, so today I've just exported the list of these blogs and I'd like to share it with you here. These are mostly developer blogs about game development, graphics programming (rendering) or just C++/native programming, geometry/math etc. Some of them are updated frequently and some left inactive for a long time. Some are written by professionals and some by amateurs. You can also find more such blogs and other websites under rendering tag in my Pinboard bookmarks. Here are my exported feeds:

Comments (3) | | Author: Adam Sawicki | Share

16:44
Sun
02
Feb 2014

Global Game Jam 2014

Last time I wrote about our game Ball-B, and today I'd like to say few words about the Global Game Jam in general. For those of you who don't know: It is a worldwide one-weekend event about making games. But it's not just a virtual event where people stay at home and communicate via the Internet. Different organizations around the world share their place so people come to meet and work together as teams. There were 6 sites in Poland. In Warsaw for example, PolyJam 2014 was organized by Poloygon interest group in Warsaw University of Technology. Our site in Gdańsk, called 3city Game Jam (see homepage, entry on globalgamejam.org, Facebook page), was in the office of gamedev studio Playsoft. It was the biggest site in Poland and - according to page Jam Sites by Size - 38th in the world our of 488 with 111 participants. And there was also a waitlist of those who didn't register on time because of limited capacity of the office!

Organizers encouraged us to use Chronolapse to record a time-lapse video from screenshots taken from our desktops in the background. That's an interesting program - I didn't know it before. Unfortunately it didn't work after I connected external monitor to my laptop (despite it claims it supports dual monitor), so finally I didn't use it. They also recorded a time-lapse video from all 48 hours in the office, but I guess it isn't posted on the Internet yet.

The theme this year was a sentence "We don't see things as they are, we see them as we are." It's so general it could be interpreted quite freely, but many games were about changing a point of view by e.g. switching between different types of characters or some references to psychology. In our site the event had a form of a competition. Voting was using the system just as it's usually done on Warsztat compos and IGK conference - everyone had to choose 3 games (except his own) and give one of them 3 points, one - 2 one - 1. My favourite games were:

  1. Thirst for Freedom. They made 2D game using Unity with isometric view and the map fitting the screen, divided into cells. Player is in a psychiatric hospital. He can change beween two characters - one has schizophrenia and sees the world as colourful, with rainbows and unicorns, while the second one has depression and sees everything as gray and sad. They see the same map differently so they have to collaborate to solve logical puzzles and go out of the map to the next level.
  2. Feel Colored. They also made 2D game in Unity. 3 people playing using 3 pads on same computer shoot each other on a 2D map, fitting the screen, with side view. The screen is divided into 3 colors that are constantly changing, rotating around the center. When player is in the range of his color, he is invincible to the bullets (or something like that). For me that was a very interesting and novel idea.
  3. identikit. They coded in C++ using their custom engine. What's most interesting though is that they used Occulus Rift and the Creative+Intel Color+Depth camera, so it is a virtual reality game. The game is about walking in corridors, waching and choosing paintings on walls. Choices made create psychological portrait of the player according to some psychological theory.

While the winners were:

  1. Get Some Dots. Made in Unity. The game is about shooting in a top-down view. Interesting idea here is that objects (including bullets) move only in the are that the player is facing. Everyting behind him is slowed down. The game is clearly inspired by SuperHot
  2. Thirst for Freedom - mentionel above.
  3. Our game :D

Comments (3) | Tags: competitions events ggj | Author: Adam Sawicki | Share

00:01
Thu
30
Jan 2014

Ball-B - Our Game at Global Game Jam 2014

Here is the game we made during this year's Global Game Jam. It's called Ball-B. The goal is to defend the base at the center of the arena. You are rolling a physically simulated ball (using arrow keys or WSAD) of one of 5 kinds, each one (except the green one) having a special ability activated with Space. ESC key shows menu.

The game is made in Unity, so it works on the web page (if you have Unity Web Player installed) and can be build for multiple desktop as well as mobile platforms.

Play Online

Windows Binary: Ball_B_Windows.zip (8.78 MB)

Source Code: Ball_B_Source.zip (20.4 MB)

See also Ball-B at globalgamejam.org

One week before the jam I decided to learn Unity a little bit instead of make a game using custom C++ technology, as I always did before. Arek, who is doing 2D graphics at work, also a week ago decided to learn making 3D graphics. So it was a new and interesting experience for both of us. We made our game in same team as last year, only without Klamacz (who now lives in Czech Rapublic and works in Bohemia Inteactive). Our roles were:

I was the only programmer in the team and I didn't try to be the leader of the team or a designer, so I could say the game was artist-driven - most of the time developed considering how things should look like. Which is a good approach. Of course not everything went right and there are many things we could have done better. But it was fun to participate. In the competition at our site we scored 3rd place.

Comments (7) | Tags: competitions events productions ggj | Author: Adam Sawicki | Share

12:40
Sat
18
Jan 2014

Global Game Jam 2014 - Next Weekend

Next weekend - 24-26 January 2014 - there will be next edition of Global Game Jam - probably the biggest game development competition in the world. Well, it's not actually a competition. But it's about creating games with given theme, in teams, in 48 hours. Any technology can be used - programming languages like C++, game engines like Unity. You can even make a board game!

May sites around the world host this event. Sites registered in Poland this year will be in: Łódź, Poznań, Cieszyn, Warszawa, Kraków and Gdańsk. The one in my city - Gdańsk - is called 3City Game Jam and it's organized by Playsoft Games in their office, just like the year before.

It's always fun to do something creative together, so I really encourage to leave the work earlier next Friday (or skip some lessons) and go spend that weekend programming/drawing/modelling/designing/drinking coffee and participating in this event. Last year we created a game called Octovirus :)

Comments (5) | Tags: events competitions ggj | Author: Adam Sawicki | Share

21:04
Fri
17
Jan 2014

CppDepend 4 Pro for Free

It looks that they've just released a new major version of CppDepend - great static code analysis tool for C++. What's New in CppDepend 4 page lists several improvements. What is more important though is that they've decided to give away Pro license for free to open source C/C++ contributors. They say:

To apply for this free license, Please make sure that you meet the following criteria:

I think it's worth trying to apply for that. See also my review of CppDepend.

Comments (7) | Tags: tools c++ | Author: Adam Sawicki | Share

19:03
Sat
14
Dec 2013

(PL) Pisząc kod natywny C/C++... - Prezentacja

Zapraszam do obejrzenia slajdów z mojej prezentacji zatytułowanej "Pisząc kod natywny C/C++, czyli nie taki diabeł straszny", którą pokazałem dzisiaj podczas targów Kariera Programisty.

Comments (1) | Tags: productions events | Author: Adam Sawicki | Share

17:06
Mon
11
Nov 2013

Silly Venture 2013 - My Photos

8-11 November 2013 there was another edition of Atari demoscene party - Silly Venture 2013. Click on the image to see my photos from this event (quite big gallery this time :)

Silly Venture 2013 - Photos

If I had to summarize the party in just one sentence, I'd say that even if you - just like me - have nothing to do with Atari computers and just like demoscene, it's definitely worth visiting Gdańsk in November to go to this party. This scene is big. There were total 113 compo entries this year! (graphics + music + intro + demo + game + wild, in many different categories, for different Atari platforms).

There is also:

Comments (14) | Tags: atari demoscene events | Author: Adam Sawicki | Share

Pages: 1 2 3 ... 120 >

STAT NO AD [Stat] [Admin] [STAT NO AD] [pub] [Mirror] Copyright © 2004-2013 Adam Sawicki
Copyright © 2004-2013 Adam Sawicki