Jump to content
  • Advertisement

workaround

Member
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

222 Neutral

About workaround

  • Rank
    Member
  1. Code should look like this   class Object { public: std::string sprite; int x, y, z; };   std::vector<Object*> vObjects; while(myfile.good()) {     Object* pObject = new Object;          myfile >> pObject->name;     myfile >> pObject->x;     myfile >> pObject->y;     myfile >> pObject->z;          vObjects.push_back(pObject); }
  2. At this time I want something simple. Juliean gave something I think will work. Once I get this working I will consider something like JSON.
  3. I'm interested in making a level maker program. I need to be able to read specific data from that file and convert it to strings and ints.   file.txt // string sprite, int x, int y, int z tree1 40 30 1 tree2 50 35 2 I need to convert each string to proper variable using a space(I could change it to anything at this point). #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream myfile ("file.txt"); int linnum=0; char c; while (myfile.good()) { c = myfile.get(); if (c=='\n')linnum++; } myfile.close(); cout<<linnum<<endl; return 0; } So I want it in an array. So I made this to get the number of lines for the array. I need an array that can hold a sting and three ints.
  4. I heard that some people working with IR and virtual reality filled a gym with IR beams.   You could also use cameras and require the players to wear something type of green screen clothing. Using special clothing required less equipment to test. Green screens are used in movies all the time to be something that can be tracked by the camera so it can be replaced by Computer Graphics... You just need good lighting but this might not mater too much cause you are just going to be tracking and not video editing
  5. workaround

    Make money from my game

    It looks like the writer of the question might have been talking about how do you sell a game in general.   1. Build own store: You could setup a website and process transactions yourself which is around 5-7% of the price going to banking transactions 2: Use other services: I'm assuming it is a PC game cause you should have an idea of who to talk to if you made a game for a console. You can use gog.com or store.steampowered.com. Most selling service stores will take 20-30% of the profit for handling payments. The advantage of using  this is that you don't need to worry about keeping up with security standards which are required when dealing with peoples personal information.
  6. workaround

    Setting up CMake for SDL-GL

    All this information about cmake is very helpful. Thanks for all the information especially since I just started using cmake.
  7. workaround

    Setting up CMake for SDL-GL

    That does not help my problem. It looks like nothing is made for SOIL.
  8. workaround

    Setting up CMake for SDL-GL

    That is correct. I still have a problem with SOIL.   I have tried so many things even spelling it out the acronym. undefined reference to 'SOIL_load_image' undefined reference to 'SOIL_free_image_data' collect2:error:ld returned 1 exit status The above are the only SOIL(Simple OpenGL Image Loader) that I use.  
  9. project(NAME) cmake_minimum_required(VERSION 2.8) aux_source_directory(. SRC_LIST) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") add_executable(${PROJECT_NAME} ${SRC_LIST}) INCLUDE(FindPkgConfig) INCLUDE(FindOpenGL REQUIRED) INCLUDE(FindGLEW REQUIRED) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR}) pkg_search_module(SDL2 REQUIRED sdl2) target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES} ${SOIL_LIBRARIES} ${GL_LIBRARIES} ${GLEW_LIBRARIES}) I'm making a CMakeLists.txt file for making a openGL game using SDL for window management, glm for math. GLEW, and SOIL for images.   I'm getting errors Undefined reference to symbol 'glBlendFunc' error adding symbols: DSO missing from command line collect2: error: Id returned 1 exit status glClear becomes the next problem if I remove glBlendFunc.   This code works with gcc.   Edit what I did to get things working: project(DIA) cmake_minimum_required(VERSION 2.8) aux_source_directory(. SRC_LIST) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") add_executable(${PROJECT_NAME} ${SRC_LIST}) INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPkgConfig) INCLUDE(FindOpenGL REQUIRED) INCLUDE(FindGLEW REQUIRED) INCLUDE(FindSDL REQUIRED) FIND_PATH( SOIL_INCLUDE_DIRS SOIL.h PATH_SUFFIXES SOIL ) FIND_LIBRARY( SOIL_LIBRARIES SOIL) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${GLEW_INCLUDE_DIR}) pkg_search_module(SDL2 REQUIRED sdl2) target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES} ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES} ${SOIL_LIBRARIES})
  10. workaround

    Making a game in OpenGL and SDL?

      That is very helpful. Now because I'm using glm should I change the value of glm::lookat?
  11. workaround

    Making a game in OpenGL and SDL?

    What do I need to recode if my objects. My objects are all boxes. Some boxes are bigger. I have codes all the verts in if statements so I can pick one. I'm using SOIL to load my images/textures.   but what if I have 10 Trees that are the exact same tree just in different locations. How should I deal with this.
  12. workaround

    Making a game in OpenGL and SDL?

    That second part of what frob said. I need more detail on that.   How do people make a game engine to load multiple objects without coding each object in. I want to make a class to do this.
  13. I want to know re-sending my vertexes for my objects each frame makes sense. I'm thinking of making a game where the camera is still and objects move around it to give the effect you are moving thought the world. If it makes sense to do this or should I have a camera that moves.   I think that it is not much of a difference of GPU and CPU usage because if the camera moves it still needs to use all the vertexes positions to draw the image.
  14. Some thing to know. The image of a tree on the cube only comes out like that with that specific export of the drawing from my program. All others would come out with no color. Now that I have added alpha to SOIL they all have color but now a white background.
  15. The open.gl tutorials use soil so I just add A to all the RGB calls. This now gives me an image with white background because white is the base color 1.0f for all rgb.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!