• What do you need help with? V. 3.0
    4,884 replies, posted
1.1 I'm pretty sure It [i]was[/i] working earlier, but now it isn't. If I even tried gl_points it still wouldn't show the opengl drawings, just the sfml drawings.
I'm getting a nullpointerexception when I try to access my Laser List in my entitymanager class. [lua]public class EntityManager { static public List<Laser> lasers; }[/lua] I want to loop through and draw each Laser instance in the list, but I crash when I try to access [i]lasers[/i]. [editline]23rd June 2011[/editline] Here's the code from my RenderManager class: [lua] if(!EntityManager.lasers.isEmpty()) { for(Laser l : EntityManager.lasers) l.draw(); }[/lua]
You probably haven't actually created the list anywhere. [cpp]static public List<Laser> lasers = new List<Laser>();[/cpp]
Does anyone here have any experience with the Pygame module and Python? Me and my friend are trying to do rotation and we are so lost.
[QUOTE=DarKSunrise;30658686]You probably haven't actually created the list anywhere. [cpp]static public List<Laser> lasers = new List<Laser>();[/cpp][/QUOTE] [lua]Cannot instantiate the type List<Laser>[/lua] Sorry, I probably should have mentioned I'm using Java. Also, quoting original for new page! [QUOTE=Nigey Nige;30658607]I'm getting a nullpointerexception when I try to access my Laser List in my entitymanager class. [lua]public class EntityManager { static public List<Laser> lasers; }[/lua] I want to loop through and draw each Laser instance in the list, but I crash when I try to access [i]lasers[/i]. [editline]23rd June 2011[/editline] Here's the code from my RenderManager class: [lua] if(!EntityManager.lasers.isEmpty()) { for(Laser l : EntityManager.lasers) l.draw(); }[/lua][/QUOTE]
Well, then do new ArrayList or whatever List-implementation you see fit.
[QUOTE=ZeekyHBomb;30659936]Well, then do new ArrayList or whatever List-implementation you see fit.[/QUOTE] I facepalmed pretty hard when I realised List was an interface. Thanks.
does anybody here have experience with action script? I need to implement side scrolling to my game thing but i've no clue how. there were some tutorials i followed but when i tried to put code from one with code from another results weren't good
Hey guys, I've just started learning C#. I would use Visual Studio / Visual C#, but I've had problems with installation attempts in the past and they are now messed up beyond repair - I think my only option to actually be able to run either VS2008 or 2010 would be to format and start from scratch. Soooo, I'm using Notepad++ for the time being, just to set up something quickly for testing purposes. I've managed to use the NppExec plugin to compile files to an exe, but I'm stuck at using libraries. I'd like to have SFML up and running, but I.. don't know how. I'm on Windows 7 by the way. Can anybody help?
Seriously is there anybody I can add on steam/skype/msn who can help me get going with c++? Just someone I can bounce questions off of so I can learn by doing instead of reading boring tutorials. Anyone?
[QUOTE=chipset;30665630]Seriously is there anybody I can add on steam/skype/msn who can help me get going with c++? Just someone I can bounce questions off of so I can learn by doing instead of reading boring tutorials. Anyone?[/QUOTE] I don't mind helping out.
[QUOTE=MadPro119;30658809]Does anyone here have any experience with the Pygame module and Python? Me and my friend are trying to do rotation and we are so lost.[/QUOTE] [url]http://pygame.org/docs/ref/transform.html#pygame.transform.rotate[/url] If you expand the comments for it there's a few examples.
All of my opengl code is extremely deprecated. (almost entirely version 1.1) What do I do? Almost all tutorials online only teach deprecated code, and so that's what I'm best at.
[QUOTE=Cello;30664834]Hey guys, I've just started learning C#. I would use Visual Studio / Visual C#, but I've had problems with installation attempts in the past and they are now messed up beyond repair - I think my only option to actually be able to run either VS2008 or 2010 would be to format and start from scratch. Soooo, I'm using Notepad++ for the time being, just to set up something quickly for testing purposes. I've managed to use the NppExec plugin to compile files to an exe, but I'm stuck at using libraries. I'd like to have SFML up and running, but I.. don't know how. I'm on Windows 7 by the way. Can anybody help?[/QUOTE] You could download SharpDevelop. It's utter shit compared to Visual Studio, but it's atleast an IDE.
[QUOTE=Smashmaster;30682356]All of my opengl code is extremely deprecated. (almost entirely version 1.1) What do I do? Almost all tutorials online only teach deprecated code, and so that's what I'm best at.[/QUOTE] You could wait for open.gl to make its rounds?
[QUOTE=Smashmaster;30682356]All of my opengl code is extremely deprecated. (almost entirely version 1.1) What do I do? Almost all tutorials online only teach deprecated code, and so that's what I'm best at.[/QUOTE] [url]http://www.arcsynthesis.org/gltut/[/url] it's a decent guide for 3.3, textures haven't changed at all though, so he doesn't go over them, just glGenTextures, glActiveTexture, glBindTexture. Also when you start dealing with shaders and want to use a sampler2D, you don't pass the texture ID as a uniform, you call glBindTexture. Took me a while to find out and I don't think that tutorial goes over it.
[QUOTE=robmaister12;30683411][url]http://www.arcsynthesis.org/gltut/[/url] it's a decent guide for 3.3, textures haven't changed at all though, so he doesn't go over them, just glGenTextures, glActiveTexture, glBindTexture. Also when you start dealing with shaders and want to use a sampler2D, you don't pass the texture ID as a uniform, you call glBindTexture. Took me a while to find out and I don't think that tutorial goes over it.[/QUOTE] Thanks. Transitioning is going to be a pain, though. No more glBegin, no more glPushMatrix, no more glCopyTexSubImage2D. Now there's buffer objects for everything. EVERYTHING.
yeah, the transition is pretty painful, I also have a copy of the OpenGL superbible 5th ed. to help me figure out some things that don't make much sense with the few online tutorials on them. Once you do make the transition, you will realize how much quicker and more powerful OpenGL 3.3+ is. Also, I have a question of my own, anyone have a guide for handling multiple light sources using OpenGL? Also what exactly is the difference between forward and deferred lighting?
[QUOTE=Simspelaaja;30682747]You could download SharpDevelop. It's utter shit compared to Visual Studio, but it's atleast an IDE.[/QUOTE] Thanks for the recommendation, I've downloaded it but I'm not quite sure how to get started with linking SFML in.. do you have any experience with it?
[QUOTE=Cello;30688923]Thanks for the recommendation, I've downloaded it but I'm not quite sure how to get started with linking SFML in.. do you have any experience with it?[/QUOTE] Otherwise there's MonoDevelop. And you should be able to add the .NET libs to your references someplace.
What's a better alternative to a bunch of if statements(and system("cls"))? Here's my code: [cpp]#include "Methods.h" #include <iostream> #include <string> #include <Windows.h> using namespace std; int number1; int number2; int answer; string symbol; void init() { start: cout << "Welcome to the (not so) Pro Calculator made in C++" << endl << endl; cout << "Please enter the first number: "; cin >> number1; cout << endl; cout << "Now please enter your second number: "; cin >> number2; cout << endl; cout << "Now enter the mathematical symbol to be used: "; cin >> symbol; cin.get(); if (symbol == "+") { answer = number1 + number2; cout << number1 << "+" << number2 << "=" << answer; cin.get(); } else if(symbol == "-") { answer = number1 - number2; cout << number1 << "-" << number2 << "=" << answer; cin.get(); } else if(symbol == "*") { answer = number1 * number2; cout << number1 << "*" << number2 << "=" << answer; cin.get(); } else if(symbol == "/") { if (number2 == 0) { cout << "Unable to divide by 0!" << endl; cout << "Press enter to continue. (You can't break this program, asshole.)"; cin.get(); system("cls"); goto start; } answer = number1 / number2; cout << number1 << "/" << number2 << "=" << answer; cin.get(); } else { cout << "Unknown symbol!" << endl; cout << "Known symbols are '+''-''*''/'" << endl; cout << "Press enter to restart."; cin.get(); cin.get(); system("cls"); goto start; } }[/cpp]
[QUOTE=Biotic;30692700]What's a better alternative to a bunch of if statements(and system("cls"))? Here's my code: -snip-[/QUOTE] If you're only going to have a few statements like this, then you could use a switch statement. It doesn't offer performance benefits but is nicer to read. If you're going to have a lot of statements, you might want to use STL map instead, mapping the chars to function pointers.
Which version of the OpenGL SuperBible should I go for. The 4th or 5th version. Just wondering because of the reviews said that the 5th book explains their custom toolkit, and not OpenGL itself.
[QUOTE=Doritos_Man;30700178]Which version of the OpenGL SuperBible should I go for. The 4th or 5th version. Just wondering because of the reviews said that the 5th book explains their custom toolkit, and not OpenGL itself.[/QUOTE] Depends if you want to learn deprecated OpenGL (4th edition) or if you want to learn some of their toolkit and some non-deprecated OpenGL. It's only in the later chapters they start moving off GLTools.
[QUOTE=Chris220;30700601]Depends if you want to learn deprecated OpenGL (4th edition) or if you want to learn some of their toolkit and some non-deprecated OpenGL. It's only in the later chapters they start moving off GLTools.[/QUOTE] Oh I should defiantly get the 5th edition then
If I create a Class A. Then derive a Class B from A. If I have a pointer of type Class A and assign a pointer of type Class B to that pointer and I call delete on the pointer of type Class A, will it delete B as if I had called delete on a pointer of type Class B?
Only if you make the destructor of Class A virtual.
[QUOTE=NaturalDre;30701964]If I create a Class A. Then derive a Class B from A. If I have a pointer of type Class A and assign a pointer of type Class B to that pointer and I call delete on the pointer of type Class A, will it delete B as if I had called delete on a pointer of type Class B?[/QUOTE] Expanding a little on Overv's reply, if Class A's destructor is not declared virtual then you're only going to be deleting the Class A "part" of Class B (because you're calling Class A's destructor), leaving any extra stuff from Class B floating in memory.
Learning Multidimensional Array's, at the moment im defining what each int represents this way. [code] array[0, 0] = 1; array[1, 0] = 1; array[2, 0] = 1; array[3, 0] = 1; array[4, 0] = 1; array[5, 0] = 1; array[0, 1] = 1; array[1, 1] = 1; array[2, 1] = 1; array[3, 1] = 1; array[4, 1] = 1; array[5, 1] = 1; [/code] Is there a better way of doing this where i can could just do {1,1,1,3,4} for what each row is equal too?
[QUOTE=Jimmylaw;30705274]Learning Multidimensional Array's, at the moment im defining what each int represents this way. [code] array[0, 0] = 1; array[1, 0] = 1; array[2, 0] = 1; array[3, 0] = 1; array[4, 0] = 1; array[5, 0] = 1; array[0, 1] = 1; array[1, 1] = 1; array[2, 1] = 1; array[3, 1] = 1; array[4, 1] = 1; array[5, 1] = 1; [/code] Is there a better way of doing this where i can could just do {1,1,1,3,4} for what each row is equal too?[/QUOTE] blah = new Array[6,2]{ {1,1}, {1,1}, {1,1}, {1,1}, {1,1}, {1,1} } I think
Sorry, you need to Log In to post a reply to this thread.