26
            
            votes
        
            
                
                Accepted
            
        
            
            
        
            
                24
            
            votes
        
            
                
                Accepted
            
        
            
            
        2048 with GUI in C
                    Well done. This is not a complete review, but instead a (short) list of possible improvements I found when I skimmed your code.
Documentation
First of all: thank you! It's great to have ...
                
            
       
        
            
                22
            
            votes
        
        
            
        Chess engine for chess without checks in C++
                    Here are some things that may help you improve your code.
Don't const qualify POD return values
The code includes this member function within ...
                
            
       
        
            
                21
            
            votes
        
            
                
                Accepted
            
        
            
            
        Pong game using SDL
                    Implementation
Is it necessary to put the whole game execution into the Game constructor? (This will cause problems if you ever decide to inherit from ...
                
            
       
        
            
                16
            
            votes
        
        
            
            
        Snake++ game (in C++ with SDL)
                    using namespace std; is a bad practice. I'm glad to see you didn't use it in the header. Better still to not to use it at all. Please see this post for more ...
                
            
       
        
            
                16
            
            votes
        
        
            
            
        A Pong Game using C++
                    Overall Observations
If I were a teacher I would give you an A+ for effort and about a B- for implementation.
From a design point of view try to separate the logic of the game as much as possible from ...
                
            
       
        
            
                14
            
            votes
        
            
                
                Accepted
            
        
            
            
        Sorting algorithm visualizer in C++ and SDL2
                    In all, this is a nice program.  In particular, it compiled and ran (almost) flawlessly on Linux, so keep up the good work on portability!  Here are some things that may help you improve your program.
...
                
            
       
        
            
                13
            
            votes
        
            
                
                Accepted
            
        
            
        SDL/C++ High-Low Guessing Game
                    Definitely not bad for a first attempt! Let's start at the top.
...
                
            
       
        
            
                11
            
            votes
        
        
        Chess engine for chess without checks in C++
                    The answers so far are good critiques of the code at a technical level, but optimizing performance of a chess engine is a separate topic. Without aggressive optimizations at the algorithmic level you ...
                
            
       
        
            
                9
            
            votes
        
        
            
            
        Snake++ game (in C++ with SDL)
                    Some additional points:
Avoid "God classes". Your Game class does absolutely everything. This makes it hard to see which member variables are used where, and is one ...
                
            
       
        
            
                9
            
            votes
        
        
        Chess engine for chess without checks in C++
                    Note: this is just a review of graphics.h and graphics.cpp.
Apply RAII consistently
I see you used ...
                
            
       
        
            
                8
            
            votes
        
            
                
                Accepted
            
        
            
            
        SDL2.0 Conway's Game Of Life
                    Turn your warnings on! I would always compile with -Wall -Wextra -pedantic -pedantic-errors :) Let's go through them:
...
                
            
       
        
            
                8
            
            votes
        
            
                
                Accepted
            
        
            
            
        Conway's Game of Life in C
                    General Observations
Initially I was very impressed because the file started with the declaration of 2 enums. All of the functions seem to follow the single responsibility principle and that is great! ...
                
            
       
        
            
                8
            
            votes
        
        
            
        Conway's Game of Life in C
                    Reduce number of tests.
An if in the tight loop is a performance killer. Since you test for cells[x][y].alive in ...
                
            
       
        
            
                8
            
            votes
        
            
                
                Accepted
            
        
            
            
        Modular synthesizer framework for C++
                    This was fun code to play with and to review.  I haven't played with a modular synth for about forty years.  Here are some things that may help you improve your code.
Consider hiding data
Right now ...
                
            
       
        
            
                7
            
            votes
        
            
                
                Accepted
            
        
            
            
        Simple game loop using SDL
                    Design
Single Responsibility Principle (SRP)
Your current design, while serving its purpose, is rather restricted regarding future development.
Game is trying to do ...
                
            
       
        
            
                7
            
            votes
        
        
            
            
        Chess engine for chess without checks in C++
                    Use the single responsibility principle.
