Ana Menü
· Ana Sayfa
· Dosyalar
· Dökümanlar
· Forum
· Günün Resmi
· Haber Arşivi
· WWW Linkleri
· Üye Listesi

     Forumlar

 strncpy ve strncpy_s
 Konu adi : Borland c++ Builder ile Amiral Batti
 Rady10 - YerliOyun
 Kabusta Kaybolmak
 Konsol da programı bekletmek
 Oyun programlama icin hangi programlama dilli ?
 flash! şanlıurfa bilgisayar oyununda(no rapid)
 Sevgilim Olur musun?
 Directx'e başlamak isteyenler bi bakın
 PSP programlama
 Flash tan php
 Bilgisyr oyunu yapmam için üniverstde hangi bölüme girmeliym
 www.arshiv.gen.ms
 Cimg.h ilgilenenler icin
 müttefik oyunu

Konu Disi
 Emraah
 Yeni sitemiz açıldı
 Kalp krizi durumunda ne yapılmalı?
 Oyun sektöründe hangi görevde çalışmak isterdiniz?
 Takım arkadaşı sorunu
 msn de renklı nıck
 pc hata veriyor ! YARDIM!!
 Gülmek isteyenler Buraya
 İnanılmaz hl 2 modu görüntüsü
 Computer Languages History

[ Forumlara Git ]


oyunyapimi.org: Forums

www.oyunyapimi.org :: Başlığı Görüntüle - 24 saatte oyun programlama kitabı ile ilgili bir soru
 SSSSSS   AramaArama   Kullanıcı GruplarıKullanıcı Grupları   ProfilProfil   LoginLogin 

24 saatte oyun programlama kitabı ile ilgili bir soru

 
Yeni Başlık Gönder   Cevap Gönder    www.oyunyapimi.org Forum Ana Sayfası -> Oyun Motorları
Önceki başlık :: Sonraki başlık  
Yazar Mesaj
dahaka



Kayıt: Jun 02, 2005
Mesajlar: 122
Nereden: Bursa

MesajTarih: Mon Sep 12, 2005 1:30 pm    Mesaj konusu: 24 saatte oyun programlama kitabı ile ilgili bir soru Alıntıyla Cevap Ver

merhaba arkadaşlar ben 24 saatte oyun programlama diye bir kitap aldım adı geçmiştir herhalde bu forumdada neyse bu kitap bir de cd veriyor ama ben cd sini almamışım kitap güzel bir kitap aslında oyun motoru bile oluşturuyorsun çok iyi bir kitap
benim sorunum şu cd yi almadığım için (kitaptada tam kodu yazmamışlar)
bir bitmap i alıp ekrana çizdirmek konusu olmuyor tam kod yok cd de var
eğer bu kitabı alan arkadaşlar bu bitmap sınıfının tam kodunu yazarlarsa çok çok iyi olur gerçekten
gidip cd yi iste derseniz kitabı Ankara'dan aldım Bursa'da oturuyorum.

ve mümkünse bu oyun motorununda tam kodunu verebilir misiniz?

yada hiç olmazsa windows programlamasıyla uğraşan bir arkadaş bir bitmap i alıp ekrana çizdirmek için ne yazmam gerektiğini söyleyebilir mi?

şimdiden çok teşekkürler
Başa dön
Kullanıcı profilini gör MSN Messenger
GameRealist



Kayıt: Oct 08, 2004
Mesajlar: 220
Nereden: Ankara

MesajTarih: Mon Sep 12, 2005 2:02 pm    Mesaj konusu: Alıntıyla Cevap Ver

Bence cd'sini alan bir arkadaş güzellik yapıp bu arkadaşa cd'yi göndersin. Kaçırmasın bazı şeyleri...
Başa dön
Kullanıcı profilini gör E-Posta'yı gönder Kullanıcının web sitesini ziyaret et Yahoo Messenger MSN Messenger
cuneytbnd



Kayıt: May 07, 2005
Mesajlar: 329
Nereden: CMOS SENSOR

MesajTarih: Mon Sep 12, 2005 2:04 pm    Mesaj konusu: Alıntıyla Cevap Ver

bazı kitapcılar cd'ler çalınmasın diye tüm cdleri kitaptan söküp
ayrı muhafaza ediyor. gecen bende bir 3d max 7 kitabını aldım.
akşam vakitti dalgınlığa geldi cd'yi unutmusum.
birkaç saat sonra geri gittim . eleman kasanın yanındaki dolaptan
bir torba cd çıkardı. 10 dk aramadan sonra cd'yi bulduk



