3H-GDC m.II **** The results are in ****
Started by capn_midnight, Jul 18 2005 03:20 PM
150 replies to this topic
#41 Members - Reputation: 594
Posted 24 July 2005 - 05:02 AM
I know(btw eastern = GMT-5, cental = -6), but why does the server time for me read central time not eastern, but he said eastern time by the gdnet server clocks.
Regards,
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
Sponsor:
#44 Members - Reputation: 690
Posted 24 July 2005 - 05:24 AM
Quote:
Original post by DerAnged
I know(btw eastern = GMT-5, cental = -6), but why does the server time for me read central time not eastern, but he said eastern time by the gdnet server clocks.
So it starts at two for us then? Heh, good to know
#45 Members - Reputation: 594
Posted 24 July 2005 - 05:27 AM
Quote:
Original post by Samith Quote:
Original post by DerAnged
I know(btw eastern = GMT-5, cental = -6), but why does the server time for me read central time not eastern, but he said eastern time by the gdnet server clocks.
So it starts at noon for us then? Heh, good to know
Where are you located?
It starts at 2 here.
Also, SDL is acceptable, what about sdl_ttf(true type fonts) and sdl_image(other image types besides bmp)?
Regards,
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
#46 Members - Reputation: 690
Posted 24 July 2005 - 05:41 AM
Quote:
Original post by DerAnged
Where are you located?
It starts at 2 here.
Also, SDL is acceptable, what about sdl_ttf(true type fonts) and sdl_image(other image types besides bmp)?
I know, I messed up my math :p (3-1 = ZERO!)
And if sdl_ttf is allowed, can I use my font class? I know that capn said only an input manager, rendering frame, and sound manager were allowed...but...font classes don't really affect gameplay. I'll post the code so other people can use it too (assuming it's allowed).
"Color" is just a struct with four floats, r, g, b, and a. It's the only thing defined in "util_classes.h"
font.h
#ifndef H_FONT
#define H_FONT
#include <string>
#include <sstream>
#include "glheaders.h"
#include "util_classes.h"
class Font
{
public:
Font();
~Font();
void BuildFont(const char* face, int size, int wgt);
void Newline();
float getLength(std::string str);
float getSize() { return size; }
void setPosition(const float x, const float y) { xScreen = x; yScreen = y; xMod=0.0f; }
void setColor(float r, float g, float b, float a) { color.r=r; color.g=g; color.b=b; color.a=a; }
void setColor(const Color& c) { color = c; }
void setFontFace(const char* face);
void setFontSize(float newSize);
void DeleteFont();
template<typename T> Font& operator<<(const T& t) {
oss << t;
s = oss.str();
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0, 800, 600, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glBindTexture(GL_TEXTURE_2D, 0);
glColor4f(color.r, color.g, color.b, color.a);
glRasterPos2f(xScreen+xMod, yScreen);
glPushAttrib(GL_LIST_BIT);
glListBase(base);
glCallLists(s.length(), GL_UNSIGNED_BYTE, s.c_str());
glPopAttrib();
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glEnable(GL_DEPTH_TEST);
for(unsigned int i = 0; i < s.length(); i++) {
xMod += abcf[s[i]].abcfA;
xMod += abcf[s[i]].abcfB;
xMod += abcf[s[i]].abcfC;
}
s.clear();
oss.str("");
return *this;
}
private:
std::ostringstream oss;
std::string s;
std::string fontname;
float size;
int weight;
unsigned int base; // base for displaylist
float xScreen, yScreen;
Color color;
float xMod; // so you know how much to add to the xScreen so you don't constantly draw
ABCFLOAT abcf[256];
};
#endif
font.cpp
#include "font.h"
Font::Font() : fontname(""), base(0),
xScreen(0.0f), yScreen(0.0f),
color(), xMod(0.0f)
{
}
Font::~Font()
{
DeleteFont();
}
void Font::BuildFont(const char* face, int size1, int wgt)
{
fontname = face;
size = size1;
weight = wgt;
HFONT font;
HDC hDC;
base = glGenLists(256);
hDC = wglGetCurrentDC();
font = CreateFont(-size*1.4f,
0,
0,
0,
weight,
false,
false,
false,
ANSI_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
ANTIALIASED_QUALITY,
FF_DONTCARE|DEFAULT_PITCH,
fontname.c_str());
SelectObject(hDC, font);
wglUseFontBitmaps(hDC, 0, 256, base);
if(GetCharABCWidthsFloat(hDC, 0, 255, abcf) == 0)
{
MessageBox(0, "GetCharABCWidthsFloat() failed like no other.", "omg", MB_OK);
}
}
float Font::getLength(std::string str)
{
float length = 0.0f;
for(unsigned int i = 0; i < str.length(); i++)
{
length += abcf[str[i]].abcfA;
length += abcf[str[i]].abcfB;
length += abcf[str[i]].abcfC;
}
return length;
}
void Font::Newline()
{
yScreen += size;
xMod = 0.0f;
}
void Font::setFontSize(float newSize)
{
DeleteFont();
BuildFont(fontname.c_str(), newSize, weight);
}
void Font::setFontFace(const char *face)
{
DeleteFont();
BuildFont(face, size, weight);
}
void Font::DeleteFont()
{
glDeleteLists(base, 256);
}
usage
Font* font = new Font();
font->BuildFont("Courier New", 16, 700); // font name, size, and boldness (1000 is most, 0 is none)
font->setColor(1.0f, 1.0f, 1.0f, 1.0f);
font->setPosition(x, y) // must call this every time before hand, it resets the position
*font << "Hello " << 1.6f;
OUTPUT:
Hello 1.6
#48 Members - Reputation: 594
Posted 24 July 2005 - 06:10 AM
Quote:
Original post by Cypher19
That code is not allowed, it had to be approved by capn_midnight before mindnight EST last night.
EST 2 nights ago.
Regards,
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
#50 Members - Reputation: 1226
Posted 24 July 2005 - 06:26 AM
People, eastern time is GMT - 4 right now because of daylight savings. The GDNet server clock properly registers EST.
[See some of My Projects] - [Find me on twitter tumblr G+] - [Watch me burn stuff in Exile: the Family You Choose] - [Come hang out at Philadelphia's Premiere Hackerspace - Hive76]
#51 Members - Reputation: 594
Posted 24 July 2005 - 06:26 AM
Quote:
Original post by Samith
I can still....retype it into my project though, can't I? Otherwise I won't have any way to put text on the screen.
We still don't even know if SDL_TTF/Image are allowed.
Regards,
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
#53 Members - Reputation: 594
Posted 24 July 2005 - 06:32 AM
Quote:
[Deranged] capn_midnight: You haven't yet replied in the 3H-GDC m.II, so, SDL is allowed, are SDL_TTF(font) and SDL_IMAGE(other image formats besides bmp) allowed?
... ...
<capn_midnight> are they standard, open libs?
[Deranged] yes
...
<capn_midnight> Deranged, yes
Well at least we can use them.
Regards,
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
Sheridan Bulger
-Day Job | Software Developer | Deacom, Inc.
-Moonlighting | President (lead) | Nonpareil Studios, LLC.
#54 Members - Reputation: 1226
Posted 24 July 2005 - 06:32 AM
Submissions will be excepted up to 15 minutes after 6pm EST, at capn.midnight@gmail.com
[See some of My Projects] - [Find me on twitter tumblr G+] - [Watch me burn stuff in Exile: the Family You Choose] - [Come hang out at Philadelphia's Premiere Hackerspace - Hive76]
#55 Members - Reputation: 1226
Posted 24 July 2005 - 06:36 AM
Quote:
Original post by Samith
I can still....retype it into my project though, can't I? Otherwise I won't have any way to put text on the screen.
yes, you can retype it into the project, though I will have no way of knowing if you copy and paste, just be on your honor.
We're currently on irc.afternet.org in #gamedev
[See some of My Projects] - [Find me on twitter tumblr G+] - [Watch me burn stuff in Exile: the Family You Choose] - [Come hang out at Philadelphia's Premiere Hackerspace - Hive76]
#58 Members - Reputation: 1226
Posted 24 July 2005 - 07:09 AM
Quote:
Original post by MonkeyInBlack Quote:
Original post by capn_midnight
Submissions will be excepted up to 15 minutes after 6pm EST, at capn.midnight@gmail.com
Do we have to include the source code or only the executable ?
you don't have to include source code. The executable is required, and it should run out-of-the-box (OR ELSE!!!). Since the submissions will be available after the contest, the source code is encouraged.
[See some of My Projects] - [Find me on twitter tumblr G+] - [Watch me burn stuff in Exile: the Family You Choose] - [Come hang out at Philadelphia's Premiere Hackerspace - Hive76]
#59 Members - Reputation: 1226
Posted 24 July 2005 - 07:31 AM
With the recent GTA scandal (of course, when is there NOT a scandal over some game) we all know that video games influence children (and parents have no control over their children). In this light, the theme is Fire. Gameplay should involve fire in some way, so as to turn all the good children of the world into raving, lunatic pyromaniacs.
Interpret "fire" in anyway you wish.
Completely "unrelated" ;)... Donald Trump is a cool dude.
Interpret "fire" in anyway you wish.
Completely "unrelated" ;)... Donald Trump is a cool dude.
[See some of My Projects] - [Find me on twitter tumblr G+] - [Watch me burn stuff in Exile: the Family You Choose] - [Come hang out at Philadelphia's Premiere Hackerspace - Hive76]
#60 Members - Reputation: 1226
Posted 24 July 2005 - 07:42 AM
[See some of My Projects] - [Find me on twitter tumblr G+] - [Watch me burn stuff in Exile: the Family You Choose] - [Come hang out at Philadelphia's Premiere Hackerspace - Hive76]