Your board class stores a board state, evaluates it, runs the AI, provides a scoring function, stores game state, does profiling, supports undo, handles mouse ...
                
            
       
        
            
                6
            
            votes
        
            
                
                Accepted
            
        
            
        Pausable Timer Implementation for SDL in C
                    I don't see too much that I feel like complaining about.
Standard Types
In timer.h, you use Uint32. This is not a standard type. It comes from SDL, which in turn ...
                
            
       
        
            
                6
            
            votes
        
            
                
                Accepted
            
        
            
        Simple C++ SDL2 Wrapper for small game
                    Wrapping SDL_Surface like this to get automatic cleanup in the destructor is a good idea. However, the current implementation makes a few assumptions that aren't necessarily correct.
Surface Creation
...
                
            
       
        
            
                6
            
            votes
        
        
            
        Pong game using SDL
                    In addition to hoffmale's answer.
Don't use underscores to  to prefix variable as you risk naming collisions. If you wish to prefix member variables m_ is widely ...
                
            
       
        
            
                5
            
            votes
        
        
            
        Fluid Simulation with SDL
                    I won't comment on the things you already mentioned you are planning to implement in the future, except that as Ilya Popov already said, you can use ...
                
            
       
        
            
                5
            
            votes
        
        
            
            
        Pausable Timer Implementation for SDL in C
                    Update
After further usage, I did discover one issue with regard to usability. Once a Timer instance has been cancelled, it is no longer valid and should not be ...
                
            
       
        
            
                5
            
            votes
        
        
            
        SDL Simple Wrapper Library
                    Things that you can do differently
I don't think there is anything wrong with how you implemented the deleters, but there are two alternatives you could consider. First, you can create custom ...
                
            
       
        
            
                4
            
            votes
        
        
            
            
        2048 with GUI in C
                    Since the other reviews have already hit most points, I'll just mention a few not already covered.  
Avoid relative paths in #includes
Generally it's better to ...
                
            
       
        
            
                4
            
            votes
        
            
                
                Accepted
            
        
            
        TTF/SDL based class for text handling
                    Code:
Prefix the header guard with something unique (at least to the project) to prevent possible collisions. (e.g. MYPROJNAME_TEXT_H ).
...
                
            
       
        
            
                4
            
            votes
        
        
        C++/SDL2 Tic-Tac-Toe
                    But because the copy function for the LTexture class was deleted I
  would just get an error about referencing a deleted function. This
  resulted in me using the default copy function.
Right now your ...
                
            
       
        
            
                4
            
            votes
        
        
        Simple C++ SDL2 Wrapper for small game
                    #pragma once
Be aware that you are giving up portability here as this is, while common, a non-standard compiler extension. For nearly all applications, as long as ...
                
            
       
        
            
                4
            
            votes
        
        
            
        SDL Simple Wrapper Library
                    Design review
Wrapping SDL is not only a good idea, it is a great practice project for learning SDL and C++. Your take on it is unique and interesting, and might make for an interesting challenge, but ...
                
            
       
        
            
                4
            
            votes
        
            
                
                Accepted
            
        
            
            
        SDL3 Thread pool for fast cross-platform data parallelism
                    Allocate to the referenced object, not to the type.
A style issue, yet one that is easier to code right, review and maintain.
Rather than
...
                
            
       
        
            
                3
            
            votes
        
            
                
                Accepted
            
        
            
        C++ and SDL2: Snake implementation
                    This is pretty cool! Looks like a lot of fun. 🙂 I think your instincts are right about separating out the Snake from the ...
                
            
       
        Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sdl × 93c++ × 75
game × 19
c × 16
c++11 × 12
beginner × 6
object-oriented × 6
performance × 5
memory-management × 5
game-of-life × 4
snake-game × 4
c++14 × 3
event-handling × 3
collision × 3
algorithm × 2
sorting × 2
pointers × 2
animation × 2
simulation × 2
windows × 2
stream × 2
timer × 2
graphics × 2
ai × 2
chess × 2