kitabı aldıgın yere git bence cd'yi vermezse , zorluk cıkartırlarsa kıtabcının yanında mutlaka bir int kafe vardır. kitapcıdan bir elemanla
birlikte cd'yi alıp.
int kafede kopyalat. 2-3 milyon gider ama olsun .
Başa dön
Kullanıcı profilini gör Kullanıcının web sitesini ziyaret et
cuneytbnd



Kayıt: May 07, 2005
Mesajlar: 329
Nereden: CMOS SENSOR

MesajTarih: Mon Sep 12, 2005 2:06 pm    Mesaj konusu: Alıntıyla Cevap Ver

GameRealist demiş ki:
Bence cd'sini alan bir arkadaş güzellik yapıp bu arkadaşa cd'yi göndersin. Kaçırmasın bazı şeyleri...


buda olabilir

cd kimde varsa kopyalasın.
kargoya versin
kargo ücreti alıcı öder secenekli.
Başa dön
Kullanıcı profilini gör Kullanıcının web sitesini ziyaret et
DarkScythe



Kayıt: Aug 04, 2005
Mesajlar: 173
Nereden: Vault 35

MesajTarih: Mon Sep 12, 2005 2:16 pm    Mesaj konusu: Alıntıyla Cevap Ver

chapter5:
bitmap.h
///////////////////////////////////////////////////////
//-----------------------------------------------------------------
// Bitmap Object
// C++ Header - Bitmap.h
//-----------------------------------------------------------------

#pragma once

//-----------------------------------------------------------------
// Include Files
//-----------------------------------------------------------------
#include <windows.h>

//-----------------------------------------------------------------
// Custom Data Types
//-----------------------------------------------------------------
struct BITMAPINFO_256
{
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[256];
};

//-----------------------------------------------------------------
// Bitmap Class
//-----------------------------------------------------------------
class Bitmap
{
protected:
// Member Variables
HBITMAP m_hBitmap;
int m_iWidth, m_iHeight;

// Helper Methods
void Free();

public:
// Constructor(s)/Destructor
Bitmap();
Bitmap(HDC hDC, LPTSTR szFileName);
Bitmap(HDC hDC, UINT uiResID, HINSTANCE hInstance);
Bitmap(HDC hDC, int iWidth, int iHeight, COLORREF crColor = RGB(0, 0, 0));
virtual ~Bitmap();

// General Methods
BOOL Create(HDC hDC, LPTSTR szFileName);
BOOL Create(HDC hDC, UINT uiResID, HINSTANCE hInstance);
BOOL Create(HDC hDC, int iWidth, int iHeight, COLORREF crColor);
void Draw(HDC hDC, int x, int y);
int GetWidth() { return m_iWidth; };
int GetHeight() { return m_iHeight; };
};
/////////////////////////////////////////////////////////

bitmap.cpp
//////////////////////////////////////////////////////////
//-----------------------------------------------------------------
// Bitmap Object
// C++ Source - Bitmap.cpp
//-----------------------------------------------------------------

//-----------------------------------------------------------------
// Include Files
//-----------------------------------------------------------------
#include "Bitmap.h"

//-----------------------------------------------------------------
// Bitmap Constructor(s)/Destructor
//-----------------------------------------------------------------
Bitmap::Bitmap()
: m_hBitmap(NULL), m_iWidth(0), m_iHeight(0)
{
}

// Create a bitmap from a file
Bitmap::Bitmap(HDC hDC, LPTSTR szFileName)
: m_hBitmap(NULL), m_iWidth(0), m_iHeight(0)
{
Create(hDC, szFileName);
}

// Create a bitmap from a resource
Bitmap::Bitmap(HDC hDC, UINT uiResID, HINSTANCE hInstance)
: m_hBitmap(NULL), m_iWidth(0), m_iHeight(0)
{
Create(hDC, uiResID, hInstance);
}

// Create a blank bitmap from scratch
Bitmap::Bitmap(HDC hDC, int iWidth, int iHeight, COLORREF crColor)
: m_hBitmap(NULL), m_iWidth(0), m_iHeight(0)
{
Create(hDC, iWidth, iHeight, crColor);
}

Bitmap::~Bitmap()
{
Free();
}

//-----------------------------------------------------------------
// Bitmap Helper Methods
//-----------------------------------------------------------------
void Bitmap::Free()
{
// Delete the bitmap graphics object
if (m_hBitmap != NULL)
{
DeleteObject(m_hBitmap);
m_hBitmap = NULL;
}
}

