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 - Core Xii

Pages: 1 2 [3] 4
31
Audio / Looping a music from a certain point
« on: February 11, 2009, 06:30:06 am »
Well in fact, I don't know. I just wanted to point that out, in case you ever have problems :P

32
Audio / Looping a music from a certain point
« on: February 11, 2009, 04:21:30 am »
One thing that might interfere with your attempts is the MP3 format, which cannot be looped seamlessly. MP3s work with some kind of block structure or whatnot, and can't loop perfectly.

33
Those are some really nice intro pictures. Now all you need is the game. :roll:

34
Graphics / How do I set transparent color of a sprite image ? [Solved]
« on: February 03, 2009, 01:30:10 am »
Please note that JPEG is a lossy compression. There may indeed not be a single (0, 255, 0) pixel in that entire image. Use PNG instead. Also, the alpha component is zero... as far as I know JPG doesn't support alpha, so such an invisible color doesn't exist. It should probably be (0, 255, 0, 255)

35
Network / Alternative to whatismyip.org
« on: January 20, 2009, 11:02:25 pm »
Finding your IP is as simple as connecting to any host that is configured to reply with your remote IP. It's easy to set up your own host to do this, the only requirement is a static IP or DNS so the clients know where to connect.

For instance if you have a web server with PHP, it's as easy as
Code: [Select]
<?php echo $_SERVER['REMOTE_ADDR'&#93;; ?>

In fact, I just did that in 3 minutes: http://corexii.com/ip/

You can use that for development if you can't make your own; However, do not use it for a public distribution, I don't know if I can cope with the traffic.

36
Network / Alternative to whatismyip.org
« on: January 18, 2009, 11:26:10 pm »
http://www.dyndns.com/developers/checkip.html

Quote
Checks must be spaced 10 minutes apart to help reduce server load

Sure you conformed to this?

37
System / General questions about mutexes and threading
« on: December 30, 2008, 11:40:41 pm »
Essentially, yes. If the actual *work* your threads are doing is taking less time than the overhead of multi-threading, you shouldn't be multi-threading at all.

38
System / Re: General questions about mutexes and threading
« on: December 28, 2008, 02:51:35 pm »
Quote from: "Shump"
Is it necessary to use mutexes to lock an object both when you're reading and writing to it or is it enough just locking it when you write to it. In other words, what happens if a thread is reading an object, that is not locked, and then another thread wants to lock and write to it? It seems much more efficient to just lock it only when you need to change it, otherwise, the program may end up spending more time locking and unlocking an object just to get read and write access to it.


This is called a read-write lock. What you do is you have a variable that indicates if the resource is being read or written. You use a mutex for reading this variable. Each thread locks the mutex, reads that variable, and then decides what to do:
  • If the thread wants to read, and the resource is flagged for reading, go ahead and read
  • If the thread wants to read, and the resource is flagged for writing:
    • If there are threads waiting to write, wait
    • If there are no threads waiting to write, flag it for reading, wait for the current writing thread to finish, then go ahead and read
  • If the thread wants to write, and the resource is flagged for reading, flag it for writing, wait for the current reading threads to finish, then go ahead and write
  • If the thread wants to write, and the resource is flagged for writing, wait for the current writing thread to finish, then go ahead and write
Note that you actually need more than one variable for this condition. Let's see...
  • Whether the resource is being written
  • How many threads are reading it (each thread will increment/decrement this)
  • How many threads are waiting to read
  • How many threads are waiting to write

These are not exact instructions, more like guidelines.

39
General discussions / Future and desired potential
« on: December 22, 2008, 06:50:35 pm »
The only reason I'm still using SDL is its convenient condition variables (for multithreading).

40
Graphics / Accessing raw pixel data
« on: December 17, 2008, 08:30:49 am »
Great, thank you for your assistance! :mrgreen:

41
Graphics / Accessing raw pixel data
« on: December 16, 2008, 11:34:17 pm »
Quote from: "Laurent"
Anyway, you can still do everything in memory and just upload your final bunch of pixels to the video memory with Image::LoadFromPixels. Should be fast enough, especially if the dimensions never change.


That was my first thought, but the documentation said that loading an Image is slow. I suppose it's sufficiently fast, then? I presume it copies the data? And I should proceed to draw it as a Sprite?

42
Graphics / Accessing raw pixel data
« on: December 16, 2008, 01:43:50 pm »
I'd like to use a software renderer, how would I go about accessing raw pixel data? Is sf::Image's SetPixel() fast enough for going through the entire image every frame?

43
General discussions / How Do You Do While Intersects
« on: December 04, 2008, 10:13:15 am »
To be perfectionist, you'd only want to do that when the conditions change (mouse moves)

44
Feature requests / FTP/HTTP Classes - Progress Callback
« on: December 02, 2008, 08:15:41 am »
Already in the roadmap.

45
Feature requests / DLL convenience wrapper
« on: October 16, 2008, 11:15:21 am »
I imagine. But I'm not really a programmer, more like an engineer. My talent lies in creating stuff, not understanding others' :roll:

Anyway, thank you for assisting me. I'm hoping a similar class finds its way into SFML so it'll be readily usable right away (not that there's anything wrong with your implementation). Until then, might just use this 8)

Pages: 1 2 [3] 4