I've heard performance takes a serious hit when it comes to using immediate mode (a la glBegin() and glEnd()) versus using display lists. If I'm rendering geometry that moves, changes textures, and has dynamic lighting, can I still use display lists?
|
|
# ¿ Feb 17, 2008 23:15 |
|
|
# ¿ May 6, 2024 02:43 |
Thanks for the responses.kewlpc posted:Yeah, display lists are faster. I did not know this. I thought display lists were faster because they were 'compiled' and stored.
|
|
# ¿ Feb 18, 2008 03:42 |
I'm looking for an image library for C++ that meets the following criteria: 1) Read/Write .jpg, .gif, .png 2) Simple, consistent data types for images with direct access to pixel data, a la [x][y][rgb]. 3) Can be easily linked into an executable or have minimal external dependencies. 4) Tiny I've tried: cImg -- Too big. Does everything I need and too much more. opencv -- Again, too big. Also really hard to get pixel access. Kinda' convoluted interface. Any recommendations?
|
|
# ¿ Nov 12, 2008 04:32 |
litghost posted:Can't you just use libjpeg and libpng? I forgot about that. Probably. Smackbilly posted:Take a look at Magick++. This looks good. I'll try it.
|
|
# ¿ Nov 13, 2008 06:20 |
Why is mmap always returning -1:code:
EDIT: Added MODE data. Still no go. Jo fucked around with this message at 08:41 on Nov 21, 2008 |
|
# ¿ Nov 21, 2008 08:28 |
ShoulderDaemon posted:Perhaps you could print out the actual error? errno exists for a reason, you know. Ehr, yes. Right. It's errno 9. Bad file descriptor. EDIT: It's late, I'm probably making a stupid error opening the file or something. Thank you for your response at this ungodly hour, ShoulderDaemon. server1.rpc has permissions hosed up. Jo fucked around with this message at 09:09 on Nov 21, 2008 |
|
# ¿ Nov 21, 2008 09:00 |
Vanadium posted:Ever tried out strace? Never heard of it before. Looks really neat, but it's not installed on the dev server and I don't have administrative privileges.
|
|
# ¿ Nov 22, 2008 21:17 |
I'm getting a sigabrt on a delete. I know it's a memory management problem, but I don't see why...code:
|
|
# ¿ Dec 6, 2008 08:40 |
ultra-inquisitor posted:Is runGaussian3x3 in a different DLL, or are you using new[] to allocate the memory? Right now it's just new[]. Avenging Dentist posted:Why wouldn't you just use a smart pointer there? vv Guess I'll have to, but I still don't see why it doesn't work. Perhaps I have a horrid and fundamental misconception about pointers. code:
EDIT: I got rid of 'delete gaussian' at the end of the function and the program works. I'm not sure why, exactly, and I'm probably leaking memory; it terminates shortly after returning from the function, so I'm not terribly worried. EDIT 2: Only for you, Otto Skorzeny. A typo in the gaussian function made this: Jo fucked around with this message at 18:40 on Dec 6, 2008 |
|
# ¿ Dec 6, 2008 18:27 |
Otto Skorzeny posted:If you have valgrind you can check whether you're leaking memory pretty easily (as long as your program doesn't have a long run time as-is). Yup, it would seem a leak is present. ==17230== LEAK SUMMARY: ==17230== definitely lost: 2,718,128 bytes in 16 blocks.
|
|
# ¿ Dec 6, 2008 18:50 |
Vanadium posted:If you allocate memory with new[], you have to deallocate it with delete[]. Yes, I'm readily aware, but when I call delete[], I get a sigabrt. EDIT: Aaah, I see what you're saying. No, it's just a simple Image * gaussian = new Image( blahblah ). The delete still delete, in this case, no? Jo fucked around with this message at 19:36 on Dec 6, 2008 |
|
# ¿ Dec 6, 2008 19:24 |
schnarf posted:What does the destructor for Image do? Is it possible that the constructor does something with the pointer to img and then something funky happens in the destructor? Image is largely a wrapper for another image library with import/export functionality. code:
|
|
# ¿ Dec 7, 2008 01:53 |
Somewhere in my loving huge (tm) operating systems project, a there is a memblock->next = memblock. I can't do a simple search through the text, as the assignment happens when the program is running. (Lots of pointer dumbfuckery and the like.) What tools can I use other than gdb and ddd exist to help with this screaming headache?
|
|
# ¿ Dec 14, 2008 05:03 |
Avenging Dentist posted:All assignments happen when a program is running. (Excluding const PODs, etc). Ehr, yes. That was poorly phrased. The assignment is the end result of a series of operations when I run the application. I.e. a->next = b; b->next = c; c->next = d; d->next = a; Remove c, b->next = d; Remove b, a->next = d; Remove d, a->next = a; The bug doesn't arise in small scale tests. It's large-scale 5 minute long stress tests that make it pop up. In a perfect world, I'd like to be able to set up a monitor that detects when the assignment obj->next = obj is made. Is this possible? TheSleeper posted:How many places in your code are you actually assigning to memblock->next? I mean would it be reasonable to just assert(&memblock != &memblockToBeNext) before the assignment and backtrack from there to find the bug? Only a few, and there are a number of checks in place to catch that sort of thing; making it all the more maddening when it shows up. Jo fucked around with this message at 05:42 on Dec 14, 2008 |
|
# ¿ Dec 14, 2008 05:21 |
I'm having a strange problem with std::deques.code:
Before legalizeTriangle, triangles.size() is 3. I step into legalizeTriangle and the size of triangles is 67896278964243840598345 code:
EDIT: For clarity, the size changes AS SOON as I step into the function. It's as if passing the stl container changes the values inside. Jo fucked around with this message at 20:55 on Jan 1, 2009 |
|
# ¿ Jan 1, 2009 20:53 |
shrughes posted:What the gently caress are you talking about? Learn how to communicate properly. Noted. I thought the GDB excerpt was self explanatory. I'll try to be more clear. Also, working on an isolated test case.
|
|
# ¿ Jan 1, 2009 21:39 |
beuges posted:Don't you want to make LegalizeTriangle take a const reference rather than make a copy? Goddamnit. Works now. Thank you.
|
|
# ¿ Jan 1, 2009 22:42 |
whoknew posted:A lot of the time in C++ you can get around a problem by changing the way you wrote the code slightly, but if you don't know why that change fixed it, you shouldn't assume that it's actually fixed. You definitely clobbered something, somewhere. Perhaps there is a latent problem. I'm really not sure _why_ the problem was happening in the first place. As some stated, this should not have happened. The full source code for the triangulation functions is here. http://pastebin.com/m5ff26445 The tests for the triangle functions, line functions, and points functions have passed. The tests for the swap edge have passed. Tests for find common edge have passed. (Though common edge tests were not terribly extensive.) I hesitate to post the full code because I'd hate to force anyone to shuffle through it all. EDIT: There are a few nasty code-bits. The lack of breaks in the swapEdge function is vestigial -- debugging efforts that haven't been cleaned up completely.
|
|
# ¿ Jan 2, 2009 09:31 |
rjmccall posted:This would be somewhat less painful to debug if you were using references more and pointers less. Also, sometimes you delete[] the return value from getPoints(), and sometimes you don't. I'll keep these in mind if I rewrite everything. (Likely) Thank you very much for your time. ani47 posted:The only problem I think I can see (apart from memory leaks and overuse of new/delete) is you don't clear your trianglesToCheck deque after to add them to the other triangles deque here: YES! Excellent! Thank you so much for noticing that. Good eye. Jo fucked around with this message at 19:03 on Jan 2, 2009 |
|
# ¿ Jan 2, 2009 10:12 |
Complete reedit: It's amazing what wonders can be done when visualizing the tiny pieces. code:
code:
code:
code:
Jo fucked around with this message at 01:01 on Jan 10, 2009 |
|
# ¿ Jan 4, 2009 07:55 |
PT6A posted:You shouldn't seed the random number generator every turn, only once at the beginning of your program. Seeding more makes it more random!
|
|
# ¿ Jan 10, 2009 00:55 |
Is there a way to cross compile for Windows on Linux without MinGW?
|
|
# ¿ Jan 16, 2009 05:06 |
EDIT: gently caress this.
Jo fucked around with this message at 03:51 on Jan 18, 2009 |
|
# ¿ Jan 18, 2009 03:03 |
I'm having a hell of a time linking CGAL. One of the google links actually points here to the forums, but I don't see an actual library name. (I.E. -lcgal) Do I really need to use cmake, or is there a linker command like -lcgal that will work? EDIT: -lcgal != -lCGAL Jo fucked around with this message at 23:25 on Jan 18, 2009 |
|
# ¿ Jan 18, 2009 23:09 |
Gvaz posted:Idk what mv is but I did that and nothing changed on ./chall3.c or .h (idk which we're supposed to save them as, someone told me not to save as .h) mv is the *nix command for 'move'. It has the same functionality as rename. Your main function should be in a .c file, not in a header (.h) file. EDIT: Haha! Caught you before the ninja edit.
|
|
# ¿ Jan 20, 2009 03:45 |
It's late and I'm getting retarded. Is there an obvious flaw with this function?code:
|
|
# ¿ Jan 23, 2009 07:06 |
Ugg boots posted:Are you sure those values are going to fit into an int?
|
|
# ¿ Jan 23, 2009 15:19 |
Randall posted:I just bought Accelerated C++ by Koenig/Moo today. I'm not even on chapter 2 and am already lost. It's been a long while since I started programming, so take this with a giant spoon of salt. The best way to become proficient in a programming language is to use it. Build tiny applications -- simple things like Hello World. Hello (name). A program that takes a text file and adds line numbers. A simple calculator. etc This will teach you something beyond, "Okay public static void main here," and into the realm of understanding WHY things are being done the way they are.
|
|
# ¿ Feb 20, 2009 03:54 |
|
|
# ¿ May 6, 2024 02:43 |
Got it working! Yaaay!
Jo fucked around with this message at 22:36 on Jul 31, 2009 |
|
# ¿ Jul 30, 2009 02:08 |