//-----------------------------------------------------------------
// Bitmap General Methods
//-----------------------------------------------------------------
BOOL Bitmap::Create(HDC hDC, LPTSTR szFileName)
{
// Free any previous bitmap info
Free();

// Open the bitmap file
HANDLE hFile = CreateFile(szFileName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
return FALSE;

// Read the bitmap file header
BITMAPFILEHEADER bmfHeader;
DWORD dwBytesRead;
BOOL bOK = ReadFile(hFile, &bmfHeader, sizeof(BITMAPFILEHEADER),
&dwBytesRead, NULL);
if ((!bOK) || (dwBytesRead != sizeof(BITMAPFILEHEADER)) ||
(bmfHeader.bfType != 0x4D42))
{
CloseHandle(hFile);
return FALSE;
}

BITMAPINFO* pBitmapInfo = (BITMAPINFO*)(new BITMAPINFO_256);
if (pBitmapInfo != NULL)
{
// Read the bitmap info header
bOK = ReadFile(hFile, pBitmapInfo, sizeof(BITMAPINFOHEADER),
&dwBytesRead, NULL);
if ((!bOK) || (dwBytesRead != sizeof(BITMAPINFOHEADER)))
{
CloseHandle(hFile);
Free();
return FALSE;
}

// Store the width and height of the bitmap
m_iWidth = (int)pBitmapInfo->bmiHeader.biWidth;
m_iHeight = (int)pBitmapInfo->bmiHeader.biHeight;

// Skip (forward or backward) to the color info, if necessary
if (pBitmapInfo->bmiHeader.biSize != sizeof(BITMAPINFOHEADER))
SetFilePointer(hFile, pBitmapInfo->bmiHeader.biSize - sizeof
(BITMAPINFOHEADER), NULL, FILE_CURRENT);

// Read the color info
bOK = ReadFile(hFile, pBitmapInfo->bmiColors,
pBitmapInfo->bmiHeader.biClrUsed * sizeof(RGBQUAD), &dwBytesRead,
NULL);

// Get a handle to the bitmap and copy the image bits
PBYTE pBitmapBits;
m_hBitmap = CreateDIBSection(hDC, pBitmapInfo, DIB_RGB_COLORS,
(PVOID*)&pBitmapBits, NULL, 0);
if ((m_hBitmap != NULL) && (pBitmapBits != NULL))
{
SetFilePointer(hFile, bmfHeader.bfOffBits, NULL, FILE_BEGIN);
bOK = ReadFile(hFile, pBitmapBits, pBitmapInfo->bmiHeader.biSizeImage,
&dwBytesRead, NULL);
if (bOK)
return TRUE;
}
}

// Something went wrong, so cleanup everything
Free();
return FALSE;
}

BOOL Bitmap::Create(HDC hDC, UINT uiResID, HINSTANCE hInstance)
{
// Free any previous DIB info
Free();

// Find the bitmap resource
HRSRC hResInfo = FindResource(hInstance, MAKEINTRESOURCE(uiResID), RT_BITMAP);
if (hResInfo == NULL)
return FALSE;

// Load the bitmap resource
HGLOBAL hMemBitmap = LoadResource(hInstance, hResInfo);
if (hMemBitmap == NULL)
return FALSE;

// Lock the resource and access the entire bitmap image
PBYTE pBitmapImage = (BYTE*)LockResource(hMemBitmap);
if (pBitmapImage == NULL)
{
FreeResource(hMemBitmap);
return FALSE;
}

// Store the width and height of the bitmap
BITMAPINFO* pBitmapInfo = (BITMAPINFO*)pBitmapImage;
m_iWidth = (int)pBitmapInfo->bmiHeader.biWidth;
m_iHeight = (int)pBitmapInfo->bmiHeader.biHeight;

// Get a handle to the bitmap and copy the image bits
PBYTE pBitmapBits;
m_hBitmap = CreateDIBSection(hDC, pBitmapInfo, DIB_RGB_COLORS,
(PVOID*)&pBitmapBits, NULL, 0);
if ((m_hBitmap != NULL) && (pBitmapBits != NULL))
{
const PBYTE pTempBits = pBitmapImage + pBitmapInfo->bmiHeader.biSize +
pBitmapInfo->bmiHeader.biClrUsed * sizeof(RGBQUAD);
CopyMemory(pBitmapBits, pTempBits, pBitmapInfo->bmiHeader.biSizeImage);

// Unlock and free the bitmap graphics object
UnlockResource(hMemBitmap);
FreeResource(hMemBitmap);
return TRUE;
}

// Something went wrong, so cleanup everything
UnlockResource(hMemBitmap);
FreeResource(hMemBitmap);
Free();
return FALSE;
}

BOOL Bitmap::Create(HDC hDC, int iWidth, int iHeight, COLORREF crColor)
{
// Create a blank bitmap
m_hBitmap = CreateCompatibleBitmap(hDC, iWidth, iHeight);
if (m_hBitmap == NULL)
return FALSE;

// Set the width and height
m_iWidth = iWidth;
m_iHeight = iHeight;

// Create a memory device context to draw on the bitmap
HDC hMemDC = CreateCompatibleDC(hDC);

// Create a solid brush to fill the bitmap
HBRUSH hBrush = CreateSolidBrush(crColor);

// Select the bitmap into the device context
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, m_hBitmap);

// Fill the bitmap with a solid color
RECT rcBitmap = { 0, 0, m_iWidth, m_iHeight };
FillRect(hMemDC, &rcBitmap, hBrush);

// Cleanup
SelectObject(hMemDC, hOldBitmap);
DeleteDC(hMemDC);
DeleteObject(hBrush);

return TRUE;
}

