[QUOTE=Chandler;24672745]A resource file is something that ends in ".rc" and basically lists the type and filename of a resource (such as an icon)
here's a small example if you want a custom icon
[code]
1 ICON icon.ico
[/code]
You then number and name the path (relative to the RC file!) of each resource you would like embedded in your app or library. Add it to your visual studio project and it'll handle it for you (If you are using mingw, you'll need to run a tool called "windres" and output it to an object file, then link it in with the rest of your application)[/QUOTE]
Alright, thanks!
[QUOTE=MrBob1337;24672606]I need help with an odd problem concerning virtual functions. I am trying to implement a factory system in my rough game framework. I've already gotten a list of Entity pointers that called proper virtual Think() functions from the derived class, but for some a similar system for the factory (calling a method called Create()) always calls the base function. They are pointers, and I've used a identical way to call Think in the update function. What could be wrong? Do you need code or is my description sufficient?[/QUOTE]
Are you sure that Create indeed creates a derived class?
Can't think of any other reason. Posting the code won't be a bad idea :)
I'm pretty sure, here it is
Entity::Create
[cpp]
Entity * Entity::Create()
{
return new Entity(position.x,position.y,gameInstance->GetImgMgr()->GetResource(resName),gameInstance);
}
[/cpp]
TestEnt::Create
[cpp]
TestEnt * Create()
{
std::cout << "test ent create\n";
return new TestEnt(position.x,position.y,gameInstance->GetImgMgr()->GetResource(resName),gameInstance);
}
[/cpp]
I never get "test ent create" in the console, so it's not executing.
That's not TestEnt::Create. Create exists in the global namespace (at least in this snippet).
[QUOTE=DOG-GY;24672542]Holy shit! Thanks! Funny that I never even considered normals, colour, and all that other information. [/QUOTE]
No prob. :)
[QUOTE=ZeekyHBomb;24673206]That's not TestEnt::Create. Create exists in the global namespace (at least in this snippet).[/QUOTE]
Sorry, I forgot to mention I declared it inline. Still, when I split it between TestEnt.hpp and TestEnt.cpp, there was no difference.
[QUOTE=ROBO_DONUT;24673743]No prob. :)[/QUOTE]
Turns out the only other guy who has ever converted this format responded to my contact. He offered to share his source code and what he learned about the structure :buddy:
I'm excited to write my own converter. Maybe I'll even take it a step further with material info
How do I use tinxml to go to an element? This doesn't work:
[code]
character.ToElement(currentmap);
chracter >> maps.mapname;
[/code]
I've only ever used IPAddress.Any with TCPListener. Can you bind to a specific ip if the machine has multiple ips?
[QUOTE=high;24682696]I've only ever used IPAddress.Any with TCPListener. Can you bind to a specific ip if the machine has multiple ips?[/QUOTE]
You want [url=http://msdn.microsoft.com/en-us/library/system.net.ipaddress.parse.aspx]IPAddress.Parse()[/url]
[QUOTE=turb_;24682947]You want [url=http://msdn.microsoft.com/en-us/library/system.net.ipaddress.parse.aspx]IPAddress.Parse()[/url][/QUOTE]
I know that, I am just wondering if I put the ip of the network interfaces will it allow me to listen on the same port across the multiple ips?
Edit:
Actually IPAddress.Any makes sense. It binds across all the network interfaces I am assuming so if you have multiple ips you can connect to it via any ip.
I'm using a TcpClient, but when I try to connect to a socket that doesn't exist it doesn't do anything, I mean it doesn't throw a exception and it doesn't execute any further code :S
code :
[cpp]
private void Connect()
{
tcpClient = new TcpClient();
IPAddress ip = IPAddress.Parse(functions.GetIP());
while (!tcpClient.Connected)
{
tcpClient.Connect(ip, 3389);
Thread.Sleep(1000);
}
NetworkStream networkStream = tcpClient.GetStream();
StreamReader streamReader = new StreamReader(networkStream);
StreamWriter streamWriter = new StreamWriter(networkStream);
}
[/cpp]
tried using try/catch still the same
[QUOTE=MrBob1337;24673945]Sorry, I forgot to mention I declared it inline. Still, when I split it between TestEnt.hpp and TestEnt.cpp, there was no difference.[/QUOTE]
You shouldn't declare massive functions like these inline. Your compiler will probably refuse, anyway.
[QUOTE=high;24683021]Actually IPAddress.Any makes sense. It binds across all the network interfaces [B]I am assuming so if you have multiple ips you can connect to it via any ip.[/B][/QUOTE]
Yes, this should be exactly what it does.
[QUOTE=MrBob1337;24673945]Sorry, I forgot to mention I declared it inline. Still, when I split it between TestEnt.hpp and TestEnt.cpp, there was no difference.[/QUOTE]
Show the code of your factory.
I've got a group of vertices in 3D space that all lie on the same plane. I need to sort these vertices into either clockwise or anti-clockwise order. Can anyone recommend a good algorithm to implement?
Wouldn't you just take the center of these points (the average coordinates) and compare the angles of points?
Visualization:
[img]http://gyazo.com/d3f8b0a18f06121452c3a051c29986b2.png[/img]
[QUOTE=Overv;24687299]Wouldn't you just take the center of these points (the average coordinates) and compare the angles of points?
Visualization:
[img]http://gyazo.com/d3f8b0a18f06121452c3a051c29986b2.png[/img][/QUOTE]
I was thinking of using "graham scan" which is basically what you suggested. I've jut not yet worked out how to take the points and copy them onto a 2D plane for the graham scan. I suspect it involves using matrices but I know pretty much nothing about matrices.
Does tortoise support making notes as you go? Like I want to be able to note things as I edit them and then later when I commit it combines the notes.
[QUOTE=high;24689545]Does tortoise support making notes as you go? Like I want to be able to note things as I edit them and then later when I commit it combines the notes.[/QUOTE]
...What do you mean?
I believe you can load commit notes from a text file, so maybe you should just type them in a text editor or something as you go?
[QUOTE=high;24689545]Does tortoise support making notes as you go? Like I want to be able to note things as I edit them and then later when I commit it combines the notes.[/QUOTE]
What kind of source control are you using?
[QUOTE=gparent;24689589]What kind of source control are you using?[/QUOTE]
Probably SVN, IIRC it's the first in the Tortoise-series of GUIs.
Just check the diff when you commit. It should remind you what has changed.
[QUOTE=esalaka;24689600]Probably SVN, IIRC it's the first in the Tortoise-series of GUIs.[/QUOTE]
I don't really feel like guessing the one he's using out of the five different applications they have
EDIT: And I doubt SVN was the first, even though it's the most popular.
[QUOTE=gparent;24689622]I don't really feel like guessing the one he's using out of the five different applications they have[/QUOTE]
I think I've even heard him mention he's using SVN.
...Oh, sorry for this, go on with content.
[QUOTE=gparent;24689622]I don't really feel like guessing the one he's using out of the five different applications they have
EDIT: And I doubt SVN was the first, even though it's the most popular.[/QUOTE]
TortoiseCVS was the first, which is logical because CVS came before SVN.
[QUOTE=arienh4;24689750]TortoiseCVS was the first, which is logical because CVS came before SVN.[/QUOTE]
Yeah that's what I figured.
EDIT: But anyway my question was more relevant if he were to use Git or Mercurial, because then he could just use local commits and simply edit when pushing changes out.
This shader
[cpp]#version 110
uniform sampler2D textures[1];
uniform int texIndex;
varying vec2 texcoord;
void main() {
gl_FragColor = texture2D( textures[texIndex], texcoord );
}[/cpp]
is giving me this error
[code]Fragment info
-------------
0(10) : error C5208: Sampler needs to be a uniform (global or parameter to main)
, need to inline function or resolve conditional expression
(0) : fatal error C9999: unable to generate code for texture function.[/code]
What gives?
Why do you need an array for samplers? Can you even do that?
Well the tutorial I followed did a similar thing so yes you can.
I'm open to suggestions tho. How would you go about using more than one texture in the fragment shader? Is there something I'm missing?
Just don't use an array.
[url]http://www.lighthouse3d.com/opengl/glsl/index.php?textureMulti[/url]
Sorry, you need to Log In to post a reply to this thread.