Search the Community

Showing results for tags 'Visual Studio'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • News

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Audio Jobs
  • Business Jobs
  • Game Design Jobs
  • Programming Jobs
  • Visual Arts Jobs

Categories

  • GameDev Unboxed

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Topical
    • Virtual and Augmented Reality
    • News
  • Community
    • GameDev Challenges
    • For Beginners
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams

Blogs

There are no results to display.

There are no results to display.

Marker Groups

  • Members

Developers


Group


About Me


Website


Industry Role


Twitter


Github


Twitch


Steam

Found 28 results

  1. Surely, VB.net and C# (in Visual Studio express and other editions) Bitmaps were creatable from its GDI+ methods.(ex. Dim b as bitmap = new bitmap(image)) But not supported programming-based procedural generated bitmaps, only bitmaps from bitmap-files or its (related) objects or classes supported. Now, this article describes about algorithm-based generated bitmaps in VB.net/C# using both built-in GDI+ methods and external Windows APIs. so-called "binary" bitmaps created from the Createbitmap API. But its usage was not simple, pretty difficult. Then I show up samples in source codes below. 1.form(an app-window) initialization (on this app, form.size fixed in 1600*900) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load bmp = New Bitmap(1601, 865, Imaging.PixelFormat.Format32bppRgb) 'screen resolutions in 1600*864 Sm = "Scene 1" : At = 1 : g = Me.CreateGraphics: BmphDC = g.GetHdc : MainhDC = CreateCompatibleDC(BmphDC) Me.Top = 0 : Me.Left = 0 : SetTextColor(MainhDC, &H32A77400) : SetBkColor(MainhDC, 0) : SetBkMode(MainhDC, 1) Dim f As New Font(New FontFamily("Times New Roman"), 14, FontStyle.Regular, GraphicsUnit.Pixel, 1, False) : SelectObject(MainhDC, f.ToHfont) End Sub mixed .net objects/methods and windows APIs up. those codes were working correctly as it is... Then cleanups. Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) DeleteDC(MainhDC) : g.ReleaseHdc(BmphDC) : End End Sub 2.binding binary values to bitmap Public Function LenB(ByVal stTarget As String) As Integer Return System.Text.Encoding.GetEncoding(932).GetByteCount(stTarget) End Function Private Sub RefreshScenes() ' Create a new bitmap and Lock the bitmap's bits. Dim rect As New Rectangle(0, 0, bmp.Width, bmp.Height) Dim bmpData As System.Drawing.Imaging.BitmapData = bmp.LockBits(rect, Drawing.Imaging.ImageLockMode.WriteOnly, bmp.PixelFormat) Dim ptr As IntPtr = bmpData.Scan0 ' Get the address of the first line. ' Declare an array to hold the bytes of the bitmap.This code is specific to a bitmap with 32 bits per pixels. Dim bytes As Integer = Math.Abs(bmpData.Stride) * bmp.Height ':Dim rgbValues(bytes - 1) As Byte ' Copy the RGB values back to the bitmap System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, ptr, bytes) bmp.UnlockBits(bmpData) ' Unlock the bits. bmpHandle = bmp.GetHbitmap : SelectObject(MainhDC, bmpHandle) 'TextOut(MainhDC, 637, 10, "A Single Textout Line called like this", 19) For Iu As Integer = 0 To 9 If Not DispMsgShown(Iu) = "" Then Dim RenCache As Integer = LenB(DispMsgShown(Iu)) TextOut(MainhDC, 27, 21 + (Iu * 22), DispMsgShown(Iu), RenCache) End If Next Iu : BitBlt(BmphDC, 0, 0, 1601, 865, MainhDC, 0, 0, SRCCOPY) : DeleteObject(bmpHandle) End Sub 3.texts to be used in overlays Private Sub StrLoader() Select Case At Case 1 DispMsgShown(0) = "textout sample..." DispMsgShown(1) = "at the same time using bitblt and textout..." DispMsgShown(2) = "likely this way to code." DispMsgShown(3) = " " DispMsgShown(4) = "coffee-drinking is relaxing us" DispMsgShown(5) = "" DispMsgShown(6) = "" DispMsgShown(7) = "yoga included the same affects " DispMsgShown(8) = "" Case 2 DispMsgShown(0) = "A" DispMsgShown(1) = "B" DispMsgShown(2) = "C" DispMsgShown(3) = "D" DispMsgShown(4) = "E" DispMsgShown(5) = "F" DispMsgShown(6) = "G" DispMsgShown(7) = "H" DispMsgShown(8) = "I" DispMsgShown(9) = "JKLMNOPQRSTUVWXYZ...thanks!" End Select End Sub 4. Procedual generation samples using above and a timer component Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Cur += 1 : Randomize() Dim RRInt As Integer = Int(Math.Sqrt(Cur * 410)), Sr As New System.Random Dim X2, Y2 As Integer, Iu As Integer Select Case Sm Case "Scene 1" Select Case At Case 1 For Iu2 As Integer = 0 To 13 For Iu = 0 To Math.Sqrt(Cur * 173) + 37 retry: X2 = -Int(RRInt * 1.5) + Sr.Next(RRInt * 3) : Y2 = -RRInt + Sr.Next(RRInt * 2) If Y2 < 0 And Y2 ^ 3 + X2 ^ 2 < RRInt * 40 Then GoTo Retry Pset1(800 + X2, 510 + Y2, Math.Min(255, Sr.Next(RRInt)), Math.Min(255, Sr.Next(RRInt)), Math.Min(255, Sr.Next(RRInt))) Next Iu Next Iu2 Math.DivRem((Cur - 1) * 5, 460, SecCur) For Iu2 As Integer = 0 To 4 'If Cur < 460 Then For Iu = 0 To Math.Sqrt(SecCur) + 14 Pset3(1140 + SecCur + Iu2, 10 + Iu, 40, 60, 70, , , Math.Sqrt(SecCur * 7) + Iu * 2) Pset3(1140 + SecCur + Iu2, 44 + Iu, 40, 60, 70, , Math.Sqrt(SecCur * 7) + Iu * 2) Pset3(1140 - SecCur - Iu2, 74 - Iu, 40, 60, 70, Math.Sqrt(SecCur * 7) + Iu * 2) Pset3(1140 - SecCur - Iu2, 40 - Iu, 40, 60, 70, , Math.Sqrt(SecCur * 4) + Iu, Math.Sqrt(SecCur * 4) + Iu) Next Iu ':End If Next Iu2 Case 2 Dim SecCur As Integer If Cur < 2100 Then For Iu2 As Integer = 0 To 780 'Pset1(1600 - Cur, 120 + Int(Math.Sqrt(Cur)), 60, 240, 140) Pset1(1600 - Cur * 2 + Iu2 * 4, 120 + Int(Math.Sqrt(Cur * 3)) + Iu2, 60 - Int(Math.Sqrt(Iu2)), 240 - Int(Math.Sqrt(Iu2)) * 3, 140 + Int(Math.Sqrt(Iu2)) * 2) Pset1(1600 - Cur * 2 - 1 + Iu2 * 4, 120 + Int(Math.Sqrt(Cur * 3)) + Iu2, 60 - Int(Math.Sqrt(Iu2)), 240 - Int(Math.Sqrt(Iu2)) * 3, 140 + Int(Math.Sqrt(Iu2)) * 2) Next Iu2 Else SecCur = Cur - 2100 For Iu2 As Integer = 0 To 780 'Pset1(1600 - Cur, 120 + Int(Math.Sqrt(Cur)), 60, 240, 140) Pset1(1600 - SecCur * 2 + Iu2 * 4, 120 + Int(Math.Sqrt(SecCur * 3)) + Iu2, 160, 240 - Int(Math.Sqrt(Iu2)), 160 + Int(Math.Sqrt(Iu2))) Pset1(1600 - SecCur * 2 - 1 + Iu2 * 4, 120 + Int(Math.Sqrt(SecCur * 3)) + Iu2, 160, 240 - Int(Math.Sqrt(Iu2)), 160 + Int(Math.Sqrt(Iu2))) Next Iu2 End If End Select End Select : StrLoader():RefreshScenes() End Sub If you hope to add more scenes, one solution is increasing "case" statement . Surely In a large project, external package files required I think. 5.Header declarations within Windows APIs and module-common values Private Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As IntPtr, ByVal hdc As IntPtr) As Long Private Declare Function SelectObject Lib "gdi32.dll" (ByVal hdc As IntPtr, ByVal hObject As IntPtr) As IntPtr Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As IntPtr) As Boolean Private Declare Function CreateCompatibleDC Lib "gdi32.dll" (ByVal hdc As IntPtr) As IntPtr Private Declare Function GetWindowDC Lib "user32.dll" (ByVal hWnd As IntPtr) As IntPtr Private Declare Function GetDC Lib "user32.dll" (ByVal hwnd As IntPtr) As IntPtr Private Declare Function DeleteDC Lib "gdi32.dll" (ByVal hDC As IntPtr) As Boolean Private Declare Function SetTextColor Lib "gdi32.dll" (ByVal hDC As IntPtr, ByVal crColor As Integer) As Boolean Private Declare Function SetBkColor Lib "gdi32.dll" (ByVal hDC As IntPtr, ByVal crColor As Integer) As Boolean Private Declare Auto Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, _ ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As System.Int32) As Boolean Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal lpString As String, ByVal nCount As Integer) As Boolean Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As IntPtr, ByVal iBkMode As Integer) As Boolean Private Const SRCCOPY As Integer = &HCC0020 Private Sm As String, At As Integer, Cur As Integer, Bm As Bitmap, rgbValues(5539459) As Byte Private g As Graphics, Iu As Integer, SecCur As Integer, bmp As Bitmap, bmpHandle As IntPtr Private MainhDC, BmphDC As IntPtr, DispMsgShown(9) As String Private Stride_Value As Integer = 6404 'stride values related in bitmap's X-width 6.methods in pixel painting (compatible only this application) Private Sub Pset1(ByVal XPos As Integer, ByVal YPos As Integer, ByVal RedValue As Byte, ByVal GreenValue As Byte, ByVal BlueValue As Byte) If YPos > 864 Then YPos = 864 If YPos < 0 Then YPos = 0 If XPos > 1600 Then XPos = 1600 If XPos < 0 Then XPos = 0 Dim AddressOfBinaryIndex As Integer = XPos * 4 + YPos * 6404 rgbValues(AddressOfBinaryIndex) = Math.Max(rgbValues(AddressOfBinaryIndex), BlueValue) rgbValues(AddressOfBinaryIndex + 1) = Math.Max(rgbValues(AddressOfBinaryIndex + 1), GreenValue) rgbValues(AddressOfBinaryIndex + 2) = Math.Max(rgbValues(AddressOfBinaryIndex + 2), RedValue) End Sub Private Sub Pset3(ByVal XPos As Integer, ByVal YPos As Integer, ByVal RedValue As Byte, ByVal GreenValue As Byte, ByVal BlueValue As Byte, Optional ByVal AdditionalRedValue As Byte = 0, Optional ByVal AdditionalGreenValue As Byte = 0, Optional ByVal AdditionalBlueValue As Byte = 0) If YPos > 864 Then YPos = 864 If YPos < 0 Then YPos = 0 If XPos > 1600 Then XPos = 1600 If XPos < 0 Then XPos = 0 RedValue = Math.Min(255, AdditionalRedValue + RedValue) : GreenValue = Math.Min(255, AdditionalGreenValue + GreenValue) : BlueValue = Math.Min(255, AdditionalBlueValue + BlueValue) Dim AddressOfBinaryIndex As Integer = XPos * 4 + YPos * 6404 : rgbValues(AddressOfBinaryIndex) = Math.Min(255, BlueValue) rgbValues(AddressOfBinaryIndex + 1) = Math.Min(255, GreenValue) : rgbValues(AddressOfBinaryIndex + 2) = Math.Min(255, RedValue) End Sub Private Sub Pset2(ByVal XPos As Integer, ByVal YPos As Integer, ByVal RedValue As Byte, ByVal GreenValue As Byte, ByVal BlueValue As Byte, Optional ByVal AdditionalRedValue As Byte = 0, Optional ByVal AdditionalGreenValue As Byte = 0, Optional ByVal AdditionalBlueValue As Byte = 0) If YPos > 864 Then YPos = 864 If YPos < 0 Then YPos = 0 If XPos > 1600 Then XPos = 1600 If XPos < 0 Then XPos = 0 RedValue = Math.Min(255, AdditionalRedValue + RedValue) : GreenValue = Math.Min(255, AdditionalGreenValue + GreenValue) : BlueValue = Math.Min(255, AdditionalBlueValue + BlueValue) Dim AddressOfBinaryIndex As Integer = XPos * 4 + YPos * 6404 rgbValues(AddressOfBinaryIndex) = Math.Max(rgbValues(AddressOfBinaryIndex), BlueValue) rgbValues(AddressOfBinaryIndex + 1) = Math.Max(rgbValues(AddressOfBinaryIndex + 1), GreenValue) rgbValues(AddressOfBinaryIndex + 2) = Math.Max(rgbValues(AddressOfBinaryIndex + 2), RedValue) End Sub 7.Buttons on form to proceed scenes Private Sub ResetScreen() Dim Iu As Integer : For Iu = 0 To rgbValues.Length - 1 Step 4 rgbValues(Iu) = 0 : rgbValues(Iu + 1) = 0 : rgbValues(Iu + 2) = 0 Next End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If At = 1 Then ResetScreen() : At = 2 : Cur = 0 End If If At = 2 Then MsgBox("sample application finished. thanks for downloading!") End If End Sub A VB2010 sample solution will be attached later. I'd like readers to download it! Of course it also enables binding DirectX interop APIs and above bitmaps in additional coding with slimdx or sharpdx, If you require GPU optimization. thanks for long reading AMStudiosSample1.zip
  2. Hi all, I have written a nice(ish) looking game of solitaire in Windows Forms, using VB.NET and Visual Studio 2015. It allows the player to play the game, and if their score is in the top 10, it saves the username and score o a leaderboard (saved in a text file so it is non-volatile). My next goal is to let the user know if the hand they are dealt is playable, but I'm not sure on the most efficient way of achieving this. I'm working on time complexity over space complexity! It's a simple game to code, but not an easy one to find the solution. Do you know of any algorithms that may achieve this goal that I would be able to look at?
  3. I have to learn DirectX for a course I am studying. This book https://www.amazon.co.uk/Introduction-3D-Game-Programming-Directx/dp/1936420228 I felt would be great for me to learn from. The trouble is the examples which are all offered here http://www.d3dcoder.net/d3d11.htm . They do not work for me. This is a known issue as there is a link on the examples page saying how to fix it. I'm having difficulty with doing this though. This is the page with the solution http://www.d3dcoder.net/Data/Book4/d3d11Win10.htm. The reason why this problem is happening, the book was released before Windows 10 was released. Now when the examples are run they need slight fixes in order for them to even work. I just can't get these examples working at all. Would anyone be able to help me get the examples working please. I am running Windows 10 also just to make this clear, so this is why the examples are experiencing the not so desired behaviour. I just wish they would work straight away but there seems to be issues with the examples from this book mainly because of it trying to run from a Windows 10 OS. On top of this, if anyone has any suggestions with how I can learn DirectX 11 i would be most grateful. Thanks very much. I really would like to get them examples working to though from the book I mentioned. Look forward to reading any replies this thread receives. GameDevCoder. PS - If anyone has noticed. I asked this about 1 year ago also but this was when I was dabbling in it. Now I am actually needing to produce some stuff with DirectX so I have to get my head round this now. I felt at the time that I sort of understood what was being written to me in response to my thread back then. I had always been a little unsure though of being absolutely sure of what was happening with these troublesome examples. So I am really just trying to get to the bottom of this now. If anyone can help me work these examples out so I can see them working then hopefully I can learn DirectX 11 from them. *SOLUTION* - I was able to get the examples running thanks to the gamedev.net community. Great work guys. I'm so please now that I can learn from this book now I have the examples running. https://www.gamedev.net/forums/topic/693437-i-need-to-learn-directx-the-examples-for-introduction-to-3d-programming-with-directx-11-by-frank-d-luna-does-not-work-can-anyone-help-me/?do=findComment&comment=5363013
  4. I wanted to get some advice on what everyone thinks of this debugger, I've been getting some strange results from testing my code and I wanted to see if anyone else had an issues. For instance, I added three "ClearRenderTargetView" calls and three "Draw full screen quad" calls and my reported fps became a fifth of what it usually was. Thank you.
  5. Creating a custom window UI on windows10

    So im about to jump into UI development tutorials and class. Now I'm interested on creating a very simple text editor. I've already got a design. you can see it here: https://www.pinterest.com/pin/489062840776586727/ I'm just wondering if this exact UI design is achievable in windows? what specific language do I need to use? or this is not possible and it will just follow the standard windows 10 header and border design?
  6. Hello all, I set up Visual Studio 2017 for OpenGL and ran this and this codes successfully. I get these linker errors when compiling the following code: #include <iostream> using namespace std; #include "vgl.h" #include "LoadShaders.h" enum VAO_IDs { Triangles, NumVAOs }; enum Buffer_IDs { ArrayBuffer, NumBuffers }; enum Attrib_IDs { vPosition = 0 }; GLuint VAOs[NumVAOs]; GLuint Buffers[NumBuffers]; const GLuint NumVertices = 6; //-------------------------------------------------------------------- // // init // void init(void) { static const GLfloat vertices[NumVertices][2] = { { -0.90, -0.90 }, // Triangle 1 { 0.85, -0.90 }, { -0.90, 0.85 }, { 0.90, -0.85 }, // Triangle 2 { 0.90, 0.90 }, { -0.85, 0.90 } }; glCreateBuffers(NumBuffers, Buffers); glNamedBufferStorage(Buffers[ArrayBuffer], sizeof(vertices), vertices, 0); ShaderInfo shaders[] = { { GL_VERTEX_SHADER, "triangles.vert" }, { GL_FRAGMENT_SHADER, "triangles.frag" }, { GL_NONE, NULL } }; GLuint program = LoadShaders(shaders); glUseProgram(program); glGenVertexArrays(NumVAOs, VAOs); glBindVertexArray(VAOs[Triangles]); glBindBuffer(GL_ARRAY_BUFFER, Buffers[ArrayBuffer]); glVertexAttribPointer(vPosition, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0)); glEnableVertexAttribArray(vPosition); } //-------------------------------------------------------------------- // // display // void display(void) { static const float black[] = { 0.0f, 0.0f, 0.0f, 0.0f }; glClearBufferfv(GL_COLOR, 0, black); glBindVertexArray(VAOs[Triangles]); glDrawArrays(GL_TRIANGLES, 0, NumVertices); } //-------------------------------------------------------------------- // // main // int main(int argc, char** argv) { glfwInit(); GLFWwindow* window = glfwCreateWindow(640, 480, "Triangles", NULL, NULL); glfwMakeContextCurrent(window); gl3wInit(); init(); while (!glfwWindowShouldClose(window)) { display(); glfwSwapBuffers(window); glfwPollEvents(); } glfwDestroyWindow(window); glfwTerminate(); } Is there any way to solve this issue?
  7. I'm trying to render the characters of a bitmap texture that i generated with stb_truetype.h. Currently i have the texcoords and the longitude of each character, my DirectXTexture2D is 512x512 normilized from -1 to 1. So, i send to render the character "C", creating my triangulation starting from coords (0,0) -> (X0,Y0). Then i get my X1 adding X0 + longitude. NOTE: I transformed my longitude to screen space coordinates dividing out of 512 (texture width size) before. This is my bitmap texture: This is my vertex buffer: float sizeX = static_cast<float>(tempInfo.longitude) / 512; float sizeY = 0.0625f; //32/512 (32->height of font) spritePtr[0].Pos = XMFLOAT3(0.0f + sizeX, 0.0f + sizeY, 1.0f); spritePtr[1].Pos = XMFLOAT3(0.0f + sizeX, 0.0f, 1.0f); spritePtr[2].Pos = XMFLOAT3(0.0f, 0.0f, 1.0f); spritePtr[3].Pos = XMFLOAT3(0.0f, 0.0f, 1.0f); spritePtr[4].Pos = XMFLOAT3(0.0f, 0.0f + sizeY, 1.0f); spritePtr[5].Pos = XMFLOAT3(0.0f + sizeX, 0.0f + sizeY, 1.0f); spritePtr[0].Tex = XMFLOAT2(tempInfo.Tex_u1, tempInfo.Tex_v0); spritePtr[1].Tex = XMFLOAT2(tempInfo.Tex_u1, tempInfo.Tex_v1); spritePtr[2].Tex = XMFLOAT2(tempInfo.Tex_u0, tempInfo.Tex_v1); spritePtr[3].Tex = XMFLOAT2(tempInfo.Tex_u0, tempInfo.Tex_v1); spritePtr[4].Tex = XMFLOAT2(tempInfo.Tex_u0, tempInfo.Tex_v0); spritePtr[5].Tex = XMFLOAT2(tempInfo.Tex_u1, tempInfo.Tex_v0); NOTE: spritePtr is the pointer to my dynamic buffer that i map and unmap. And this is my result: I don't understand why it is too small compared to my bitmap and if i expand the triangulation i get a pixelated character.
  8. SFML How are Symbols Loaded?

    I am getting the message : <information not available, no symbols loaded for sfml-graphics-d-2.dll> when hovering over the sf::Text object name for Visual C++ using Visual Studio (SFML). I am wondering how do I load the symbols so I can view the text object's text for example? Thank you, Josheir
  9. How do i open an image to use it as Texture2D information without D3DX11CreateShaderResourceViewFromFile? And how it works for different formats like (JPG, PNG, BMP, DDS, etc.)? I have an (512 x 512) image with font letters, also i have the position and texcoord of every letter. The main idea is that i want to obtain the image pixel info, use the position and texcoords to create a new texture with one letter and render it. Or am I wrong in something?
  10. using tmxparser (and failing)

    Hi everyone! I've managed to build zlib, tinyxml2 and tmxparser with cmake-gui & visual studio 2017, but when I try building the example program for tmxparser (https://github.com/sainteos/tmxparser/tree/master/test) I'm getting numerous unresolved externals for errors, and in the warnings they all state the library machine type 'x64' conflicts with target machine type 'x86'. (some of the unresolved symbols include __imp__UnhandledExceptionFilter@4, __imp__getCurrentProcess@0, __imp__HeapAlloc@12 and the file referenced in the error log is MSVCRTD.lib along with varying object files) Thing is, when I go back to the cmake configuration listings for all 3 of those libraries, i can't find anything to suggest i've explicitly configured anything as a 64bit build, and when I open the solutions cmake generated for each of the libraries, all of them (including the test project) have x86 as the current target.. what gives? Thanks in advance!
  11. I want to render true type fonts in DirectX11, right now in one program im using stb_truetype.h to get the position and texcoords from every character i want. And in other one, i have DirectX11 with a texture that i can fill it with some information, in this case the .ttf info. But how do i need to open the .tff to tell the texture something like: "Hey, these are the coordinates you need, copy that pixels and fill yourself"?
  12. Hey Community, I have a question about C# and Unity. For my options menu I wrote a script with C#, that worked fine for a while. My problem is to let unity write a .Json file into the LocalLow folder. At first everything went fine and there occurred no errors, but now the file is only generated completely empty. I didn't change anything in the script and Visual Studio doesn't show any errors to me, so I have no clue what is wrong. As I'm only a beginner, I hope anyone of you guys can find what I messed up and give me some advices. Code for the GameSettings using System.Collections; using System.Collections.Generic; using UnityEngine; public class GameSettings { //all variables assigned to their class. public bool fullscreen; public float musicvolume; public float audiovolume; public int difficulty; public bool subtitles; public int Language; public int vsync; public int texturequality; public int resolution; public float gamma; public int antialiasing; public bool autosave; } Code for the SettingManager using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.IO; public class SettingManager : MonoBehaviour { //all variables assigned to their class. public Slider musicvolumeslider; public Toggle fullscreenToggle; public Slider audiovolumeSlider; public Dropdown difficultyDropdown; public Toggle subtitlesToggle; public Dropdown languageDropdown; public Dropdown vsyncDropdown; public Dropdown texturequalityDropdown; public Slider gammaSlider; public Dropdown antialiasingDropdown; public Toggle autosaveToggle; public Dropdown resolutionDropdown; public Button closeButton; public AudioSource musicSource; public Resolution[] resolutions; public GameSettings gameSettings; void OnEnable() { DontDestroyOnLoad(gameObject); musicvolumeslider.onValueChanged.AddListener(delegate { OnMusicVolumeChange(); }); fullscreenToggle.onValueChanged.AddListener(delegate { OnFullscreenToggle(); }); audiovolumeSlider.onValueChanged.AddListener(delegate { OnAudioVolumeChange(); }); difficultyDropdown.onValueChanged.AddListener(delegate { OnDifficultyChange(); }); subtitlesToggle.onValueChanged.AddListener(delegate { OnSubtitlesChange(); }); languageDropdown.onValueChanged.AddListener(delegate { OnLanguageChange(); }); vsyncDropdown.onValueChanged.AddListener(delegate { OnVSyncChange(); }); texturequalityDropdown.onValueChanged.AddListener(delegate { OnTextureQualityChange(); }); gammaSlider.onValueChanged.AddListener(delegate { OnGammaChange(); }); autosaveToggle.onValueChanged.AddListener(delegate { OnAutosaveToggle(); }); antialiasingDropdown.onValueChanged.AddListener(delegate { OnAAChange(); }); resolutionDropdown.onValueChanged.AddListener(delegate { OnResolutionChange(); }); closeButton.onClick.AddListener(delegate { OnCloseButtonClick(); }); musicSource = GameObject.FindGameObjectWithTag("music").GetComponent<AudioSource>(); gameSettings = new GameSettings(); resolutions = Screen.resolutions; foreach (Resolution resolution in resolutions) { resolutionDropdown.options.Add(new Dropdown.OptionData(resolution.ToString())); } LoadSettings(); } public void OnMusicVolumeChange() { musicSource.volume = gameSettings.musicvolume = musicvolumeslider.value; } public void OnResolutionChange() { Screen.SetResolution(resolutions[resolutionDropdown.value].width, resolutions[resolutionDropdown.value].height, Screen.fullScreen); gameSettings.resolution = resolutionDropdown.value; } public void OnFullscreenToggle() { gameSettings.fullscreen = Screen.fullScreen = fullscreenToggle.isOn; } public void OnAudioVolumeChange() { AudioListener.volume = gameSettings.audiovolume = audiovolumeSlider.value; } public void OnDifficultyChange() { //Not Implemented Yet } public void OnSubtitlesChange() { //Not Implemented Yet } public void OnLanguageChange() { if (languageDropdown.value == 0) LocalizationService.Instance.Localization = "English"; if (languageDropdown.value == 1) LocalizationService.Instance.Localization = "German"; if (languageDropdown.value == 2) LocalizationService.Instance.Localization = "French"; if (languageDropdown.value == 3) LocalizationService.Instance.Localization = "Russian"; if (languageDropdown.value == 4) LocalizationService.Instance.Localization = "Italian"; if (languageDropdown.value == 5) LocalizationService.Instance.Localization = "Chinese"; } public void OnVSyncChange() { QualitySettings.vSyncCount = gameSettings.vsync = vsyncDropdown.value; } public void OnTextureQualityChange() { QualitySettings.masterTextureLimit = gameSettings.texturequality = texturequalityDropdown.value; } public void OnGammaChange() { //Not Implemented Yet } public void OnAAChange() { QualitySettings.antiAliasing = (int)Mathf.Pow(2, antialiasingDropdown.value); gameSettings.antialiasing = antialiasingDropdown.value; } public void OnAutosaveToggle() { //Not Implemented Yet } public void OnCloseButtonClick() { SaveSettings(); } public void SaveSettings() { string jsonData = JsonUtility.ToJson(gameSettings, true); File.WriteAllText(Application.persistentDataPath + "/gamesettings.json", jsonData); } public void LoadSettings() { gameSettings = JsonUtility.FromJson<GameSettings>(File.ReadAllText(Application.persistentDataPath + "/gamesettings.json")); audiovolumeSlider.value = gameSettings.audiovolume; antialiasingDropdown.value = gameSettings.antialiasing; gammaSlider.value = gameSettings.gamma; texturequalityDropdown.value = gameSettings.texturequality; vsyncDropdown.value = gameSettings.vsync; languageDropdown.value = gameSettings.Language; subtitlesToggle.isOn = gameSettings.subtitles; Screen.fullScreen = gameSettings.fullscreen; difficultyDropdown.value = gameSettings.difficulty; resolutionDropdown.value = gameSettings.resolution; autosaveToggle.isOn = gameSettings.autosave; musicvolumeslider.value = gameSettings.musicvolume; resolutionDropdown.RefreshShownValue(); } } Hoping for fast help, SanguineTunic
  13. I need some help to understand what I'm doing wrong here x_x Here's my step: 1) create a new C++ project with starting content, drop a door in the scene. 2)Add a C++ component to the door called OpenDoor 3)add a variable in the .h and initialize it in the .cpp (code below) When I compile this, the editor crash and any future attempt to open the project won't succede. What mistake did I made? Furthermore, if said mistake is made, is the project lost forever or there is a way to restore it? x_x Cause if wathever silly mistake I've made, if it's all it takes to corrupt and lose an entire project, then I'm done with Unreal Editor... x_x OpenDoor.h: // Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "Components/ActorComponent.h" #include "OpenDoor.generated.h" UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) class BUILDINGESCAPE_API UOpenDoor : public UActorComponent { GENERATED_BODY() public: // Sets default values for this component's properties UOpenDoor(); protected: // Called when the game starts virtual void BeginPlay() override; public: // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; private: float DoorYaw; }; OpenDoor.cpp: // Fill out your copyright notice in the Description page of Project Settings. #include "OpenDoor.h" #include "GameFramework/Actor.h" // Sets default values for this component's properties UOpenDoor::UOpenDoor() :DoorYaw{GetOwner()->GetActorRotation().Yaw} { // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features // off to improve performance if you don't need them. PrimaryComponentTick.bCanEverTick = true; // ... } // Called when the game starts void UOpenDoor::BeginPlay() { Super::BeginPlay(); // ... } // Called every frame void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); // ... }
  14. I'm getting a "red minus icon" next to all my .h and .cpp inside of the VS 2017 solution explorer, anyone knows what does it means? It is red so it doesn't mean anything good, right?
  15. I haven’t touched Windows development since Windows Vista, and I have only worked with the Win32 API (not MFC or etc.) I got a project from online that was made for Visual Studio 2015 and up to Windows 8.1, but I see no reason I should not be able to compile it with Visual Studio 2017 (I am running Windows 10 but I don’t think it was re-targeted towards Windows 10 during the project upgrade). But it gives me this error: using Microsoft::WRL::ComPtr; // Error C2653 'Microsoft': is not a class or namespace name Obviously searching for what I need to #include to get a namespace called “Microsoft” is useless—the returns are just MSDN articles explaining what namespaces are as it is not clever enough to realize I am telling it that the namespace is named Microsoft. So clearly I am missing some #include but this is a bit baffling as the project should just work. My research shows this is part of a “Universal” framework. I’ve spent the last 4 hours adding all the optional components to Visual Studio 2017 that could possibly be related and nothing fixes it. What the hell is this, what is the missing #include, and what the hell components do I need in Visual Studio 2017? L. Spiro
  16. I just removed all the white vertical white space for my C++ Visual Studio 2017 project using : ^.$\n What is the recommended standard for the spacing between functions. Is it suggested that a line break be placed after each of the functions' closing brace? If so, is there a convenient method or do I just go through all the code and press enter after each function? Anything else I need to know about line spacing? I don't mean to be petty, I'm just finishing up this project, Thank you, Josheir
  17. I have a library that is split up into 3 parts right now: a utilities lib, platform lib, and a renderer. I want them all the be their own separate .dll and .lib files. My issue is that I cannot seem to get VS to output all the files. My batch file looks like this: @echo off cls set sable_dir=W:\dev\c\sable_lib set src_dir=%sable_dir%\src set deps_dir=%sable_dir%\deps set macros=/DSABLE_LIB_EXPORT set compiler_flags=/LDd /Zi set linker_flags=/DLL /DEBUG set sable_lib_libs= set sable_lib_source_files=%src_dir%\sable_lib\sable_lib.c set sable_lib_output=sable_lib.dll set sable_platform_libs=sable_lib.lib %deps_dir%\sdl2\lib\x64\SDL2main.lib %deps_dir%\sdl2\lib\x64\SDL2.lib set sable_platform_source_files=%src_dir%\sable_lib\sable_platform.c set sable_platform_output=sable_platform.dll set sable_renderer_libs=sable_lib.lib sable_platform.lib %deps_dir%\sdl2\lib\x64\SDL2main.lib %deps_dir%\sdl2\lib\x64\SDL2.lib %deps_dir%\sdl2\lib\x64\SDL2_image.lib set sable_renderer_source_files=%src_dir%\sable_lib\sable_renderer.c %src_dir%\sable_lib\sera\sera.c set sable_renderer_output=sable_renderer.dll pushd W:\dev\c\sable_lib\bin call "C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/vcvarsall.bat" x64 echo. echo BUILDING SABLE_LIB echo. cl %compiler_flags% /Fe%sable_lib_output% %macros% %sable_lib_source_files% %sable_lib_libs% /link %linker_flags% echo. echo BUILDING SABLE_PLATFORM echo. cl %compiler_flags% /Fe%sable_platform_output% %macros% %sable_platform_source_files% %sable_platform_libs% /link %linker_flags% echo. echo BUILDING SABLE_RENDERER echo. cl %compiler_flags% /Fe%sable_renderer_output% %macros% %sable_renderer_source_files% %sable_renderer_libs% /link %linker_flags% popd When the first CL runs it outputs the sable_lib.lib file then sable_lib.dll, which is what I want. Then when cl runs again it outputs sable_platform.dll and sable_lib.lib not sable_platform.lib. Why is this? sable_renderer will not compile without sable_platform.lib. I'm compiling it using sublime text 3's build systems to run the batch file. This is the output: BUILDING SABLE_LIB Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64 Copyright (C) Microsoft Corporation. All rights reserved. sable_lib.c Microsoft (R) Incremental Linker Version 12.00.31101.0 Copyright (C) Microsoft Corporation. All rights reserved. /dll /implib:sable_lib.lib /debug /out:sable_lib.dll /DLL /DEBUG sable_lib.obj Creating library sable_lib.lib and object sable_lib.exp BUILDING SABLE_PLATFORM Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64 Copyright (C) Microsoft Corporation. All rights reserved. sable_platform.c Microsoft (R) Incremental Linker Version 12.00.31101.0 Copyright (C) Microsoft Corporation. All rights reserved. /dll /implib:sable_platform.lib /debug /out:sable_platform.dll /DLL /DEBUG sable_platform.obj sable_lib.lib W:\dev\c\sable_lib\deps\sdl2\lib\x64\SDL2main.lib W:\dev\c\sable_lib\deps\sdl2\lib\x64\SDL2.lib BUILDING SABLE_RENDERER Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64 Copyright (C) Microsoft Corporation. All rights reserved. sable_renderer.c sera.c Generating Code... Microsoft (R) Incremental Linker Version 12.00.31101.0 Copyright (C) Microsoft Corporation. All rights reserved. /dll /implib:sable_renderer.lib /debug /out:sable_renderer.dll /DLL /DEBUG sable_renderer.obj sera.obj sable_lib.lib sable_platform.lib W:\dev\c\sable_lib\deps\sdl2\lib\x64\SDL2main.lib W:\dev\c\sable_lib\deps\sdl2\lib\x64\SDL2.lib W:\dev\c\sable_lib\deps\sdl2\lib\x64\SDL2_image.lib LINK : fatal error LNK1104: cannot open file 'sable_platform.lib' [Finished in 2.1s]
  18. for (Foundation::UInt32 i = 0; ; i++) { hr = pAdapterInfo->pDXGIAdapter->EnumOutputs(i, &pDXGIOutput); if (SUCCEEDED(hr)) { //EnumDisplayModes(pOutputInfo) } SAFE_RELEASE(pDXGIOutput); } else { //None output will be found if (i==0) { //error("EnumOupput error i:%u, error %s", i,str); } break; } } return true; } Hi , guys! I used the upper code to get all resolutions supported by video card which will be selected by players. But the code works perfectly in win7 , but it couldn't find any output in win10, I read a lot of papers ,but can not find why. If anyone else has encountered this problem before ,please gives me some insight! Thanks a lot!
  19. Hello guys,i created a config file and got line by line then parsed to variables.How can i set local (function) variable to global variable ? sorry for bad english. Current code: void GetSettings() { ifstream nameFileout; nameFileout.open("Settings.conf"); string line; if (!nameFileout.is_open()) { exit(0); } while (std::getline(nameFileout, line)) { string parse = "[Zoom]-10"; stringstream ss(parse); string temp = "[Zoom]"; getline(ss, temp, ']'); getline(ss, temp, '['); double Result; stringstream convert(temp); double Z2 = atof(temp.c_str()); AllocConsole(); freopen("CONOUT$", "w", stdout); std::cout << line << std::endl; } nameFileout.close(); } Output : Z2 = -10
  20. I published an existing project to GitHub from Visual Studio 2017 Team Explorer (C++.) Is my public (and local?) repo protected by a password? I'm ready to start using version control, myself, to learn from and I want to make sure someone can't go to my public repo and delete or edit. There seems to be some suggestion about cloning, but I haven't done this. Am I protected by a password? When I set up the account a month ago I seem to remember creating a password and I set up an organization that I'm an owner to. I am never issued with a password request on the internet or from team explorer, is there a simple secure method of security, or am I already protected? Thank you, Josheir
  21. Image below, as you can see my "Init Direct3D" Demo project has a reference to "Direct3D Framework", and yet I cannot #include "D3DApp.h" ... what am I doing wrong? x_x
  22. I am trying to understand Visual Studio's Team Explorer with GitHub. When I push my feature branch it is than available as a remote for other users to pull/use/edit. Then later when it is ready to be merged into one of the master branches which do I merge it to the remote or local branch? Most importantly, what is the need for having a local master and a remote master, I just don't understand why there is a need for two? Thank you, Josheir
  23. I have been studying material for git. What I like is Team Explorer GitHub extension for Visual Studio 2017 C++. To me it seems very integrated and there is seemingly enough reading material. I am trying to learn a version control system so that I will be able to work with others and if nothing else Team Explorer is teaching me some git fundamentals. I believe there are other version control systems other than git and I am wondering if git is a good choice? Perhaps if GitHub Extensions is not recommended than there is another extension program that will work well that could or could not be Git. I explain why I prefer this idea of extensions in the following paragraphs. I am thinking of trying to learn some of the terminal commands too and have installed git command line tools Git Bash and Git CMD. I did also download the GUI program GitHub Desktop but as mentioned elsewhere there seems to be a lack in documentation and because the GitHub extensions for Visual Studio work with the actual Visual Studio this seems to be a better, more powerful, intuitive, understandable, and integrated tool. I also believe that using Visual Studio with the extensions provides an easier experience that can be viewed on the known and understandable usage of code display (i.e. usual tabbed windows.) I expect merge will be an easier experience and so will histories, and comparisons of code on the known application Visual Studio. Also I think it will push and pull in an easy graphical manner that is integrated visually well with Visual Studio and I believe it will also do these push and pulls in a proficient manner (the entire project directory structure.) All around it seems to be a much easier experience. I believe the results are much nicer. I caught on to a mild inkling that this extension might not be the way to go and am writing this post to propose the question, "Is GitHub Extensions for Visual Studio a (hopefully) usable tool?" I really do enjoy it's interface. When I try to understand the benefits of terminal command line git I am having trouble visualizing sufficient viewing of code as it is compared/edited. Even the GUI GitHub Desktop application did not seem to allow for editing and building and possibly the code needed to be in some local repo, otherwise Visual Studio would allow for pushes directly from where the code is being built to. Just build the code and push a few buttons all in one unified application. There also is a .visualstudio.com mentioned by Visual Studio that can be either Git or Team Foundation Version Control that might be nice. Seeing that they are both Visual Studio and perhaps if there is a problem with Team Foundation git becoming outdated this might be a better solution. Should I explore this option and if so which of the either Git or Team Foundation Version Control is recommended? I like using git Team Foundation for GitHub and I hope that it is recommended and that it does not get outdated without an update and if it does perhaps its usage with the terminal will suffice? Thank you so much; I want to work with others, Josheir
  24. Sprint 6 is ready for pick-up.

    Sprint 6 is out. The #WORDSproductions team set the following goals: Create and publish a video of Charly Men introducing the game BIZARRE to potential players. (in German) Create a concept art of world outside Clearwaters appartement windows. Create the main-character, Charly Clearwater, in 3D. Continue working at the first game scene, Clearwaters appartement, i.e. create furniture in 3D and texture them. So, let's start today!
  25. As the following picture shows , I can get the code buff with asm in x86 platform. Has anyone know how to do this in x64 platform??? bool CheckCodeSnipeCrc32() { DWORD addr1, addr2, size; _asm mov addr1, offset codeBegin; _asm mov addr2, offset codeEnd; codeBegin: //OutputDebugString(L"test"); //OutputDebugString(L"test0"); //OutputDebugString(L"test1"); int a = 0; a = a + 1; a = a - 1; codeEnd: size = addr2 - addr1; DWORD curcrc32 = Crc32_ComputeBuf((void*)addr1, size); DWORD oldCrc32 = 0xbcf07446; assert(oldCrc32 == curcrc32); }