• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=robmaister12;33938532]C# and winforms[/QUOTE] This. If you want to compile for multiple platforms, look at QT Creator (though I never used it myself)
[QUOTE=ief014;33938331]Here you go, guys. I've only built them as static libs, for Visual C++ 2010. Includes both debug and releases. This is a fairly new release of them. [url]http://filesmelt.com/dl/sfml2_vs2010_static.rar[/url] Oh wow. I didn't see that you want it for .NET. oops :v Here's the .NET binding of SMFL2: [url]http://filesmelt.com/dl/sfml2-dotnet_binding.rar[/url][/QUOTE] Dammit, I still can't get it to work.. Has anyone else had this problem? Whenever I try to make a new RenderWindow (or Window for that matter) the whole thing just hangs. Like it's going through an infinite loop in the constructor or something. The debugger just hangs on the line where I assign a new RenderWindow instance. After an hour of searching, I have seen about one hit with the same problem. I can't be the only one with this problem? Thank you for the package, though.
What is the simplest way to generate a tone using C++? I know about outputting \a but I need to be able to generate tones of different lengths. Any ideas?
[QUOTE=Armandur;33941471]What is the simplest way to generate a tone using C++? I know about outputting \a but I need to be able to generate tones of different lengths. Any ideas?[/QUOTE] I know in windows you can do this: [code] #include <windows.h> int main() { DWORD freq = 300, dur = 100; Beep(freq, dur); return 0; } [/code]
[QUOTE=ief014;33941506]I know in windows you can do this: [code] #include <windows.h> int main() { DWORD freq = 300, dur = 100; Beep(freq, dur); return 0; } [/code][/QUOTE] Thanks! Just what I neded :)
Is it possible to package a .jar file that executes in command prompt?
[QUOTE=Szwedo;33926434]What happens if a message is sent to an object, but that object does not implement that method? What is the next step after that? This is in Objective C, if that matters...[/QUOTE] Nothing happens, ObjectiveC kinda 'dispatches' messages to objects and they listen to see if any of the messages are relevant. The message will send correctly and be recieved by the object but nothing will happen. The idea being that you can just send messages to generic types and have them received without casting them (sort of).
In Lua using Love how do you view how much fps your are getting. Mine is being capped at 60. Is there a way to see the total amount? Also I made a simple particle system but the particle it emits is a 2x2 white pixel made in paint. I was just wondering if it is possible to not use a picture.
After my dad botched this program, why isn't it displaying? [url]http://pastebin.com/QwmGGMmU[/url]
you don't #include source files
yes i did
i didn't say you didn't, i said you don't.
Oh sorry for the misread, its late
How to convert this one in Java? [code] static char Map[20][21] = { "********************", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "********************" }; [/code] All I know that is char[][] Map = new char[20][21];
[csharp] public static char[][] Map = { "******".toCharArray(), "* *".toCharArray(), ... }; [/csharp] [editline]29th December 2011[/editline] or instead of the string.toCharArray, you could just build each array out of a char array (not strings in Java AFAIK) "{'*', '*', ... }
Or just string arrays: [csharp] static public string Map[] = { "********************", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "* *", "********************" }; [/csharp]
This is how I've always done it in C#, not sure if its efficient or not but it works fine. [csharp] MapArray = new char[x, y]; for (int i = 0; i < x; i++) { for (int o = 0; o < y; o++) { MapArray[i, o] = '*'; } } [/csharp]
[QUOTE=reevezy67;33949175]This is how I've always done it in C#, not sure if its efficient or not but it works fine. [csharp] MapArray = new char[x, y]; for (int i = 0; i < x; i++) { for (int o = 0; o < y; o++) { MapArray[i, o] = '*'; } } [/csharp][/QUOTE] Wouldn't that fill the entire array though, rather than only the borders?
I have a style question: Do you guys place your braces like this: [code] if(blah blah){ dostuff(); } [/code] or like this [code] if(blah blah) { dostuff(); } [/code] ?
The first one, not that I reckon there's much wrong with the second way though.
[QUOTE=horsedrowner;33949212]Wouldn't that fill the entire array though, rather than only the borders?[/QUOTE] Ah you are right, bad reading on my part. [editline]30th December 2011[/editline] Anyway, does anyone know any resources or the theory behind the lighting in a tile based rogue clone. I was thinking it would work via some type of path finding but I haven't got much experience in that area.
[QUOTE=DoctorSalt;33950081]I have a style question: Do you guys place your braces like this: [code] if(blah blah){ dostuff(); } [/code] or like this [code] if(blah blah) { dostuff(); } [/code] ?[/QUOTE] The second one, because it makes it much easier to match up braces visually. When I first began coding in highschool I liked the first better, but eventually grew to prefer the other once I realized ultra compact code is harder to read later.
Trying to call a Lua script from C++. I've tried just about every permutation of every #include and extern statement and every command line option. The closest I've gotten is: [CODE] extern "C" { #include <lua5.1/lua.h> #include <lua5.1/lualib.h> #include <lua5.1/lauxlib.h> } int main() { lua_State *L = lua_open(); luaopen_base(L); luaopen_table(L); luaopen_io(L); luaopen_string(L); luaopen_math(L); return 0; }[/CODE] [CODE]eudoxia@desktop:~/lua_test$ g++ below.cpp -llua5.1 eudoxia@desktop:~/lua_test$ ./a.out PANIC: unprotected error in call to Lua API (no calling environment) eudoxia@desktop:~/lua_test$[/CODE]
[QUOTE=Eudoxia;33950497]Trying to call a Lua script from C++. I've tried just about every permutation of every #include and extern statement and every command line option. The closest I've gotten is: -snip-[/QUOTE] You are writing code for the Lua 5.0 API but using the 5.1 API. The problem is that the the luaopen_* functions must always be called with lua_call now. If you want all of the standard library, you can use the auxiliary function luaL_openlibs (you don't lua_call this, you call it directly). Also, lua_open has been deprecated. Use luaL_newstate instead.
-snip-
[QUOTE=reevezy67;33949175]This is how I've always done it in C#, not sure if its efficient or not but it works fine. [csharp] MapArray = new char[x, y]; for (int i = 0; i < x; i++) { for (int o = 0; o < y; o++) { MapArray[i, o] = '*'; } } [/csharp][/QUOTE] [QUOTE=horsedrowner;33949212]Wouldn't that fill the entire array though, rather than only the borders?[/QUOTE] then just [csharp] MapArray = new char[x, y]; for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { if (i == 0 || j == 0 || i == x || j == y) MapArray[i][j] = '*'; else MapArray[i, j] = ' '; } } [/csharp] or something
[QUOTE=swift and shift;33945772]i didn't say you didn't, i said you don't.[/QUOTE] I removed it, now it's giving me undefined references to the functions in them.
[QUOTE=Meatpuppet;33952378]I removed it, now it's giving me undefined references to the functions in them.[/QUOTE] Put all of the source file names in the command, not just the main one.
[QUOTE=jA_cOp;33951319]You are writing code for the Lua 5.0 API but using the 5.1 API. The problem is that the the luaopen_* functions must always be called with lua_call now. If you want all of the standard library, you can use the auxiliary function luaL_openlibs (you don't lua_call this, you call it directly). Also, lua_open has been deprecated. Use luaL_newstate instead.[/QUOTE] It works now, thanks. I figured the problem was something like that, but the code I was using generally didn't say what version it was.
[QUOTE=BlkDucky;33951540]then just [csharp] MapArray = new char[x, y]; for (int i = 0; i < x; i++) { for (int j = 0; j < y; j++) { if (i == 0 || j == 0 || i == x || j == y) MapArray[i][j] = '*'; else MapArray[i, j] = ' '; } } [/csharp] or something[/QUOTE] That doesn't work! i is never equal to x and j is never equal to y. It should be "i==0 || j==0 || i==x-1 || j==y-1" instead.
Sorry, you need to Log In to post a reply to this thread.