Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jesper Juhl

Pages: 1 [2] 3 4 ... 94
16
General / Re: Problem with running a big-array-of-pixels app
« on: July 20, 2016, 10:23:52 pm »
Quote
btw, that statement is not illegal since i've used it

Just because one compiler accepts it does not mean it is valid.
Not all compilers implement the standard correctly. Compilers have bugs. Compilers have extentions to the language. Compilers may accept broken code and just print a warning (or not). Etc etc.
This is why you should always build your code with multiple compilers on multiple platforms with high warning levels enabled (and run other tools (like clang tidy, cppcheck - and others)) to be (reasonably) sure that your code is standard compliant and portable.

I recommend always building all commits with gcc, clang, VS (and sometimes icc) on (at least) Linux and Windows, with (at least) "-Wall -Wextra" (or equivalent "/W4"). More is better... It catches real bugs and keeps your code working broadly :-) and it can be completely automated to happen in the background every time you do a "git commit" :-)
  This is what I do myself - and it's worth it in the long run spending a few hours to set up a few virtual machines and a CI system integrated with you DVCS - it pays for itself many times over over the years.

17
Window / Re: Render window and iterators / vectors
« on: July 20, 2016, 04:52:39 pm »
Nitpick: "_Btns" is, strictly speaking, not an allowed name. All names beginning with underscore and followed by a upper-case letter (as well as names containing double underscores "__" anywhere) arre reserved for the implementation. That is, only your compiler and standard library are allowed to use such names.

18
Window / Re: Switching between Window Styles at runtime using GLEW
« on: July 17, 2016, 09:02:35 pm »
"the window runs in a separate thread than my main application" - Why?

19
Graphics / Re: Sprite alignment with shrunk view
« on: July 16, 2016, 08:42:04 am »
How about drawing to a 800x600 rendertexture first. Then when everything in the frame is drawn, draw the rendertexture to the screen using the view.

20
eXploit3r speaks truth :)

21
Build files should be under version control just like the source code. So I'll just assume that that is the case and provide this answer: look at a diff of your current and previous version of the build files (settings) and see what you changed, then change it back.

22
General / Re: best practice
« on: June 20, 2016, 10:21:32 pm »
You can update an object whenever you like. Whether or not it makes sense to update an object at any given time (inside or outside the event loop) depends entirely on your program and the logic associated with the object etc. So the only real answer is "yes" and also "no" and "it depends"...

23
Graphics / Re: Texture saved in Ram
« on: June 19, 2016, 04:35:23 pm »
When you leave main your program terminates and the kernel reclaims all its memory. If you want something to persist beyond that point you have to store it somewhere else - like sysv shared memory, a file or elsewhere.

24
Graphics / Re: Problem with efficiency and collision when drawing map
« on: June 04, 2016, 05:07:52 pm »
Compare the pixels.

25
SFML projects / Re: Zeran's Folly
« on: June 02, 2016, 05:39:05 pm »
Very nice work. Looks awesome.

26
Jesper Juhl, I was talking about forum threads, not other threads, so it's alright.
Whoops.  ::)  ;D

27
I just had see Elias talking about threads and I don't know what are this...
Multiple threads of execution all executing concurrently (so you need to be careful and synchronize access to resources).

I'm a very beginner in programming...
Then you probably want to stay far away from threads for a fair bit of time.

28
General / Re: How To Better Optimize This Code?
« on: May 12, 2016, 05:37:39 pm »
IMHO trying to micro optimize something as trivial as this is pointless. It is unlikely to take up any measurable amount of CPU time and will be completly dwarfed by other code that does work like AI, Physics, rendering etc.
This code should just be written in the most clear manner possible and don't worry about performance.

29
SFML projects / Re: Cendric: An RPG Platformer
« on: May 09, 2016, 05:09:28 pm »
Absolutely beautiful.

30
General / Re: Unstable frame rate
« on: May 08, 2016, 01:56:40 pm »
than try reinstalling SFML.
And how would that help anything?

Before a solution can be suggested the problem must be understood.

Pages: 1 [2] 3 4 ... 94