1
General discussions / Re: A new logo for SFML
« on: April 26, 2013, 12:32:51 pm »This one was perfect!
I love it.
I think it would be even better if the pentagon was on top of the text:
{}
SFML
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.
This one was perfect!
I love it.
enum ContextProfile
{
CompatibilityProfile, //Default.
ForwardCompatibleProfile,
};
ContextSettings cs(0, 0, 0, 3, 2, ForwardCompatibleProfile);
final int C = 10;
long[] res = new long[C];
int i = 0;
long tp = System.nanoTime();
while (i < C)
{
long tn = System.nanoTime();
if (tn != tp)
{
long d = tn - tp;
tp = tn;
res[i] = tn;
i++;
}
}
for (i = 0; i < C; i++)
System.out.println(Integer.toString(i) + " = " + res[i]);
0 = 181327039326786
1 = 181327039328598
2 = 181327039329503
3 = 181327039330409
4 = 181327039331315
5 = 181327039332221
6 = 181327039332674
7 = 181327039333580
8 = 181327039334485
9 = 181327039335391
- provide double seconds, but then some people will complain about the lack of exact timestamps, as well as the need to cast to float every calculation involving time (everything gets promoted to double when one of the operands is a double, but SFML uses float everywhere else)
TimeSpan ts = foo.EllapsedTime();
double deltaTime = ts.AsDoubleSecunds();
update(deltaTime);
render(deltaTime);
using (Bitmap icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location).ToBitmap())
using (Bitmap icon = new Bitmap(32, 32))
using (Bitmap icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location).ToBitmap())
{
unsafe
{
BitmapData data = icon.LockBits(new Rectangle(0, 0, icon.Width, icon.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
byte* ptr = (byte*)data.Scan0;
int size = data.Width * data.Height * 4;
byte[] pixels = new byte[size];
for (int i = 0; i < size; i++)
{
pixels[i] = ptr[i];
}
//Swap chanels.
for (int i = 0; i < size / 4; i++)
{
byte t = pixels[i * 4 + 0];
pixels[i * 4 + 0] = pixels[i * 4 + 2];
pixels[i * 4 + 2] = t;
}
SetIcon((uint)icon.Width, (uint)icon.Height, pixels);
icon.UnlockBits(data);
}
}
Problem signature:
Problem Event Name: APPCRASH
Application Name: AppName.vshost.exe
Application Version: 10.0.30319.1
Application Timestamp: 4ba2084b
Fault Module Name: StackHash_d340
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdb3b
Exception Code: c0000374
Exception Offset: 000cdcbb
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1038
Additional Information 1: d340
Additional Information 2: d340cfbcf5d2a1596ea02401d3971e0b
Additional Information 3: f1b1
Additional Information 4: f1b10f8b730cb6e83e0c8b6ce5c965b2