• What do you need help with? V. 3.0
    4,884 replies, posted
[QUOTE=esalaka;32541102]TBH at least I've been conditioned not to right-click on buttons. I just don't assume you can.[/QUOTE] [QUOTE=ROBO_DONUT;32541382]Yeah, right-clicking on buttons is unusual... and 'unusual' generally means 'bad' in UI design. Familiarity is one of the most important things.[/QUOTE] Agreed, however the "Buttons" are supposed to be squares in a game of minesweeper (this is for a class), so meeting UI design guidelines kinda goes out the window. Anyways, I realized I was being dense and subsequently cracked open my book and discovered how they did it. Apparently you can catch a right click through overriding the OnButtonUp() event.
-snip- Ugh just horrible code here, feel stupid now after looking at it.
I've been trying to complete a simple computer graphics assignment using ray tracing, and im having some trouble getting the lighting to work. [img_thumb]http://i53.tinypic.com/2e1r38o.png[/img_thumb] [img_thumb]http://i56.tinypic.com/2vcdobq.png[/img_thumb] The first picture is suppose to be just plain diffuse lighting using the Lambert Illumination formula, and the second picture is suppose to have specular highlights using the Phong illumination formula. But as you can see somewhere i've made a mistake. Although im not entirely sure where. I've uploaded the c# project folder if anyone feels like looking through it. Its not very well set out at the moment I've just converted it from python. [url]http://www.mediafire.com/?kgfdrv4l3t9qvx8[/url] Any help or thoughts on what is going wrong would be appreciated :D
I am trying to create an array of objects via a pointer, but the class the objects are a part of have a constructor that calls for a pointer to a render window (I'm using SFML) and I can't give the constructor parameters to the pointer. Here's the code: This is how a single instance of the class is normally initialized [cpp] Object myObject(App); [/cpp] The hard part is getting an array of them to work; normally one would go about doing this [cpp] Object *myObject(App) = new Object[10]; [/cpp] Because I have have defined a default constructor on Object, the myObject instance needs to have the (App) after it, which is a pointer to my render window. But apparently I can't pass the pointer to the constructor because it is a pointer to an array and you can't do that for some reason. Does anyone know how to get the pointer to the constructor of the myObject array?
That's not how you normally go about doing it. IIRC, you do: [cpp]Object *myObject = new Object[10](App);[/cpp] (switch the [10] and the (App) around if it doesn't work)
You can use [url=http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.10]placement new[/url] to separate the object construction from the memory allocation, so that you can specify constructor arguments for each object in the array. But that's an advanced feature, and easy to get wrong. Typically you'd use std::vector for this; it does tricks internally with placement new, allocating space ahead of time (its "capacity" value) and then copy-constructing objects into that space when you supply them later. But since std::vector constructs objects in its array by making copies of objects that you provide as arguments, the class that you're storing in the vector must have an accessible copy constructor. It may be best to just make a std::vector of pointers (or smart pointers, preferably), so that nothing has to be constructed in the array itself.
[code] facepunch.com Value was either too small or too large for an Int32. Value was 112 Value was either too small or too large for an Int32. Value was 117 Value was either too small or too large for an Int32. Value was 110 Value was either too small or too large for an Int32. Value was 99 Value was either too small or too large for an Int32. Value was 104 Value was either too small or too large for an Int32. Value was 46 Value was either too small or too large for an Int32. Value was 99 Value was either too small or too large for an Int32. Value was 111 Value was either too small or too large for an Int32. Value was 109 test Result: facerightyou [/code] Let me explain: for every letter the console reads, it converts it to an int. It will add that to a string. So the seed for all ints in the errors would be "112117110991044699111109". That way I can use a string as seed for random words chosen out of a wordlist. However, if it catches an OverflowException it will print the message + the value used. Why are those numbers too large or too small? Edit: Nevermind how could I be so dumb? I have overlooked that in the end I would change the string into one big Int32, and it is a very large number. AGH!
Our teacher gave us a code (had to type it in manually) and then see the output: Here's the code: [code] #include <stdio.h> #include <string.h> #include <stdlib.h> int main() { float myVar = 25.6789; printf("%7.4f\n", myVar); printf("%f\n", myVar); printf("%7.2f\n", myVar); printf("%-7.2f\n", myVar); printf("%07.2f\n", myVar); printf("%*.*f", 7, 2, myVar); printf("\n"); printf("%10.2e\n", myVar); printf("%12.4e\n", - myVar); printf("%-10.2e\n", myVar); printf("%e\n", myVar); printf("%8g\n", myVar); printf("%9.1G\n", myVar); printf("%e\n", myVar); printf("%f\n", myVar); printf("%g\n", myVar); printf("%E\n", myVar); printf("%G\n", myVar); printf("%t%3f\n", myVar); printf("%p\n", &myVar); return 0; } [/code] And here is the output I received: [code] 25.6789 25.678900 25.68 25.68 0025.68 25.68 2.57e+01 -2.5679e+01 2.57e+01 2.567890e+01 25.6789 3E+01 2.567890e+01 25.678900 25.6789 2.567890E+01 25.6789 %3f 0xbffffbe4 [/code] Is that right? Why is the second to last %3f? Does it have something to do with %t? (We are supposed to accept everything as is, even if it seems off, I just want to know why I get %3f).
I'm getting an AccessViolationException when calling GL.DeleteBuffers() with OpenTK. I searched around, but couldn't find any descriptions of situations where an AccessViolationException would be thrown. Can anyone help? [editline]30th September 2011[/editline] [QUOTE=Ziks;32557996]I'm getting an AccessViolationException when calling GL.DeleteBuffers() with OpenTK. I searched around, but couldn't find any descriptions of situations where an AccessViolationException would be thrown. Can anyone help?[/QUOTE] The problem may have been that it was being called by a different thread than the one which generated the buffers. I've moved it to the same thread and it appears to be fixed.
Hey dudes. I'm trying to connect to my website ([url]www.errur.com[/url]) using WinSock, but since it's hosted on a server cluster with a lot of other websites, the server is giving me a 404 because I have to specify which of the running servers it is that I want to connect to. Does any of you guys have much experience with this?
I'm trying to compile Ogre3D from the 1.7.3 source. I've been following [url=http://www.ogre3d.org/tikiwiki/CMake+Quick+Start+Guide]this tutorial[/url], and everything goes fine with CMake but when I try to compile the project file (IDE is Code::Blocks), I get this: [cpp]Using makefile: Makefile Execution of 'make.exe -s -f Makefile all' in 'G:\Samuka97\1. Aplications\5. Programming Software\IDE\CodeBlocks\Libraries\Ogre3D\Binary_1.7.3' failed. Nothing to be done. [/cpp] I think the problem here is that I don't have a make.exe file, but I never did have one. What do?
I guess you need MSYS, MinGW or Cygwin then.
Okay, so I am pretty programming illiterate(first time doing anything), and am trying to make a facepunch alt detector. I know what needs to be done, I am just unsure of how to go about doing it. It needs to record all members as you browse and the first half of their flagdog hash, and then compare all hashes to one another. If it finds a match, it would add the matching username to a little dropdown next to eventlog and report post. I'm willing to spend a decent amount of time learning JavaScript so I understand why the things that I would need to do, work.
[QUOTE=ZeekyHBomb;32564186]I guess you need MSYS, MinGW or Cygwin then.[/QUOTE] I've got the default installation of MinGW that comes with C::B, does that I mean I need to download MinGW separately for the make.exe file?
I was looking into the difference between std::string and std::wstring in terms of cross-platform development, and [url=http://stackoverflow.com/questions/402283/stdwstring-vs-stdstring]this stackoverflow question[/url] says you should basically always use string on linux and wstring on windows... but does it really matter? And if it does, can I just #define something so I won't need to deal with it? I don't think I could, because of the fundamental difference in types :/
[QUOTE=Dr Magnusson;32559620]Hey dudes. I'm trying to connect to my website ([url]www.errur.com[/url]) using WinSock, but since it's hosted on a server cluster with a lot of other websites, the server is giving me a 404 because I have to specify which of the running servers it is that I want to connect to.[/QUOTE] If you're talking about name-based virtual hosting, you have to include a "Host: www.errur.com" header line in your HTTP request, so that the server knows which virtual host to resolve the URL against. Without it, you get the server's "default" virtual host, which is something other than your site. The Host header is optional in HTTP 1.0 but mandatory in HTTP 1.1, btw.
[QUOTE=Wyzard;32565147]If you're talking about name-based virtual hosting, you have to include a "Host: www.errur.com" header line in your HTTP request, so that the server knows which virtual host to resolve the URL against. Without it, you get the server's "default" virtual host, which is something other than your site. The Host header is optional in HTTP 1.0 but mandatory in HTTP 1.1, btw.[/QUOTE] Thanks man, that's what I was missing :D
[QUOTE=Samuka97;32564348]I've got the default installation of MinGW that comes with C::B, does that I mean I need to download MinGW separately for the make.exe file?[/QUOTE] You should have make.exe then. Perhaps the installer didn't update the PATH variable; add the MinGW bin-directory to it. [QUOTE=mechanarchy;32564808]I was looking into the difference between std::string and std::wstring in terms of cross-platform development, and [url=http://stackoverflow.com/questions/402283/stdwstring-vs-stdstring]this stackoverflow question[/url] says you should basically always use string on linux and wstring on windows... but does it really matter? And if it does, can I just #define something so I won't need to deal with it? I don't think I could, because of the fundamental difference in types :/[/QUOTE] If you wanted to do that, I'd use typedef instead of #define. You will need a macro for string-creation though, to prefix them with L. Perhaps the C++11 Unicode additions also help in this matter.
[QUOTE=ZeekyHBomb;32569389]You should have make.exe then. Perhaps the installer didn't update the PATH variable; add the MinGW bin-directory to it.[/QUOTE] Already done it, but I don't have make.exe in the bin directory, or anywhere for that matter. [editline]1st October 2011[/editline] Okay, I redownloaded MinGW from the official site and now I have make.exe, but when I try to compile all it does is this: [cpp]-------------- Build: all in OGRE --------------- Using makefile: Makefile Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. G:\Samuka97\1. Aplications\5. Programming Software\IDE\CodeBlocks\Libraries\Ogre3D\Binary_1.7.3> Process terminated with status 1 (0 minutes, 1 seconds) 0 errors, 0 warnings[/cpp] Not very useful now is it.
We talking about std::string and all that? I've just worked it down to using ICU's UnicodeString (UTF-16) and converting Linux stuff from UTF-8 to UTF-16 using my handy dandy library that I've been babbling on for the past week.
Can you start the program in verbose mode (the -v option)?
[QUOTE=ZeekyHBomb;32569984]Can you start the program in verbose mode (the -v option)?[/QUOTE] From the CMD, this happens: [cpp]GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software, blah blah. This program built for i686-pe-msys C:\Users\Samuka97>[/cpp] Not sure how to change which one C::B runs though. [editline]1st October 2011[/editline] Okay, deleted and redownloaded everything (C::B, OgreSDK, CMake 2.8.3) and now when I hit Configure, I get this: [cpp](cc1.exe) The program can't start because libgmp-10.dll is missing from your computer. Try reinstalling the program to fix this problem.[/cpp] [editline]1st October 2011[/editline] Nevermind, I removed the ""s from the MinGW Bin path and now CMake is working. Gonna try compiling and come back with results. [editline]1st October 2011[/editline] Well, it just gets stuck saying this: [cpp]-------------- Build: all in OGRE --------------- Using makefile: Makefile Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. G:\Samuka97\1. Aplications\5. Programming Software\IDE\CodeBlocks\Libraries\Ogre3D\Binary_1.7.3>[/cpp] I left it running for a good 15 minutes and nothing happened. Is this normal? [editline]1st October 2011[/editline] Apparently it's not, make.exe just instantly finishes and does nothing, leaving me with that last line. What do?
[QUOTE=Samuka97;32570619]From the CMD, this happens: [cpp]GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software, blah blah. This program built for i686-pe-msys C:\Users\Samuka97>[/cpp] Not sure how to change which one C::B runs though. [editline]1st October 2011[/editline] Okay, deleted and redownloaded everything (C::B, OgreSDK, CMake 2.8.3) and now when I hit Configure, I get this: [cpp](cc1.exe) The program can't start because libgmp-10.dll is missing from your computer. Try reinstalling the program to fix this problem.[/cpp] [editline]1st October 2011[/editline] Nevermind, I removed the ""s from the MinGW Bin path and now CMake is working. Gonna try compiling and come back with results. [editline]1st October 2011[/editline] Well, it just gets stuck saying this: [cpp]-------------- Build: all in OGRE --------------- Using makefile: Makefile Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. G:\Samuka97\1. Aplications\5. Programming Software\IDE\CodeBlocks\Libraries\Ogre3D\Binary_1.7.3>[/cpp] I left it running for a good 15 minutes and nothing happened. Is this normal? [editline]1st October 2011[/editline] Apparently it's not, make.exe just instantly finishes and does nothing, leaving me with that last line. What do?[/QUOTE] Code::Blocks doesn't print the command it's executing?? I'm pretty sure C::B is invoking it wrong or something. GNU make simply doesn't do things like that.
I meant execute cmake with the -v option. Anyways, cmake should give you 'status reports' on how far it progressed. At least on my Linux it does. But perhaps it created some log-file?
[QUOTE=ZeekyHBomb;32571354]I meant execute cmake with the -v option. Anyways, cmake should give you 'status reports' on how far it progressed. At least on my Linux it does. But perhaps it created some log-file?[/QUOTE] [cpp]GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software, blah blah. This program built for i686-pe-msys C:\Users\Samuka97>[/cpp]
[QUOTE=Samuka97;32571613][cpp]GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software, blah blah. This program built for i686-pe-msys C:\Users\Samuka97>[/cpp][/QUOTE] So does it print the command or no? Because that could possibly be useful information to have.
Not just make -v, but execute cmake in the ogre directory for cmake -v . or cmake -v build or wherever the cmake-file is.
[QUOTE=ZeekyHBomb;32572099]Not just make -v, but execute cmake in the ogre directory for cmake -v . or cmake -v build or wherever the cmake-file is.[/QUOTE] What do you mean "execute for cmake -v"? I'm not too experienced with CMake, I just used it once before, and that was to compile SFML2.
That 'for' should have been 'as' or 'like'.
[QUOTE=ZeekyHBomb;32572625]That 'for' should have been 'as' or 'like'.[/QUOTE] Oh, you mean launch CMake from the CMD with -v? Does that work with cmake_gui too?
Sorry, you need to Log In to post a reply to this thread.