void Bitmap::Draw(HDC hDC, int x, int y)
{
if (m_hBitmap != NULL)
{
// Create a memory device context for the bitmap
HDC hMemDC = CreateCompatibleDC(hDC);

// Select the bitmap into the device context
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, m_hBitmap);

// Draw the bitmap to the destination device context
BitBlt(hDC, x, y, GetWidth(), GetHeight(), hMemDC, 0, 0, SRCCOPY);

// Restore and delete the memory device context
SelectObject(hMemDC, hOldBitmap);
DeleteDC(hMemDC);
}
}
///////////////////////////////////////////////////////////////

kolay gelsin
Başa dön
Kullanıcı profilini gör E-Posta'yı gönder
dahaka



Kayıt: Jun 02, 2005
Mesajlar: 122
Nereden: Bursa

MesajTarih: Mon Sep 12, 2005 2:34 pm    Mesaj konusu: Alıntıyla Cevap Ver

çok saolun arkadaşlar çok teşekkür ederim darkscythe sende çok saol zahmet edip yazıverdiğin için

tekrar hepinize çok teşekkür ederim
Başa dön
Kullanıcı profilini gör MSN Messenger
m_polat



Kayıt: Oct 11, 2005
Mesajlar: 78
Nereden: kayseri

MesajTarih: Tue Oct 11, 2005 2:02 pm    Mesaj konusu: 24 saat adlı oyun programlama kitabını bende aldım Alıntıyla Cevap Ver

arkadaslar o kitabtan bende aldım iyi bir kitap ama
bana gelen cd nin içinde c++ bulder diye program var yani derleyici
olması gerek ama ben bunu nasıl yüklerim ve kod yazabilirim ltfen yardım edin.

şimdiden tskler Rolling Eyes
Başa dön
Kullanıcı profilini gör E-Posta'yı gönder Kullanıcının web sitesini ziyaret et MSN Messenger
m_polat



Kayıt: Oct 11, 2005
Mesajlar: 78
Nereden: kayseri

MesajTarih: Tue Oct 11, 2005 2:05 pm    Mesaj konusu: c++ builderi açamıyorum yardım edin Alıntıyla Cevap Ver

selam arkadaslar ?

bende aldım o kitabtan ve cd sinide
ama c++ builder programını kuruyorum fakat çalıştıramıyorum .
nasıl çalıştıracagımı söylermisiniz tskler
Başa dön
Kullanıcı profilini gör E-Posta'yı gönder Kullanıcının web sitesini ziyaret et MSN Messenger
Aynstaynx



Kayıt: Jul 03, 2005
Mesajlar: 158
Nereden: Antalya/BELEK

MesajTarih: Tue Oct 11, 2005 2:45 pm    Mesaj konusu: Alıntıyla Cevap Ver

Kitabın Cd sini kitabın yazarının sitesinden indirebilirsin
http://www.michaelmorrison.com
Başa dön
Kullanıcı profilini gör E-Posta'yı gönder Kullanıcının web sitesini ziyaret et MSN Messenger
Mesajları göster:   
Yeni Başlık Gönder   Cevap Gönder    www.oyunyapimi.org Forum Ana Sayfası -> Oyun Motorları Tüm saatler GMT +2 Saat
1. sayfa (Toplam 1 sayfa)

 
Forum Seçin:  
Bu forumda yeni konular açamazsınız
Bu forumdaki mesajlara cevap veremezsiniz
Bu forumdaki mesajlarınızı değiştiremezsiniz
Bu forumdaki mesajlarınızı silemezsiniz
Bu forumdaki anketlerde oy kullanamazsınız


Powered by phpBB 2.x.x © 200x phpBB Group
Türkçe Çeviri : Onur Turgay & Erdem Çorapçıoğlu
Türkçe Düzenleme: Alexis Canver
Version 2.x.x of PHP-Nuke Port by Tom Nitzschner © 200x www.toms-home.com




Web site powered by PHP-Nuke
Web site engine\'s code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Sayfa Üretimi: 0.103 Saniye