Thread: How to Add Buttons in a game in Visual Studio

  1. #1
    Registered User
    Join Date
    Dec 2017
    Posts
    3

    Unhappy How to Add Buttons in a game in Visual Studio

    Hey Guys,

    I have created a game, but i don't know how to add buttons and i have checked some forums where people has done the code but it doesn't work and i end up messing up my code again and again.
    I need a buttons menu:

    -Main Menu
    -New Game
    - Save Game
    - Load Game
    -Go back to Main Menu
    -Credits(puts my name that's it)
    -Instructions(This will show the users which keys to use, like a manual page)
    -Exit(This will quit the application)
    What will be the best code to make it work? Need Help with this.
    Attached Files Attached Files

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    35,952
    So are
    #include "cSDL2WNDManager.h"
    #include "cGame.h"
    part of some game development toolkit you've neglected to tell us anything about?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Dec 2017
    Posts
    3

    So i managed to fix the code in adding buttons

    I managed to add buttons so far but after adding them every time i build my game, it throws an Exception error, let me show you a picture of that as well when i build itAttachment 15303
    Attached Images Attached Images How to Add Buttons in a game in Visual Studio-error-jpg 
    Last edited by Ne0restw0w; 6 Days Ago at 12:55 PM.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    35,952
    So do you know what a null pointer is?

    The this pointer shouldn't be null in any normal circumstance.

    If you don't, then perhaps you need to practice your basic c++ skills.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Dec 2017
    Posts
    3

    Unhappy

    Quote Originally Posted by Salem View Post
    So do you know what a null pointer is?

    The this pointer shouldn't be null in any normal circumstance.

    If you don't, then perhaps you need to practice your basic c++ skills.
    so what should i change that NULL into? i m just being confused too much since i have to meet a deadline, earlier the program was working even with NULL pointer but since i added the buttons, i managed to fix it but then this null pointer is showing up every time i build my program. Need help asap so i fix this and make my program run.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to create .bat file in Visual C++? Ms Visual Studio 2010
    By rousse101 in forum Game Programming
    Replies: 0
    Last Post: 01-25-2015, 04:55 PM
  2. Replies: 2
    Last Post: 12-27-2012, 12:50 AM
  3. visual studio 6 and visual studio.net difference
    By gemini_shooter in forum Tech Board
    Replies: 5
    Last Post: 02-04-2006, 01:32 AM
  4. Buttons in visual studio .net
    By sql.scripter in forum Windows Programming
    Replies: 1
    Last Post: 05-07-2005, 05:31 AM
  5. Replies: 1
    Last Post: 05-26-2004, 09:59 AM

Tags for this Thread