Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

109 Neutral

About Ryan_Burnside

  • Rank
  1. Hello fellow programmers! After some thought I've decided that I'd like to launch a little project. I've created a different forum where the focus is on presentation of effects and amusements platform independent pseudocode. The core concept of my forum is presentation of classic effects in such a way that any programmer can implement them in any language. A C++ programmer need not struggle through Lisp nor a Python programmer get lost in x86 assembly language to learn a neat effect. The effects and amusements we focus on are mostly static raster effects such as fractals. That said we also have some cellular automaton examples that are meant to be enjoyed in real time. My moderators and hand selected members have done a great job laying down some examples for you to try. We look forward to more user contributed pseudocode. It is not about compiled works, it is about giving other programmers some recreations to try on a lazy afternoon. Please join if you want to contribute! (The URL is a bit hard to remember, so do bookmark and come back ) We do have an approval system to avoid bots so please give me a few hours to approve you (I do actually sleep sometimes) http://forums.pixeloutlaw.smakweb.com/index.php <- Ultimate Effects Universe Forum Here is one such example we cover "Attractors" Learn to make such things in your language today!
  2. Ryan_Burnside

    [C++] Execute from command line with path to file

    Thank you very much. I intend to use this file path as an argument for loading files. I seem to recall somebody mentioning that C++ cannot see outside of the current directory the application is running from. This might be a problem I guess even though I can pass an absolute path via the command line to the starting program Is this true?
  3. Hello, I'm trying to make a terminal based program that will take a path to a file as a parameter. How can this be done with C++? Something like: run my_program <pathname parameter here>
  4. Ryan_Burnside

    Code::Blocks, CImg

    Thank you SO much! Working now! What is a general rule of thumb process when adding a new library to a project? It seems that no two libraries share exactly the same steps...
  5. Ryan_Burnside

    The first step for graphics in C++?

    Well you can't expect C++ to have any functions to draw and create graphics beyond simple text based visuals (terminal output). C++ is a powerful language that was developed for very low level work. However, it is quite popular and people have written libraries that allow it to work with hardware to render graphics. As far as I know there is really no way around adding a library like SFML, SDL, or Allegro. You can probably play a bit with text adventures with primitive ASCII graphics if you want to just get something visual working. I'd use a 2D screen buffer of chars to make ASCII graphics and pictures. C++ is a very lean and fast language that was made for low level work. We can adapt it to other needs however like rendering graphics, sounds, and joystick polling. In this way, C++ works like glue, by binding components together so that we can use elements and functions from libraries.
  6. Ryan_Burnside

    Code::Blocks, CImg

    Hello, Recently I've downloaded Code::Blocks because I'd like to make projects that are open and multi platform. I want to make a very simple program that uses the C image liberary CImg. The whole library is included in a single header called :CImg.h". I've included this in the same folder as my project I wish to work on. I have also included the header file in my source code for the project. The minimum code contained in my main.cpp file looks like this: #include "CImg.h" using namespace cimg_library; int main() { const unsigned char purple[] = { 255,0,255 }; CImg<unsigned char>(640,400,1,3,0).draw_text(100,100,"Hello World",purple).display("My first CImg code"); return 0; } Upon compiling I get the following errors: obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'| obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'| obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'| obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'| obj\Release\main.o:main.cpp|| undefined reference to `SetDIBitsToDevice@48'| obj\Release\main.o:main.cpp|| more undefined references to `SetDIBitsToDevice@48' follow| ||=== Build finished: 6 errors, 0 warnings ===| I'm not used to really working much with external dependencies with Code::Blocks and I've not ventured beyond playing with SFML (which I got working following a tutorial). I'm working on Windows 7 at the moment if that is of any help. I'm not advanced with C++ but I have an understanding of the core library. Adding dependent libraries is really a headache it seems...
  7. Ryan_Burnside

    [C++] STL Vector element deletion with iteration

    Thanks for the prompt help. I will implement this now and get back to you if I cannot get it working. Thanks again!
  8. I've come to love the STL and come things still confuse me a bit. I'm storing instances of a Particle in a vector. Each particle eventually has a boolean dead value set to true and it needs to be removed. How can I remove all Particles with their dead value set to true? I tried to iterate through the list and call the remove() command on the iterator but it throws an exception. The Particle instances are stored in a vector called particle_vector. vector<Particle>::iterator iter; for(iter = particle_vector.begin(); iter != particle_vector.end(); iter++) { iter->update(); if(iter->dead == true) { particle_vector.erase(iter); } }
  9. I have a basic rectangle to rectangle collision check working. That was trivial. Here is the difficult part for me. I have a player that collides with rectangular "rocks". The player needs to be reset when he enters a rock. The player has a direction and a speed as he hits the rocks. When a collision is detected I need the player to jump to snap to the proper position as if he never hit the rock. A very crude method to reset the player would reverse the direction and travel backwards a pixel per cycle until he was no longer inside the rock, that has plenty of wasted iterations however. This is making me frusterated because since the early days of video games programmers have been creating solid objects and dealing with collisions. I can tell that they have collided but how do I put the player back into the proper position outside the rock?
  10. Hello, I've currently been toying quite a bit with the idea of a console window text based game. My target platforms will be the Windows PC and also Linux PC. Currently I have a 2d array that works as a sort of screen buffer. string the_buffer[x][y]; // string buffer lets us use either unicode or ascii single characters between OSs for(char y = 0; y < 20; y++) { for(char x = 0; x < 64; x++) { // add string value to current line cout << the_buffer[x][y]; } // move to next line cout << endl; } Now I have everything drawing to the screen but I would like a platform independent way to keep blitting the buffer's contents to the screen. Also there must be some form of verticle synchronization so the screen does not have flashing and missing lines as the buffer refreshes. Also, I ask the veterans of character based games, what do I need to look out for when making a cross platform solution with the console window?
  11. Ryan_Burnside

    [C++] Where to load global images/sprites?

    Thanks for all the help guys. This has given quite a bit to put into practice. I'm going to implement these concepts the next time I get a break in my University schedule.
  12. Ryan_Burnside

    [C++] Where to load global images/sprites?

    Thanks, I asked Dan to send me an example. Now just to get my code strait. Considering my options here, how do I define a global variable? Where does it get defined inside the class or externally? I'm unsure of the syntax as they have not covered them in my classes too extensively. I understand that globals are usually in bad form, but this is a small project which will probably not have reusable objects.
  13. Hello, first post on this community. I've started learning more and more about C++ in college and decided to finally sit down and try to put some of these concepts together from what I ahve learned in class. My question is this, when creating a basic ship Class (for the player of an arcade game) who owns the sprite? I don't really want each ship to own a copy of the same sprite as that seems redundatn. Instead I think I would like to make some of the resources global so only one sprite needs to be loaded into memory. How are shared resources loaded in C++ usually? I'm using SFML which allows me to create sprites. The big question, if many ships share the same sprite how do they access the loaded sprite? Do I make the sprite a constant global variable in the definition of the Ship class? I've included the SFML library inside my ship header file so I can use functions from that library. Now should all resources used by the Ship class also be loaded in the definition of the Ship? If so how is this best done. I'm used to using Blitzmax and C++ gives the programmer many many options on how to do things.
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!